Fix regression due to earlier fix of issue 937
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2072 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
f2c76b4b39
commit
2d74a7ace5
|
@ -345,10 +345,12 @@ svgedit.utilities.getPathBBox = function(path) {
|
|||
var bounds = [[], []];
|
||||
var start = seglist.getItem(0);
|
||||
var P0 = [start.x, start.y];
|
||||
|
||||
|
||||
for(var i=0; i < tot; i++) {
|
||||
var seg = seglist.getItem(i);
|
||||
|
||||
|
||||
if(typeof seg.x == 'undefined') continue;
|
||||
|
||||
// Add actual points to limits
|
||||
bounds[0].push(P0[0]);
|
||||
bounds[1].push(P0[1]);
|
||||
|
|
|
@ -110,6 +110,17 @@
|
|||
equal(svgedit.utilities.getUrlFromAttr('url("#foo")'), "#foo");
|
||||
});
|
||||
|
||||
test("Test getPathBBox", function() {
|
||||
if(svgedit.browser.supportsPathBBox()) return;
|
||||
var doc = svgedit.utilities.text2xml('<svg></svg>');
|
||||
var path = doc.createElementNS(svgns, 'path');
|
||||
path.setAttributeNS(null, 'd', 'm0,0l5,0l0,5l-5,0l0,-5z');
|
||||
var bb = svgedit.utilities.getPathBBox(path);
|
||||
equals(typeof bb, 'object', 'BBox returned object');
|
||||
ok(bb.x && !isNaN(bb.x));
|
||||
ok(bb.y && !isNaN(bb.y));
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
|
Loading…
Reference in New Issue