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

ShapeAnimationGenerator is not setting lineDashPhase for Stroke.offset #496

Closed
fangpenlin opened this issue Oct 29, 2018 · 1 comment
Closed
Milestone

Comments

@fangpenlin
Copy link
Contributor

I tried simple animation on offset of stroke like this

let line = Line(
        x1: 0, y1: 100,
        x2: 300, y2: 100 
    )
    .stroke(with: Stroke(fill: Color.black, width: 3))
let animation = line.strokeVar.animation(
    from: Stroke(fill: Color.black, width: 5, dashes: [5, 100], offset: 0),
    to: Stroke(fill: Color.red, width: 5, dashes: [5, 100], offset: 20),
    during: 1.0,
    delay: 0.0
)
animation.autoreversed().cycle().play()

And it looks like the animation for the line here is not working at all. After looking into source code, I realized that lineDashPhase is not set for Stroke.offset in ShapeAnimationGenerator.

https://github.com/exyte/Macaw/blob/master/Source/animation/types/animation_generators/ShapeAnimationGenerator.swift#L109

and

https://github.com/exyte/Macaw/blob/master/Source/animation/types/animation_generators/ShapeAnimationGenerator.swift#L195-L203

I will open a PR shortly addressing this lineDashPhase animation missing bug.

@amarunko
Copy link
Contributor

Hi, @fangpenlin, yes, you are right, Macaw doesn't support "lineDashPhase" animation for now. You are always welcome to send a PR, thanks!

@ystrot ystrot added this to the 0.9.4 milestone Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants