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

Animating multiple parameters doesn't work #1325

Open
harrison3000 opened this issue Sep 5, 2024 · 6 comments
Open

Animating multiple parameters doesn't work #1325

harrison3000 opened this issue Sep 5, 2024 · 6 comments

Comments

@harrison3000
Copy link

Bug report

Animating multiple parameters at the same time isn't working (it did work on the old 3.0 version), it doesn't matter if its a single call with a multiple property object, or multiple chained calls. On the Fiddle I changed the stroke, but it also doesn't work with other parameters, like changing the color and radius of a circle for example

Fiddle

https://jsfiddle.net/0s9pqe5r/

Explanation

  • What is the behaviour you expect?

    • The color and width of the border to change
  • What is happening instead?

    • Only the color is changing
  • What error message are you getting?

    • None
@Fuzzyma
Copy link
Member

Fuzzyma commented Sep 5, 2024

I assume this is only about "stroke"? Or are other functions involved?
Fill also seems to have issues.

@harrison3000
Copy link
Author

Not just "stroke", I also tried animating color and radius at the same time and its also broken

@Fuzzyma
Copy link
Member

Fuzzyma commented Sep 5, 2024

but this works: https://jsfiddle.net/jcLn37pq/

@harrison3000
Copy link
Author

The order of the chaining also has a influence:
https://jsfiddle.net/rasovw37/

@harrison3000
Copy link
Author

harrison3000 commented Sep 8, 2024

I took a quick look at the returned runner object and noticed that the _history.attr.morpher._to array only has values related to the property that was set last on the chain

this:

//works fine
rc2.animate(500).attr({
    "fill": '#f00',
    "stroke-width": 10
});

gives this:

[ "fill", null, 5, 255,    0,    0,    0,    "rgb",    "stroke-width",    null,    2,    10,    "" ]

While this:

//only stroke-width changes
rc2.animate(500).attr({"fill": '#f00'}).attr({"stroke-width": 10});

gives this:

[ "stroke-width",  null,   2, 10,  "" ]

As a workaround I will just use a single attr and set everything at once for now

@Fuzzyma
Copy link
Member

Fuzzyma commented Sep 8, 2024

Interesting! Thx for investigating!
That actually helps a lot

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

2 participants