diff --git a/editor/svg-editor.js b/editor/svg-editor.js index db822b1e..3cf59417 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1853,10 +1853,6 @@ $('#styleoverrides').text(''); $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); $(button).addClass('tool_button_current').removeClass('tool_button'); - // when a tool is selected, we should deselect any currently selected elements - if(button !== '#tool_select') { - svgCanvas.clearSelection(); - } return true; }; @@ -2273,13 +2269,15 @@ }; var clickText = function(){ - toolButtonClick('#tool_text'); - svgCanvas.setMode('text'); + if (toolButtonClick('#tool_text')) { + svgCanvas.setMode('text'); + } }; var clickPath = function(){ - toolButtonClick('#tool_path'); - svgCanvas.setMode('path'); + if (toolButtonClick('#tool_path')) { + svgCanvas.setMode('path'); + } }; // Delete is a contextual tool that only appears in the ribbon if diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 4b4b531c..34a82077 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -5342,9 +5342,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) { cleanupElement(element); if(current_mode == "path") { pathActions.toEditMode(element); - } else if (current_mode == "text" || current_mode == "image" || current_mode == "foreignObject") { - // keep us in the tool we were in unless it was a text or image element - addToSelection([element], true); } else { selectOnly([element], true); }