Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stroke-width bug?

1 view
Skip to first unread message

Robert

unread,
Oct 29, 2007, 10:47:26 AM10/29/07
to
Hello,

A stroke-width seem to always change in size relative to the current
user coordinate system, even when the length that is specified includes
a unit.

I tested this with a line.

The relevant specifications are found at:
http://www.w3.org/TR/SVG11/painting.html#StrokeProperties
http://www.w3.org/TR/SVG11/types.html#DataTypeLength

"If the <length> is expressed as a value without a unit identifier
(e.g., 48), then the <length> represents a distance in the current user
coordinate system.
If one of the unit identifiers is provided (e.g., 12mm), then the
<length> is processed according to the description in Units."

When I have a line in a viewbox 400,400 and a line with
stroke-width="1px" (or 1mm), and the viewbox is then modified to
100,100, then you can see how the width of the stroke is increased,
while the specification says that it should not do that.

This is a bug, right?
If so, what is the proper place to report such bugs?

Kind regards,
Robert

Robert Longson

unread,
Oct 30, 2007, 10:53:37 AM10/30/07
to
On Oct 29, 2:47 pm, Robert <inva...@user.null> wrote:
> Hello,
>
> A stroke-width seem to always change in size relative to the current
> user coordinate system, even when the length that is specified includes
> a unit.

Everything in SVG is scalable i.e. relative to the current user
coordinate system. Putting in units just changes the relative size of
things.

>
> I tested this with a line.
>

> The relevant specifications are found at:http://www.w3.org/TR/SVG11/painting.html#StrokePropertieshttp://www.w3.org/TR/SVG11/types.html#DataTypeLength


>
> "If the <length> is expressed as a value without a unit identifier
> (e.g., 48), then the <length> represents a distance in the current user
> coordinate system.
> If one of the unit identifiers is provided (e.g., 12mm), then the
> <length> is processed according to the description in Units."
>
> When I have a line in a viewbox 400,400 and a line with
> stroke-width="1px" (or 1mm), and the viewbox is then modified to
> 100,100, then you can see how the width of the stroke is increased,
> while the specification says that it should not do that.
>
> This is a bug, right?

I don't think so but an SVG file showing the issue would might me
understand what you mean more clearly.

> If so, what is the proper place to report such bugs?

You could ask on the yahoo svg developers mailing list if you are
unsure what the functionality should be or raise a bug in bugzilla as
you have done.

>
> Kind regards,
> Robert


Robert

unread,
Oct 31, 2007, 6:12:12 PM10/31/07
to
Robert Longson wrote:
> On Oct 29, 2:47 pm, Robert <inva...@user.null> wrote:
>> Hello,
>>
>> A stroke-width seem to always change in size relative to the current
>> user coordinate system, even when the length that is specified includes
>> a unit.
>
> Everything in SVG is scalable i.e. relative to the current user
> coordinate system.

That's not what I read in the specification.

Robert Longson

unread,
Nov 1, 2007, 7:44:42 AM11/1/07
to
On Oct 31, 10:12 pm, Robert <rob...@news.reply> wrote:
> That's not what I read in the specification.

>From the specification (http://www.w3.org/TR/SVG/
coords.html#Units) ...

The other absolute unit identifiers from CSS (i.e., pt, pc, cm, mm,
in) are all defined as an appropriate multiple of one px unit (which,
according to the previous item, is defined to be equal to one user
unit), based on what the SVG user agent determines is the size of a px
unit *

For example, suppose that the user agent can determine from its
environment that "1px" corresponds to "0.2822222mm" (i.e., 90dpi).
Then, for all processing of SVG content:
o "1pt" equals "1.25px" (and therefore 1.25 user units)
o "1pc" equals "15px" (and therefore 15 user units)
o "1mm" would be "3.543307px" (3.543307 user units)
o "1cm" equals "35.43307px" (and therefore 35.43307 user
units)
o "1in" equals "90px" (and therefore 90 user units)


so specifying units just means "multiply by the appropriate unit
multiplication factor".

Best regards

Robert.

Robert

unread,
Nov 5, 2007, 7:11:57 AM11/5/07
to
Robert Longson wrote:
> On Oct 31, 10:12 pm, Robert <rob...@news.reply> wrote:
>> That's not what I read in the specification.
>
>>From the specification (http://www.w3.org/TR/SVG/
> coords.html#Units) ...

"One px unit is defined to be equal to one user unit."

Thank you. That makes it all clear then.

Getting off-topic:
So there is no way in SVG to make a stroke around a shape that is one
real pixel, which does not increase in size when increasing the scale?

Robert.

Robert Longson

unread,
Nov 5, 2007, 2:06:49 PM11/5/07
to

Only by using javascript to apply an inverse scale to the shape
whenever the global scale changes. I believe SVG 1.2 may have some
proposal for non scalability.

Best regards

Robert

Jonas Sicking

unread,
Nov 5, 2007, 3:29:36 PM11/5/07
to

I believe alex fritze, who originally implemented SVG in mozilla needed
exactly the same thing and implemented that. Not sure if that
implementation ever was submitted and accepted into the mozilla codebase
though.

/ Jonas

0 new messages