Summary: | SVG pattern transformation/BoundingBox can cause ugly stroke thickness or text positions | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dirk Schulze <krit> | ||||||||||
Component: | SVG | Assignee: | Nobody <webkit-unassigned> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | eric, zimmermann | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | OS X 10.5 | ||||||||||||
URL: | http://svg.tutorial.aptico.de/grafik_svg/kap11_3.svg | ||||||||||||
Attachments: |
|
Description
Dirk Schulze
2009-01-21 23:49:25 PST
Patterns have the same problem as the REGRESSION on gradients (https://bugs.webkit.org/show_bug.cgi?id=23547). The transformation of the pattern is applied to the CTM. This causes strange transformations of the text, or unwanted stroke thikness, depending on the transformation. Stroke thickness is only influenced by scaling skewing or a transformationmatrix that scales or skewes. We need a general redesign here, to get both fixed, gradients as well as patterns and to minimize code snippets for both. Created attachment 27099 [details]
Transformed pattern on text
Created attachment 27100 [details]
scaled patttern on stroke
The stroke should be small line.
Created attachment 27115 [details]
transform the pattern instead of the context
Just transform the pattern instead of the context. Texts and strokes are no longer affected by pattern transformations.
Looks fine to me, after a lengthy discussion on IRC. Eric should have a final look. Some namings need to change, Pattern::setTransform, should get a better name (so it's visible it's a pattern-space transformation), and 'patternMatrix' should be renamed to sth like 'userSpaceTransformation' - to not confuse anyone with two matrices with nearly equal names. Created attachment 27163 [details]
transform the pattern instead of the context
renamed components
Comment on attachment 27163 [details] transform the pattern instead of the context Looks nice, some comments: > + // Pattern space is an abstract space that maps to the default user space by the transformation matrix > + // you specify with the userSpaceTransformation parameter. > + PlatformPatternPtr createPlatformPattern(const TransformationMatrix& userSpaceTransformation) const; I'd shorten the comment: > + // Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransformation' Just leave out the comment for setPatternSpaceTransform, and make the argument 'const TransformationMatrix&'. > + void setPatternSpaceTransform(TransformationMatrix patternSpaceTransformation) { m_patternSpaceTransformation = patternSpaceTransformation; } r=me with thse fixups. |