Gradient % values not respected on edit (radial gradient center not rendered correctly), even with userSpaceOnUse
Migrated from: https://bugs.launchpad.net/inkscape/+bug/913431 (2012-01-08)
Original problem
- Radial gradient is defined with cx, cy, fx, fy, and r values.
- When cx and cy values are removed, values should be 50%
- % values are not rendered properly
Steps to reproduce:
- Open Inkscape
- Create a rectangle so it goes over the point (0,0)
- Add a radial gradient
- Go to xml, and go to the second radial gradient tag in the defs
- Delete fx and fy values (note that there is no change, as per spec).
- Delete any transforms on the gradient.
- Delete cx and cy values or replace them with 50% (equivalent as per spec https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementCXAttribute)
What happened?
Radial gradient should have been centered on 50% of the viewbox (as in chrome or firefox).
Instead, it is calculated as 0.5 document units. I.e. default document unit is in mm. The radial gradient center is positioned at (0.5mm, 0.5mm) on the canvas.
Update: Also affects linear gradient, see inbox#223 (closed) for an example file. Same issue really (hence closed as duplicate).
Inkscape Version and Operating System:
- Inkscape 1.0alpha (ef3963e2 Apr 24 2019), Linux Mint 19.1
- Inkscape 0.48.2 and 0.48+devel r10860 on OS X Lion
Test cases (provided by su_v)
913431-radial-gradient-4-inkscape.svg
913431-radial-gradient-4-no-cx.svg
913431-radial-gradient-4-no-cy.svg
913431-radial-gradient-4-no-cx-cy.svg
Related issue
Related issue: inbox#223 (closed)
Edited by Nathan Lee