Hi Praveen,

"Praveen Nayak" <[EMAIL PROTECTED]> wrote on 10/18/2007 04:32:17 
AM:

> I have a path that draws a line, an arc and a Z to complete the shape.
> 
>                 <path style="stroke:black;fill:#FF9966" d="M0,0L0,
> 140A140 140 1 1 0 -3.4288977907026563e-14,140z" 
> transform="translate(4.898425415289509e-15,-40)" />
> 
> But canvas does not draw the arc. 
> 
> I then saw that it does not handle the size -3.4288977907026563e-14.
> (Got through math functions)

   Right this is a precision issue.

> This works with adobe viewer though.

   They probably hold the coords as a double precision floats.

> I then changed it to -0.0001 and it worked. Some more leading zeros 
> to the 1 and it will again not work.

   Right a float has ~8 digits of precision.  '140' is 3 digits,
'0.0001' is 4 more digits so even there you are on the edge of
140.0001 -> 140.  If that happens then you have an arc that
goes from 0, 140 to 0, 140 with a radius of 140... unfortunately
there are an infinite number of such circles.  If you really want
such a circle I would suggest using two arc commands.  Have the
first do one half of the circle and have the second finish the
circle, then you can really close the circle, rather than leaving
a small 'flat' edge.

>                 <path style="stroke:black;fill:#FF9966" d="M0,0L0,
> 140A140 140 1 1 0 -0.0001,140z" transform="translate(4.
> 898425415289509e-15,-40)" />

  For example (not entirely sure the arc flags are right).
    d="M0,0 L0,140 A140,140 1 1 0 -140,140 A140,140 1 1 0 0,140z"

> So, is this a bug with Batik, or a specification of SVG?

   Implementations are allowed to hold coordinate data as float
so one can reasonably argue this is a bug in your specification
of the path.
  • Path problem Praveen Nayak
    • Re: Path problem thomas . deweese

Reply via email to