Skip to content

[BUG] Not clear what point is in anim_rotate_around( angle , point) #471

@ArbitRandomUser

Description

@ArbitRandomUser

Describe the bug
The docstring for anim_rotate_around describes

help?> ?anim_rotate_around
search: anim_rotate_around

  anim_rotate_around

  Animate the rotation of the attached object (see act!) around a point. Similiar function: anim_rotate to rotate or spin an object

  Example
  ≡≡≡≡≡≡≡≡≡

  Background(1:100, ground)
  obj = Object((args...) -> rect(O, 50, 50, :fill), Point(100, 0))
  act!(obj, Action(1:50, anim_rotate_around(2π, O)))

  Options
  ≡≡≡≡≡≡≡≡≡

    •  anim_rotate_around(ta::Real, p) define the end angle of the rotation + the rotation center.

    •  anim_rotate_around(fa::Real, ta::Real, p) define the from and end angle + the rotation center.

julia> 

However it is not clear what the rotation center is

To Reproduce

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

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

  3. Javis version (i.e output of ] status Javis in the REPL) [78b212ba] Javis v0.8.0 ~/Javis.jl

  4. Minimum working code example that led to bug: (above)

using Javis
using Animations

video=Video(150,150)
nframes=100
ext=30
Background(1:nframes+ext, (args...)-> background("white"))

obj = Object(1:nframes+ext,(args...)-> box(O,10,20,:stroke),O+1 )
obj2 = Object(1:nframes+ext,(args...)-> circle(O+50,5,:fill) )
act!(obj, Action(1:nframes÷2 , anim_translate(O+50)))
act!(obj, Action(nframes÷2+1:nframes, anim_rotate_around(2π,O)  ))

render(video, pathname="test.gif")

Expected Behavior and Actual Behavior

what O in anim_rotate_around( 2π, O) should be better documented.
If intended to be a position relative to the canvas then this is a bug .
or it should be documented that the Point is relative to the objects current position.

Screenshots

test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions