lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Object using clip path cannot have its opacity animated #526

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a clipPath
2. Reference the clipPath via the clip-path attribute of a shape, such as a rect
3. Animate the opacity of that shape from 0 to 1

What is the expected output? What do you see instead?
I would expect the shape to fade in while retaining its clip.  Instead there 
are no intermediate frames between the from and to, it simply pops into 
visibility at the end of the animation.

What version of the product are you using? On what operating system,
browser, and version of Flash?
IE8, Vista, 10.1

Please provide any additional information below. Reduced test cases are
always appreciated!
I've attached an example of this problem.  There are two rects being animated 
at the same time, both their opacity and their x attribute.  You can see the 
rect not using the clip path works great.  The other using the clip path is 
moving, but its opacity stays at 0 until the opacity animation is over and then 
it uses 1.

I actually found this as a reault of fixing Issue 514.  I saw that my sample 
svg files stopped animating their opacity once I had svgweb respect the clip 
path that was in the style.  

Original issue reported on code.google.com by bduncan%...@gtempaccount.com on 28 Jun 2010 at 7:24

Attachments:

GoogleCodeExporter commented 8 years ago
Its apparently not just opacity thats affected.  Heres an altered example that 
does height and x.  The x works fine.  The height on the other hard exhibits 
seemingly the same behavior, which is to hide the object unto the animation is 
complete, and then show it again.

Original comment by bduncan%...@gtempaccount.com on 29 Jun 2010 at 12:35

Attachments:

GoogleCodeExporter commented 8 years ago
The issue appears to be due to removing and readding the mask to the clipSprite 
unnecessarily.  I have made a fairly minor change to hold onto the node that we 
are using as the basis for the clip path, and then check it when we go to apply 
the clip path again during the next draw cycle.  If its the same node that is 
currently used as the clip, then we will not remove and readd a clone of the 
node as the clip.  The clone should be updated by the normal clone updating 
process, so changes to the original should be picked up without needing to make 
a new clone.  I have attached another example.  This one allows you to 
dynamically change the clip path being used for the moving rectangle by 
clicking in the white or yellow rect.  This shows that the clip path is still 
being updated when it needs to be, its just that the unneccesary removals and 
readds have been eliminated.  Note that the attached patch also has the diffs 
from Issue 321 in it.

Original comment by bduncan%...@gtempaccount.com on 29 Jun 2010 at 6:30

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in r1209.
Thanks for the patch!

Original comment by grick23@gmail.com on 3 Aug 2010 at 2:58