[webkit-dev] Non-Scaling Stroke feature (SVGT 1.2)

Jeff Schiller codedread at gmail.com
Mon Nov 16 22:37:13 PST 2009


Hi Dirk,

I wasn't aware of another bug, sorry.

Actually on the patch that I have already attached to that bug, it
seems to work in the few test cases I've been able to find (my own and
a couple from the SVGT 1.2 test suite).  While stroking, I transform
the path with the CTM of the context and un-transform the context
(with its inverse matrix).  Then I undo that after stroking.

The only thing that may be a problem is the dirty rectangle that is
created by paths with non-scaled-strokes.  I need to look at that
after generating some tests.

Regards,
Jeff

On Tue, Nov 17, 2009 at 12:33 AM, Dirk Schulze <krit at webkit.org> wrote:
> Hi,
>
> I thougt that we already had a bug about this. It is a good idea to
> support this feature in general. Even if our support for SVG 1.1 is not
> perfect, we should think about some features of SVG 1.2 like media
> support and also non scaling strokes. But implementing non scaling
> strokes is not that easy. On SVG we transform the context multiple times
> (translate, scale, skew) and stroke the path at the end. We may think
> about transforming the path instead of the context but there might be
> more problems on doing that.
>
> -Dirk
>
> Am Montag, den 16.11.2009, 16:23 -0600 schrieb Jeff Schiller:
>> Hello,
>>
>> I am interested in having broader support for non-scaling stroke on
>> SVG shapes.  This is a SVGT 1.2 feature:
>> http://www.w3.org/TR/SVGTiny12/painting.html#NonScalingStroke
>>
>> This adds a CSS property and attribute: vector-effect.  This property
>> can have three values:  none (default), inherit, or
>> non-scaling-stroke.
>>
>> When non-scaling-stroke, the stroke (outline) of a shape would
>> maintain its specified width regardless of the transforms applied to
>> the shape.  This is very useful when importing foreign SVG into new
>> documents and in GIS/mapping scenarios (for instance, zooming in on a
>> map would not "fatten" the driving directions path).
>>
>> I realize that WebKit has been generally not interested in SVGT 1.2,
>> but I feel it makes sense to cherry-pick certain features that really
>> do improve SVG on the web.  Non-scaling stroke is one of these
>> features.  FWIW, Opera has implemented this feature since version 9.5.
>>
>> I have opened a bug and supplied a patch that gets this off the ground
>> in WebKit:  https://bugs.webkit.org/show_bug.cgi?id=31438  I only need
>> to figure out how to add some tests (need to understand how pixel
>> tests work in WebKit).
>>
>> Darin Adler requested that I bring this up on this list for discussion.
>>
>> Thanks,
>> Jeff Schiller
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
>


More information about the webkit-dev mailing list