GNOME Bugzilla – Bug 738367
Incorrect handling of V/v/H/h commands in path
Last modified: 2015-03-13 20:15:01 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.
Thanks for fixing this! I pushed your patch with a minor stylistic fix to commit 9628f3da0023bfd3e919e2bfb4c2dc10ad45d9ab.