From 66e69f45f4defb18c3575a4560a0af3fd778b754 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 14 Aug 2009 15:50:11 +0000 Subject: [PATCH] Fix Issue 87 via Alexis' patch: remove poly artifacts when switching mode in mid-creation of poly git-svn-id: http://svg-edit.googlecode.com/svn/trunk@378 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 14cc4038..bdbd8079 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1331,6 +1331,7 @@ function SvgCanvas(c) while(i--) { document.getElementById("polypointgrip_"+i).setAttribute("display", "none"); } + document.getElementById("poly_stretch_line").setAttribute("display", "none"); }; var addAllPointGripsToPoly = function() { @@ -1625,7 +1626,6 @@ function SvgCanvas(c) } removeAllPointGripsFromPoly(); - document.getElementById("poly_stretch_line").setAttribute("display", "none"); // this will signal to commit the poly element = poly; @@ -1771,11 +1771,15 @@ function SvgCanvas(c) this.setMode = function(name) { // toss out half-drawn poly if (current_mode == "poly" && current_poly_pts.length > 0) { - element.parentNode.removeChild(svgdoc.getElementById(getId())); + var elem = svgdoc.getElementById(getId()); + elem.parentNode.removeChild(elem); + removeAllPointGripsFromPoly(); + canvas.clearSelection(); + started = false; current_poly = null; current_poly_pts = []; } - current_mode = name; + current_mode = name; }; this.getStrokeColor = function() {