From d27fcf1da98b718cf87980da603a60efff6c2555 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 24 Aug 2009 17:40:41 +0000 Subject: [PATCH] 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 --- editor/svgcanvas.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index cfc15cf5..d215425c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1077,12 +1077,12 @@ function SvgCanvas(c) if($.inArray(current_mode, ['select', 'resize']) == -1) { addGradient(); } + start_x = x; + start_y = y; switch (current_mode) { case "select": started = true; - start_x = x; - start_y = y; current_resize_mode = "none"; var t = evt.target; // WebKit returns
when the canvas is clicked, Firefox/Opera return @@ -1255,6 +1255,20 @@ function SvgCanvas(c) if (id.substr(0,14) == "polypointgrip_") { 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; default: console.log("Unknown mode in mousedown: " + current_mode);