From dd41cd6cea1745d636be1917cf691063a099b562 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Thu, 28 Jan 2010 02:55:11 +0000 Subject: [PATCH] Fix bug in conversion of horiz/vert path segments git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1290 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index e2af9f90..93561e8f 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -4796,17 +4796,35 @@ function BatchCommand(text) { case 1: // z,Z closepath (Z/z) d += "z"; break; + case 12: // absolute horizontal line (H) + x -= curx; + case 13: // relative horizontal line (h) + if(toRel) { + curx += x; + } else { + x += curx; + curx = x; + } + addToD([[x]]); + break; + case 14: // absolute vertical line (V) + y -= cury; + case 15: // relative vertical line (v) + if(toRel) { + cury += y; + } else { + y += cury; + cury = y; + } + addToD([[y]]); + break; case 2: // absolute move (M) case 4: // absolute line (L) - case 12: // absolute horizontal line (H) - case 14: // absolute vertical line (V) case 18: // absolute smooth quad (T) x -= curx; y -= cury; case 3: // relative move (m) case 5: // relative line (l) - case 13: // relative horizontal line (h) - case 15: // relative vertical line (v) case 19: // relative smooth quad (t) if(toRel) { curx += x;