Bug 1408 : Some floating points numbers in SVG paths are not correctly handled
Last modified: 2009-12-04 15:21




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
PhiLhoČ
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-12-04 02:46
See thread Loading an SVG file
<http://processing.org/discourse/yabb2/YaBB.pl?num=1259848142>

In SVG paths, Processing handle negative sign only at the start of a
number, not inside (ie. after a e/E).
So -55 is OK, 1E7 is OK, -1E7 is OK, but not 1E-2.

Paths - SVG 1.1 - 20030114 <http://www.w3.org/TR/SVG/paths.html>
number:
sign? integer-constant
| sign? floating-point-constant
integer-constant:
digit-sequence
floating-point-constant:
fractional-constant exponent?
| digit-sequence exponent
fractional-constant:
digit-sequence? "." digit-sequence
| digit-sequence "."
exponent:
( "e" | "E" ) sign? digit-sequence
sign:
"+" | "-"
digit-sequence:
digit
| digit digit-sequence
digit:
"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

Although probably never used, the + sign should be handled, in theory, too.
Additional Comment #1 From fry 2009-12-04 05:58
thanks for the report, and also checking the spec for me! that would have
been my next question, since i didn't realize they even allowed e notation
in svg (it would seem to contradict some of the other choices they've
made). i'll try to get that fixed soon.

http://upload.wikimedia.org/wikipedia/commons/5/5f/USA_Counties_with_FIPS_and_names.svg
Additional Comment #2 From fry 2009-12-04 15:21
now fixed in svn for whatever release comes after 1.0.9. thanks again.