lewisje / svgweb

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

Radial Gradient userSpaceOnUse Matrix calculated incorrectly for SVGCircle and SVGEllipse nodes #504

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Use a Radial Gradient with a fx/fy different from the cx/cy for the fill or 
stroke of a circle or ellipse.

What is the expected output? What do you see instead?
A radial gradient with the specified fx/fy as the fill or stroke of the 
circle or ellipse.  Instead, generally no gradient appears. 

What version of the product are you using? On what operating system,
browser, and version of Flash?
2010-04-09-dracolisk, Windows Vista, IE8, 10.0.45.2 

Please provide any additional information below. Reduced test cases are
always appreciated!
The cause of the problem is the -objectX/-objectY translate being applied 
to the matrix.  Just as there is weirdness for the circle and ellipse in 
object bounds mode, there is weirdness in userSpaceOnUse mode as well.  In 
this case we are NOT to translate by the objectX/Y for circles/ellipses.  
Strange stuff.  Attached is a test case, radialgradient02.svg.  This test 
uses a different radial gradient fill in each of two circles and two 
ellipses.  It draws a circle or ellipse across each circle or ellipse using 
the appropriate radial gradient stroke.  It draws a green circle around the 
radial gradient's circumference and a red filled circle at the focal point 
of the radial gradient.  Attached, also, is a before and after screenshot, 
as well as the fix as a svn diff.  Note that this diff contains a fix for 
issues 502 and 503 as well.

Original issue reported on code.google.com by bduncan%...@gtempaccount.com on 1 Jun 2010 at 8:21

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by bradneub...@gmail.com on 1 Jun 2010 at 10:44

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

These radial gradient matrix fixes were real gems. Hats off to Bruce Duncan and
anyone else from Visual Mining that contributed. This is a very complex area of 
the
code and I know how difficult those calculations can get. I found little
documentation on the flash gradient matrix stuff so figuring it out was very
difficult to begin with. I am curious how you were able to figure out these 
remaining
issues!

Original comment by grick23@gmail.com on 4 Jun 2010 at 2:55