W3C home > Mailing lists > Public > www-svg@w3.org > December 2012

Draw polygonal line with a looping

From: (wrong string) 黃俊毓 <yillkid@gmail.com>
Date: Sat, 22 Dec 2012 15:45:52 +0800
Message-ID: <CAEgOEMsSp9hGqF5MdxTnxU+Mxp+5kVPq9rGiNxeSU+6Ef3-kqg@mail.gmail.com>
To: www-svg@w3.org
Hi all

I drew polygon line with canvas before, code example as below:

var ctx = canvas.getContext("2d");


{ data in loop }
    ctx.lineTo(x , {{data}});
{ endfor }


Set "moveto" one time and using "lineto" with a looping.

Now I change to the SVG, and want to do that again.

But after reading document it seems can not.

For example:

if I use "path" : <path d="M150 0 L75 200 L225 200 Z" />
I need decide "moveto" and "lineto" point at the same time.

if I use "line":
<line x1="0" y1="0" x2="300" y2="300"

same does "line".

So how should I can draw  a polygonal line with a looping ?
Received on Saturday, 22 December 2012 22:44:27 UTC

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