diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-27 16:32:55 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-27 16:32:55 +0000 |
| commit | f10048be170a45921ae8fc65ccd2588a9ad2897d (patch) | |
| tree | c0abadf8d3b7ffb325061d797e5b8d9d8b2aefeb /src/ui/widget/page-sizer.cpp | |
| parent | Use real world units for page sizes. (diff) | |
| download | inkscape-f10048be170a45921ae8fc65ccd2588a9ad2897d.tar.gz inkscape-f10048be170a45921ae8fc65ccd2588a9ad2897d.zip | |
Added viewBox implement document unit support.
(bzr r12475.1.2)
Diffstat (limited to 'src/ui/widget/page-sizer.cpp')
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 5a289096c..94c7b453a 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -476,12 +476,12 @@ PageSizer::setDim (Inkscape::Util::Quantity w, Inkscape::Util::Quantity h, bool if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); - double const old_height = doc->getHeight(); + Inkscape::Util::Quantity const old_height = doc->getHeight(); doc->setWidth (w); doc->setHeight (h); // The origin for the user is in the lower left corner; this point should remain stationary when // changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this - Geom::Translate const vert_offset(Geom::Point(0, (old_height - h.quantity))); + Geom::Translate const vert_offset(Geom::Point(0, (old_height.value("px") - h.value("px")))); doc->getRoot()->translateChildItems(vert_offset); DocumentUndo::done(doc, SP_VERB_NONE, _("Set page size")); } @@ -709,6 +709,7 @@ PageSizer::on_value_changed() void PageSizer::on_units_changed() { + if (_widgetRegistry->isUpdating()) return; _unit = _dimensionUnits.getUnit().abbr; setDim (Inkscape::Util::Quantity(_dimensionWidth.getValue(""), _dimensionUnits.getUnit()), Inkscape::Util::Quantity(_dimensionHeight.getValue(""), _dimensionUnits.getUnit())); |
