Fixed last part of issue 172

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@564 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-09-04 16:26:48 +00:00
parent 4043d459dd
commit b995f1663a
1 changed files with 9 additions and 6 deletions

View File

@ -2294,6 +2294,7 @@ function BatchCommand(text) {
var nodes = svgroot.childNodes; var nodes = svgroot.childNodes;
var len = svgroot.childNodes.length; var len = svgroot.childNodes.length;
var i = 0; var i = 0;
current_poly_pts = [];
this.clearSelection(); this.clearSelection();
for(var rep = 0; rep < len; rep++){ for(var rep = 0; rep < len; rep++){
if (nodes[i].nodeType == 1) { // element node if (nodes[i].nodeType == 1) { // element node
@ -2309,6 +2310,12 @@ function BatchCommand(text) {
call("cleared"); call("cleared");
}; };
this.clearPoly = function() {
removeAllPointGripsFromPoly();
current_poly = null;
current_poly_pts = [];
};
this.getResolution = function() { this.getResolution = function() {
return [svgroot.getAttribute("width"), svgroot.getAttribute("height")]; return [svgroot.getAttribute("width"), svgroot.getAttribute("height")];
}; };
@ -2350,16 +2357,12 @@ function BatchCommand(text) {
if (current_mode == "poly" && current_poly_pts.length > 0) { if (current_mode == "poly" && current_poly_pts.length > 0) {
var elem = svgdoc.getElementById(getId()); var elem = svgdoc.getElementById(getId());
elem.parentNode.removeChild(elem); elem.parentNode.removeChild(elem);
removeAllPointGripsFromPoly(); canvas.clearPoly();
canvas.clearSelection(); canvas.clearSelection();
started = false; started = false;
current_poly = null;
current_poly_pts = [];
} }
else if (current_mode == "polyedit") { else if (current_mode == "polyedit") {
removeAllPointGripsFromPoly(); canvas.clearPoly();
current_poly = null;
current_poly_pts = [];
} }
cur_properties = (selectedElements[0] && selectedElements[0].nodeName == 'text') ? cur_text : cur_shape; cur_properties = (selectedElements[0] && selectedElements[0].nodeName == 'text') ? cur_text : cur_shape;