Cleanup code left from last revision
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1987 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
085d7f479f
commit
292391150f
|
@ -450,9 +450,7 @@ svgedit.utilities.getBBox = function(elem) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(issue) {
|
if(issue) {
|
||||||
console.log('get from kids');
|
|
||||||
ret = getStrokedBBox($(selected).children());
|
ret = getStrokedBBox($(selected).children());
|
||||||
console.log('ret',ret);
|
|
||||||
} else {
|
} else {
|
||||||
ret = selected.getBBox();
|
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)
|
// get the bounding box from the DOM (which is in that element's coordinate system)
|
||||||
return ret;
|
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
|
// Function: svgedit.utilities.getRotationAngle
|
||||||
|
|
Loading…
Reference in New Issue