W3C home > Mailing lists > Public > www-svg@w3.org > July 2004

Re: units

From: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Date: Sat, 17 Jul 2004 16:08:59 +1000
To: SVG List <www-svg@w3.org>
Message-ID: <20040717060859.GC13357@mcc.id.au>

MenTaLguY:
> On Wed, 2004-07-14 at 00:22, Cameron McCormack wrote:
> 
> >   <svg width="100pt" height="100pt">
> >     <rect x="25pt" y="25pt" width="50pt" height="25pt" fill="red"/>
> >     <svg viewBox="0 0 100 100">
> >       <path d="M25,50L75,50L75,75L25,75L25,50z" fill="blue"/>
> >     </svg>
> >   </svg>
> 
> 
> What if I wanted to specify the path's stroke width in pt?

Since you know that the viewBox has transformed the space into 1 user
unit = 1 pt, you could just have stroke-width="1".  A trickier case
would be if you want to specify the stroke-width in another unit, like
em.  I don't see a solution to that, aside from using script to
determine the equivalent value in user units.

A more complete solution would be to modify the path syntax to allow
units.  That might make the path data parser more complex, which I guess
is something the WG try to avoid.

Cameron

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922
Received on Saturday, 17 July 2004 02:09:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:54 UTC