summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2014-11-28 20:54:41 +0000
committerapenner <penner@vaxxine.com>2014-11-28 20:54:41 +0000
commit561b8791651a0b3f9d49dfd9809519f06039e0a4 (patch)
treeeda7c9f819d13cbb691be35d5870211e5848ee5e /src/document.cpp
parentDutch translation update (diff)
downloadinkscape-561b8791651a0b3f9d49dfd9809519f06039e0a4.tar.gz
inkscape-561b8791651a0b3f9d49dfd9809519f06039e0a4.zip
avoid recalculating viewbox if it is not necessary. (Bug 1384915, comment 24)
Fixed bugs: - https://launchpad.net/bugs/1384915 (bzr r13776)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 25afc1311..c7d14727a 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -627,7 +627,7 @@ Inkscape::Util::Quantity SPDocument::getWidth() const
return Inkscape::Util::Quantity(result, unit_table.getUnit(u));
}
-void SPDocument::setWidth(const Inkscape::Util::Quantity &width)
+void SPDocument::setWidth(const Inkscape::Util::Quantity &width, bool changeSize)
{
Inkscape::Util::Unit const *old_units = unit_table.getUnit("px");
if (root->width.unit)
@@ -638,7 +638,7 @@ void SPDocument::setWidth(const Inkscape::Util::Quantity &width)
root->width.value = width.quantity;
root->width.unit = (SVGLength::Unit) width.unit->svgUnit();
- if (root->viewBox_set)
+ if (root->viewBox_set && changeSize)
root->viewBox.setMax(Geom::Point(root->viewBox.left() + (root->width.value / old_converted) * root->viewBox.width(), root->viewBox.bottom()));
root->updateRepr();
@@ -662,7 +662,7 @@ Inkscape::Util::Quantity SPDocument::getHeight() const
return Inkscape::Util::Quantity(result, unit_table.getUnit(u));
}
-void SPDocument::setHeight(const Inkscape::Util::Quantity &height)
+void SPDocument::setHeight(const Inkscape::Util::Quantity &height, bool changeSize)
{
Inkscape::Util::Unit const *old_units = unit_table.getUnit("px");
if (root->height.unit)
@@ -673,7 +673,7 @@ void SPDocument::setHeight(const Inkscape::Util::Quantity &height)
root->height.value = height.quantity;
root->height.unit = (SVGLength::Unit) height.unit->svgUnit();
- if (root->viewBox_set)
+ if (root->viewBox_set && changeSize)
root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + (root->height.value / old_converted) * root->viewBox.height()));
root->updateRepr();