From b995f1663a385dff7881de086f9f88909542bf39 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 4 Sep 2009 16:26:48 +0000 Subject: [PATCH] Fixed last part of issue 172 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@564 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index e40ec06e..cb18503c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2294,6 +2294,7 @@ function BatchCommand(text) { var nodes = svgroot.childNodes; var len = svgroot.childNodes.length; var i = 0; + current_poly_pts = []; this.clearSelection(); for(var rep = 0; rep < len; rep++){ if (nodes[i].nodeType == 1) { // element node @@ -2308,6 +2309,12 @@ function BatchCommand(text) { selectorManager.initGroup(); call("cleared"); }; + + this.clearPoly = function() { + removeAllPointGripsFromPoly(); + current_poly = null; + current_poly_pts = []; + }; this.getResolution = function() { return [svgroot.getAttribute("width"), svgroot.getAttribute("height")]; @@ -2350,16 +2357,12 @@ function BatchCommand(text) { if (current_mode == "poly" && current_poly_pts.length > 0) { var elem = svgdoc.getElementById(getId()); elem.parentNode.removeChild(elem); - removeAllPointGripsFromPoly(); + canvas.clearPoly(); canvas.clearSelection(); started = false; - current_poly = null; - current_poly_pts = []; } else if (current_mode == "polyedit") { - removeAllPointGripsFromPoly(); - current_poly = null; - current_poly_pts = []; + canvas.clearPoly(); } cur_properties = (selectedElements[0] && selectedElements[0].nodeName == 'text') ? cur_text : cur_shape;