Closed devpolant closed 4 years ago
It's definitely a bug that you can call this method on the Stroke
and it will be fixed. However you can just call the correct one to animate stroke of the shape:
node.strokeVar.animate(to: Stroke(fill: Color.green, width: 4), during: 0.3)
I tried and stroke color is changed, thanks! But is there any way to combine stroke and fill animation simultaneously? like:
node.fillVar.animate(to: Color.blue, during: 0.3)
node.strokeVar.animate(to: Stroke(fill: Color.green, width: 4), during: 0.3)
Current result has undefined behaviour:
Fill color is not applying correctly. Ideally fill and stroke animation looks independent, so they shouldn't affect each other.
Yep, looks like a bug.
Precondition
I have circle shape in my simple SVG file.
That's all xml code that we need to reproduce the issue.
This circle is rendering like on this screenshot - circle with red fill color and black stroke color:
Intention
I need to update stroke color, for instance from black to green. So I added the following code into my view controller:
Key line is:
Expected Result
We expect the following result when user taps on circle:
But result is different:
So,
strokeVar
's behaviour is the same likefillVar
's which looks incorrect.You could see the behaviour on this video:
Demo project