Fixed issue 116: Select a shape by dragging the mouse while being in Edit node of a polyline breaks all the tools

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@457 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2009-08-24 17:40:41 +00:00
parent b006ce9693
commit d27fcf1da9

View File

@@ -1077,12 +1077,12 @@ function SvgCanvas(c)
if($.inArray(current_mode, ['select', 'resize']) == -1) { if($.inArray(current_mode, ['select', 'resize']) == -1) {
addGradient(); addGradient();
} }
start_x = x;
start_y = y;
switch (current_mode) { switch (current_mode) {
case "select": case "select":
started = true; started = true;
start_x = x;
start_y = y;
current_resize_mode = "none"; current_resize_mode = "none";
var t = evt.target; var t = evt.target;
// WebKit returns <div> when the canvas is clicked, Firefox/Opera return <svg> // WebKit returns <div> when the canvas is clicked, Firefox/Opera return <svg>
@@ -1255,6 +1255,20 @@ function SvgCanvas(c)
if (id.substr(0,14) == "polypointgrip_") { if (id.substr(0,14) == "polypointgrip_") {
current_poly_pt_drag = parseInt(id.substr(14)); current_poly_pt_drag = parseInt(id.substr(14));
} }
if(current_poly_pt_drag == -1) {
canvas.clearSelection();
canvas.setMode("multiselect");
if (rubberBox == null) {
rubberBox = selectorManager.getRubberBandBox();
}
rubberBox.setAttribute("x", start_x);
rubberBox.setAttribute("y", start_y);
rubberBox.setAttribute("width", 0);
rubberBox.setAttribute("height", 0);
rubberBox.setAttribute("display", "inline");
}
break; break;
default: default:
console.log("Unknown mode in mousedown: " + current_mode); console.log("Unknown mode in mousedown: " + current_mode);