Issue 120397 - svg: gradient vector ignored, when end points outside view box
Summary: svg: gradient vector ignored, when end points outside view box
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: open-import (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-29 20:40 UTC by Regina Henschel
Modified: 2013-07-12 16:18 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
example with rotated gradient vector (1.03 KB, image/svg+xml)
2012-07-29 20:40 UTC, Regina Henschel
no flags Details
Test doc with gradient in various rotations for two rectangles with different aspect ratio (11.58 KB, application/vnd.oasis.opendocument.graphics)
2012-08-01 08:43 UTC, Armin Le Grand
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2012-07-29 20:40:17 UTC
Created attachment 78771 [details]
example with rotated gradient vector

Open the attached document in a browser to see how it should be rendered.

Start a new Draw document and insert the attached svg-picture.
Notice, that the gradient is not rotated.

The reason is, that the end points (x1|y1) and (x2|y2) of the gradient vector are outside the view box. But that is necessary for to start the color gradient in the corner of the rectangle. Therefore such vectors need to be interpreted too.

The attached file has been generated be AOO, I corrected only the wrong colors.
Comment 1 Armin Le Grand 2012-07-31 12:47:42 UTC
ALG: Could reproduce, taking ownership.
Comment 2 Armin Le Grand 2012-08-01 08:43:37 UTC
Created attachment 78797 [details]
Test doc with gradient in various rotations for two rectangles with different aspect ratio

ALG: The import is okay, problem is in SvgLinearGradientPrimitive2D::create2DDecomposition which uses the unified gradient definition, but wrongly applies it to the object transformation. This leads to applying the rotation angle (which is implicit in the SvgLinearGradientPrimitive2D by the start and end position) to the unified range (1.0, 1.0), not to the object-defined one (in this case 10000, 4000). Changed that, created test document.
Comment 3 SVN Robot 2012-08-01 08:44:22 UTC
"alg" committed SVN revision 1367886 into trunk:
#120397# Corrected linear gradient primitive decomposition
Comment 4 Armin Le Grand 2012-08-01 08:44:52 UTC
ALG: Done.
Comment 5 liuping 2012-08-28 08:21:17 UTC
verify on AOO350ml 1377620 on Win7-64bit,pass