After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738367 - Incorrect handling of V/v/H/h commands in path
Incorrect handling of V/v/H/h commands in path
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
git master
Other Linux
: Immediate normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-11 19:56 UTC by Andrea Griffini
Modified: 2015-03-13 20:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix (853 bytes, patch)
2014-10-11 19:56 UTC, Andrea Griffini
none Details | Review

Description Andrea Griffini 2014-10-11 19:56:33 UTC
Created attachment 288286 [details] [review]
Proposed fix

The code for vertical/horizontal movement incorrectly only sets one X/Y component of the last reference point used for smooth bezier arcs.
This implies an incorrect rendering of cases where the path contains a h/v command followed by s or t. The problem can be seen with

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg id="svg2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 300" version="1.1">
  <path fill="#AAA" stroke="#F00" d="m100,50c100,0,100,100,0,150s-100,50,0,50z"/>
  <path fill="#AAA" stroke="#F00" d="m300,50c100,0,100,100,0,150h0s-100,50,0,50z"/>
  <path fill="#AAA" stroke="#F00" d="m500,50c100,0,100,100,0,150v0s-100,50,0,50z"/>
  <path fill="#AAA" stroke="#F00" d="m700,50c100,0,100,100,0,150l0,0s-100,50,0,50z"/>
</svg>

where the 2nd 3rd and 4th paths should be rendered identical and different from the first one (they contain "v0", "h0" and "l0,0") but only the last one is correct because h/v code only resets one component of last reference point.
Comment 1 Federico Mena Quintero 2015-03-13 20:15:01 UTC
Thanks for fixing this!  I pushed your patch with a minor stylistic fix to commit 9628f3da0023bfd3e919e2bfb4c2dc10ad45d9ab.