Apache OpenOffice (AOO) Bugzilla – Issue 121801
Import / Insert SVG: Y-scale of gradientTransform-matrix is not applied to radius in y-direction, but only to center point
Last modified: 2014-08-01 13:51:23 UTC
Created attachment 80304 [details] transformed radial gradient for transformed shape The attached files contain the same radial gradient. Its gradientTransform attribute has a matrix with different scale in X- and Y-direction. This gradient is referenced from the fill of a rectangular path. The radial gradient has only one radius attribute. But when it is transformed, it is no longer a circle, but becomes an ellipse and needs a radius for X-direction and a radius for Y-direction. In Draw the radius in Y-direction is the same as the radius in X-direction. Open the attached svg-pictures in an actual browser and insert them into Draw-document. Compare it to see the error.
Created attachment 80305 [details] transformed radial gradient for shape with only shift
Reproducible with server installation of "AOO 3.4.1 – German UI / German locale [AOO341m1(Build:9593) - Rev.1372282]" on WIN7 Home Premium (64bit)", own separate user profile: In Seamonkey Browswer or inserted into LibO DRAW both sample.svg are shown with light blue rectangle surrounding gradients ellipses. In AOO the gradient areas exceed the light blue rectangle at top and bottom. It does not matter whether samples are opened with AOO Craw or inserted as 'Picture from File' Was ok with 3.4.1, so REGRESSION
ALG: Problem is that indeed (as Regina shows) the transformation is applied to the radius in case of a SvgLinearGradientPrimitive2D to create the basic geometries. This cannot reflect a uneven scaling in the transformation at all. As alternative two radii would be usable, but the transformation is not restricted and could thus contain all kinds of transformations. Another alternative would be to use vectors as X and Y-Axis what would work, but is in tiT#s functionality to transporting an embedded coordinate system identical to using the transfomation directly. Thus, best solution is to transport that transformation in the primitive and to apply it in it's decomposition. Anyways that transformation was applied in the wrong place, as the SVG spec says ("This additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations"). Added to th eprimitive, aplying where defined, works. Also corrected a bug that 'display' statements may be part of a combined 'style' statement and was not applied correctly in this case. Corrected some other minor stuff, too. Checked with the testfiles, also created one for a linear gradient with transformation, works well. Preparing checkin...
"alg" committed SVN revision 1482726 into trunk: i121801 Corrected handling of gradient transformations
ALG: Checked with #120616# and found another problem - had to adapt applying the transformation for objectBoundingBox case. Also cleanup.
ALG: Okay, all examples look good now.
"alg" committed SVN revision 1482740 into trunk: i121801 Corrected objectBoundingBox case for GradientTransform
ALG: Probably done with #122318#
ALG: OOps, wrong task. Please ignore comment before this one
Verified in AOO411m4(Build:9774) - Rev. 1614049 (=RC1)