From fa0ea55521fd54d3e797d2610180d229a41bc731 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 21 Aug 2009 20:12:01 +0000 Subject: [PATCH] Fixed Issue 98: Blank text field deactives the Selection tool git-svn-id: http://svg-edit.googlecode.com/svn/trunk@447 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index e6db5b6c..78df9136 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2262,8 +2262,17 @@ function SvgCanvas(c) this.getBBox = function(elem) { var selected = elem || selectedElements[0]; + + if(selected.textContent == '') { + selected.textContent = 'a'; // Some character needed for the selector to use. + var ret = selected.getBBox(); + selected.textContent = ''; + } else { + var ret = selected.getBBox(); + } + // get the bounding box from the DOM (which is in that element's coordinate system) - return selected.getBBox(); + return ret; }; this.getRotationAngle = function(elem) { @@ -2400,7 +2409,7 @@ function SvgCanvas(c) while(i--) { var elem = elems[i]; if (elem == null) continue; - + var oldval = (attr == "#text" ? elem.textContent : elem.getAttribute(attr)); if (oldval != val) { if (attr == "#text") elem.textContent = val;