r.path("M0 0L50 0L25 25L0 0")
You'd need a little math to get a perfect triangle but this should get
you something triangleish.
-Mat
On Mar 16, 2010, at 6:57 AM, Karim Elgammal <egk...@gmail.com> wrote:
> please...I want to draw triangle..how to draw using raphael
> thx
> --
> You received this message because you are subscribed to the Google
> Groups "Raphaël" group.
> To post to this group, send an email to raph...@googlegroups.com.
> To unsubscribe from this group, send email to raphaeljs+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/raphaeljs?hl=en-GB
> .
Sent from my iPod
-Mat
On Mar 16, 2010, at 10:08 PM, Dmitry Baranovskiy <dmitry.ba...@gmail.com
Yep. 'z' is awesome.
r.path("M0,100,50,50,100,100z")
But get nothing on the canvas.
This works though:
r.path("M0,100,L,50,50,100,100z");
So I'm guessing the behavior is to repeat the last move/line/curve
directive if it's omitted?
Thanks,
Mat
r.path("M0,100 L50,50 L100,100 z")
(M denotes the starting coordinate, L denotes subsequent coordinates,
z ends the path)
On Mar 17, 7:31 am, Mat Schaffer <m...@schaffer.me> wrote:
> This doesn't seem to work for me. I just tried:
>
> r.path("M0,100,50,50,100,100z")
>
> But get nothing on the canvas.
>
> This works though:
>
> r.path("M0,100,L,50,50,100,100z");
>
> So I'm guessing the behavior is to repeat the last move/line/curve
> directive if it's omitted?
>
> Thanks,
> Mat
>
> On Tue, Mar 16, 2010 at 10:08 PM, Dmitry Baranovskiy
>
> <dmitry.baranovs...@gmail.com> wrote:
> > Just a small note: you can write it shorter.
> > R.path("M0,0,50,0,25,25z");
>
> > Sent from my iPod
>
> > On 16/03/2010, at 10:49 PM, Mat Schaffer <m...@schaffer.me> wrote:
>
> >> Use a path:
>
> >> r.path("M0 0L50 0L25 25L0 0")
>
> >> You'd need a little math to get a perfect triangle but this should get
> >> you something triangleish.
>
> >> -Mat
>
Ironically, they use a triangle as their example.
Also didn't work for me but it should:
http://www.w3.org/TR/SVG11/paths.html#PathDataMovetoCommands
"If a moveto is followed by multiple pairs of coordinates, the
subsequent pairs are treated as implicit lineto commands."
Maybe it's a Raphaël bug? I'm still on 1.2.5. Anybody checked the
latest?
-Mat
On Mar 17, 2010, at 7:15 PM, Ed Davies <ggl.rt...@edavies.nildram.co.uk
> wrote:
paper.path("M0,100,50,50,100,100z");
didn't work in 1.2.5 whereas
paper.path("M0,100L50,50,100,100z");
did. Both work in 1.3.2. I assume it's one of the "small fixes"
Dmitry mentions in this tweet:
http://twitter.com/RaphaelJS/status/10693024738
Thanks Dmitry.
By the way, my preferred way of writing this would be:
paper.path("M0,100L50,50 100,100z");
or
paper.path("M0,100 50,50 100,100z");
with commas between the ordinates within the pairs and spaces between
the pairs but no extra punctuation. It seems to me to be the most
natural and readable minimal length form.
Thanks,
Mat
2010/3/18 Ed Davies <ggl.rt...@edavies.nildram.co.uk>: