diff --git a/editor/svgutils.js b/editor/svgutils.js index 8302ece7..7897adc5 100644 --- a/editor/svgutils.js +++ b/editor/svgutils.js @@ -450,9 +450,7 @@ svgedit.utilities.getBBox = function(elem) { } }); if(issue) { - console.log('get from kids'); ret = getStrokedBBox($(selected).children()); - console.log('ret',ret); } else { ret = selected.getBBox(); } @@ -494,44 +492,6 @@ svgedit.utilities.getBBox = function(elem) { // get the bounding box from the DOM (which is in that element's coordinate system) return ret; - - - if(elname === 'text' && selected.textContent === '') { - selected.textContent = 'a'; // Some character needed for the selector to use. - ret = selected.getBBox(); - selected.textContent = ''; - } else if(elname === 'path' && !svgedit.browser.supportsPathBBox()) { - ret = svgedit.utilities.getPathBBox(selected); - } else if(elname === 'use' && !svgedit.browser.isWebkit() || elname === 'foreignObject') { - ret = selected.getBBox(); - var bb = {}; - bb.width = ret.width; - bb.height = ret.height; - bb.x = ret.x + parseFloat(selected.getAttribute('x')||0); - bb.y = ret.y + parseFloat(selected.getAttribute('y')||0); - ret = bb; - } else if(~visElems_arr.indexOf(elname)) { - try { ret = selected.getBBox();} - catch(e) { - // Check if element is child of a foreignObject - var fo = $(selected).closest("foreignObject"); - if(fo.length) { - try { - ret = fo[0].getBBox(); - } catch(e) { - ret = null; - } - } else { - ret = null; - } - } - } - if(ret) { - ret = svgedit.utilities.bboxToObj(ret); - } - - // get the bounding box from the DOM (which is in that element's coordinate system) - return ret; }; // Function: svgedit.utilities.getRotationAngle