Fixed issue 82: Resizable Canvas
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@420 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -1969,8 +1969,25 @@ function SvgCanvas(c)
|
||||
h = svgroot.getAttribute("height");
|
||||
|
||||
var handle = svgroot.suspendRedraw(1000);
|
||||
|
||||
if(!x) {
|
||||
canvas.clearSelection();
|
||||
|
||||
// Get bounding box
|
||||
var bbox = svgroot.getBBox();
|
||||
|
||||
if(bbox) {
|
||||
x = bbox.x + bbox.width;
|
||||
y = bbox.y + bbox.height;
|
||||
} else {
|
||||
alert('No content to fit to');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
svgroot.setAttribute("width", x);
|
||||
svgroot.setAttribute("height", y);
|
||||
|
||||
svgroot.unsuspendRedraw(handle);
|
||||
addCommandToHistory(new ChangeElementCommand(svgroot, {"width":w,"height":h}, "resolution"));
|
||||
call("changed", [svgroot]);
|
||||
|
||||
Reference in New Issue
Block a user