Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] render fails with StackOverflowError on Tutorial 1 #473

Closed
pbouffard opened this issue Mar 17, 2022 · 1 comment
Closed

[BUG] render fails with StackOverflowError on Tutorial 1 #473

pbouffard opened this issue Mar 17, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@pbouffard
Copy link

Describe the bug

The render call in the first tutorial fails once the act! call is introduced to demonstrate animation. The tutorial up to that point works fine, i.e. just rendering the static red and blue circles.

To Reproduce

  1. Julia Version (i.e. output of julia -v): 1.7.2

  2. Operating system (Mac, Linux, Windows): Mac

  3. Javis version (i.e output of ] status Javis in the REPL): v0.8.0#main (same for released version)

  4. Minimum working code example that led to bug:5.

using Javis

myvideo = Video(500, 500)

function ground(args...)
    background("white")
    Javis.sethue("black")
end

function object(p=0, color="black")
    sethue(color)
    circle(p, 25, :fill)
    return p
end

Background(1:70, ground) 
red_ball = Object(1:70, (args...) -> object(O, "red"), Point(100,0))
act!(red_ball`,` Action(anim_rotate_around(2π, 0)))

render(myvideo; pathname="circle.gif")

Expected Behavior and Actual Behavior

Expected: Works as per tutorial.

Actual: Error:

javistutorials % julia --project=@. tutorial1.jl                                                                                             8:55:17
ERROR: LoadError: StackOverflowError:
Stacktrace:
 [1] Javis.Rotation(from::Float64, to::Float64, center::Int64) (repeats 79984 times)
   @ Javis ~/.julia/packages/Javis/TCcr1/src/structs/Transitions.jl:40
in expression starting at /Users/patrick/dev/javis/javistutorials/tutorial1.jl:19
@pbouffard pbouffard added the bug Something isn't working label Mar 17, 2022
@pbouffard
Copy link
Author

pbouffard commented Mar 17, 2022

Ah, should have pushed through a bit more. I realized that I used a 0 instead of an O in the anim_rotate_around call. So much for not copy-pasting example code in order to develop some muscle memory! :)

That said, I wonder if it would help to introduce O separately in the tutorial to better highlight it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant