W3C home > Mailing lists > Public > www-svg@w3.org > June 1999

<polygon> element attributes...

From: Jeremy Lea <reg@shale.csir.co.za>
Date: Mon, 14 Jun 1999 02:21:14 +0200
To: www-svg@w3.org
Message-ID: <19990614022114.A34212@shale.csir.co.za>

I don't know about Joe Bloggs and his dog, but I'd want to put 'cx' and
'cy' attributes into the DTD for the polygon element?

As I've been reading the spec and writing code, I've been collecting
some ideas, suggestions and questions.  These are not recommendations,
just some things off the top of my head...  Unfortunately I'm a
researcher by employment and I tend to question everything ;)

Other than the above:

Would it be better to use <polyline verts="x,y;x,y;x,y;"/>?  It just
seems less error prone to me.  You still have to walk the verts string
twice, to work out how many sets there are, allocate the array then fill
it.  This would also allow you to strip all white space from the string
before you parse it without affecting the numerical representations.

Some suggestions around the <path> element:

Same suggestion as above.  Use , and ; as coordinate separators. 
Especially here, this would allow you to do things like
d="D100,100,,,50" to draw a circle. (IMHO the r? arguments should be
before the a? arguments...) This doesn't increase the size of minimal
representation, but does make it a lot easier (and less error prone) to
parse.  Manual editors would leave spaces to make their eyes happy, but
people won't normally manually edit a file where minimal size is a
criteria?  The current spec seems to prefer white space as a
separator...  I'd worry that during editing/processing it's too easy to
remove this space.

How about 'z' to close a path and 'Z' to close a path and fill it? 
Otherwise you have to fiddle with the styles in the middle of a lot of
paths that I can think of...

Shouldn't there also be path equivalents to rect and polygon?

Just in trying to parse and represent <path> and <data> it seems to me
that they are going to be very hard to reflect into the DOM in a way
that is manageable.

That's enough for now...


  |   "Come home my prodigal son, come home and lets be one,
--+--  don't want to see you cry, don't make me tell you why,
  |    you've lived in a house with me, my blood has set you free,
  |    in the world you'll surely die, nothing else will satisfy." -MIC
Received on Sunday, 13 June 1999 20:21:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:46 UTC