diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2014-01-21 01:36:09 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2014-01-21 01:36:09 +0000 |
| commit | d94a93e813b9e4a30f82925670b30de93fc63d38 (patch) | |
| tree | 26d77ae4df52759d6acc6a2c8e839645af33bf4f /src/document.cpp | |
| parent | Fix imprecise viewBox dimensions on page size change (bug #1235279). (diff) | |
| download | inkscape-d94a93e813b9e4a30f82925670b30de93fc63d38.tar.gz inkscape-d94a93e813b9e4a30f82925670b30de93fc63d38.zip | |
Revert last commit (breaks changing document units).
(bzr r12966)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/document.cpp b/src/document.cpp index 8b956d5e7..e56adee68 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -585,7 +585,6 @@ Inkscape::Util::Quantity SPDocument::getWidth() const void SPDocument::setWidth(const Inkscape::Util::Quantity &width) { gdouble old_computed = root->width.computed; - gdouble old_value = root->width.value; root->width.computed = width.value("px"); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ @@ -597,14 +596,8 @@ void SPDocument::setWidth(const Inkscape::Util::Quantity &width) root->width.unit = (SVGLength::Unit) width.unit->svgUnit(); } - if (root->viewBox_set) { - if (abs(old_value - root->viewBox.width()) < 0.00001) { - root->viewBox.setMax(Geom::Point(root->viewBox.left() + root->width.value, root->viewBox.bottom())); - } - else { - root->viewBox.setMax(Geom::Point(root->viewBox.left() + (root->width.computed / old_computed) * root->viewBox.width(), root->viewBox.bottom())); - } - } + if (root->viewBox_set) + root->viewBox.setMax(Geom::Point(root->viewBox.left() + (root->width.computed / old_computed) * root->viewBox.width(), root->viewBox.bottom())); root->updateRepr(); } @@ -629,7 +622,6 @@ Inkscape::Util::Quantity SPDocument::getHeight() const void SPDocument::setHeight(const Inkscape::Util::Quantity &height) { gdouble old_computed = root->height.computed; - gdouble old_value = root->height.value; root->height.computed = height.value("px"); /* SVG does not support meters as a unit, so we must translate meters to * cm when writing */ @@ -641,14 +633,8 @@ void SPDocument::setHeight(const Inkscape::Util::Quantity &height) root->height.unit = (SVGLength::Unit) height.unit->svgUnit(); } - if (root->viewBox_set) { - if (abs(old_value - root->viewBox.height()) < 0.00001) { - root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + root->height.value)); - } - else { - root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + (root->height.computed / old_computed) * root->viewBox.height())); - } - } + if (root->viewBox_set) + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + (root->height.computed / old_computed) * root->viewBox.height())); root->updateRepr(); } |
