[Webkit-unassigned] [Bug 23547] REGRESSION: SVG gradient transformation/BoundingBox can cause ugly stroke thickness
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 26 13:00:46 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=23547
------- Comment #4 from krit at webkit.org 2009-01-26 13:00 PDT -------
There was some confusion about this bug.
To the examples: The stroke thickness of each side should be identical.
Complain the example:
We have a gradient in boundinBoxMode. This means the gradient has a dimension
of 1 to 1 (width to height).
And we have a rect with the dimension of 300 to 100.
Now we want to stroke the rect with the gradient. That means the gradient size
must match the size of the rect with stroke width.
To do that we have to scale the gradient by 300 for width and 100 for height.
The current code just transforms the context, by scaling the context. The path
(our rect) is not affected by this scaling.
After that we stroke the path with the gradient.
But the scaling of the context affects the stroke thickness. Once the scaling
of width and height have differnet dimensions, the stroke thikness differs on
the top to bottom and left to right.
This wrong behavior was integrated in r38952.
The important difference between the old and the new code is the handling of
paths. The old code calls clipToStrokePath(contextRef, path) right before the
transformation of the context. This creates a new path, the stroke path. After
the transformation, the path is filled and not stroked. Thats why the old code
works unlike the new one. The stroke path isn't affected by the transformation.
How to fix it:
There are two ways to fix this issue.
1. only transform the gradient instead of the whole context. This way the
context isn't touched and we have no problems with stroke thickness. We need to
implement a new method on Gradient.cpp applyTransformation. This would apply
the transformation during creating the gradient or afterwards. This will work
for Qt, Cairo, Skia. Not sure about CG
2. Use the old variant and create a new stroke path. This works CG,Qt but won't
work for cairo. cairo_stroke_to_path wasn't implemented yet.
Maybe we can use both variants, depending on the platform.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list