Wrong parsing of stroke-dasharray attribute when using decimals with omitted 0

Bug #1441045 reported by Olivier Berten
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Tavmjong Bah

Bug Description

If the drawing uses decimals without the leading 0, the second element of the pair gets misinterpreted. In the test drawing attached,

stroke-dasharray=".537,.537"

is interpreted as

stroke-dasharray="0.537, 537"

Tags: styles svg
Revision history for this message
Olivier Berten (olivier-berten) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

confirmed on Windows XP, Inkscape 0.91+devel r14031 (Mar 24 2015)

inspect the original file to see that the line has the attribute:
stroke-dasharray=".537,.537",
with no style attribute.

now load the file into Inkscape, select the line, and hit the down arrow to refresh the line. Save it as testsaved.svg, attached here. Note that the stroke-dasharray attribute has been converted into a style attribute where the second dasharray length is too long.

  <line
     id="e1_line"
     x1="460"
     y1="208"
     x2="814"
     y2="268"
     vector-effect="non-scaling-stroke"
     style="fill:none;stroke:#000000;stroke-width:0.09;stroke-dasharray:0.537, 537" />

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp)
tags: added: styles svg
Revision history for this message
su_v (suv-lp) wrote :

On OS X 10.7.5, reproduced with Inkscape 0.47, 0.48.5, 0.91 and 0.91+devel r14044 (not a recent regression).

--
<off-topic>
When filing new reports, please always include information about OS/platform and Inkscape version, thank you.
</off-topic>

Changed in inkscape:
importance: Undecided → Medium
Revision history for this message
Olivier Berten (olivier-berten) wrote :

Oops... forgot the basics indeed ;-)

Ubuntu 14.10
Inkscape 0.91

Revision history for this message
jazzynico (jazzynico) wrote :

Still reproduced on Windows XP (32-bit), Inkscape trunk rev. 14948.

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
jazzynico (jazzynico) wrote :

Fix confirmed on Windows XP, with r14950. Thanks Tav!

Changed in inkscape:
assignee: nobody → Tavmjong Bah (tavmjong-free)
milestone: none → 0.92
status: Triaged → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.