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
master
Jeff Schiller 2009-08-14 15:50:11 +00:00
parent d653745a70
commit 66e69f45f4
1 changed files with 7 additions and 3 deletions

View File

@ -1331,6 +1331,7 @@ function SvgCanvas(c)
while(i--) { while(i--) {
document.getElementById("polypointgrip_"+i).setAttribute("display", "none"); document.getElementById("polypointgrip_"+i).setAttribute("display", "none");
} }
document.getElementById("poly_stretch_line").setAttribute("display", "none");
}; };
var addAllPointGripsToPoly = function() { var addAllPointGripsToPoly = function() {
@ -1625,7 +1626,6 @@ function SvgCanvas(c)
} }
removeAllPointGripsFromPoly(); removeAllPointGripsFromPoly();
document.getElementById("poly_stretch_line").setAttribute("display", "none");
// this will signal to commit the poly // this will signal to commit the poly
element = poly; element = poly;
@ -1771,11 +1771,15 @@ function SvgCanvas(c)
this.setMode = function(name) { this.setMode = function(name) {
// toss out half-drawn poly // toss out half-drawn poly
if (current_mode == "poly" && current_poly_pts.length > 0) { 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 = null;
current_poly_pts = []; current_poly_pts = [];
} }
current_mode = name; current_mode = name;
}; };
this.getStrokeColor = function() { this.getStrokeColor = function() {