diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-01-16 16:18:45 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-01-16 16:18:45 +0000 |
| commit | 03cb69220632b0c674efff5be3aab8be35d23eff (patch) | |
| tree | 464a1f74c57b796604ceb38c1687d579d2891800 /src/ui/widget/page-sizer.cpp | |
| parent | update to trunk (diff) | |
| parent | Test implementation of 'shape-padding'. (diff) | |
| download | inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.tar.gz inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.zip | |
update to trunk
(bzr r13708.1.7)
Diffstat (limited to 'src/ui/widget/page-sizer.cpp')
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index df464fbb0..8c3b44bf5 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -32,7 +32,7 @@ #include <2geom/transforms.h> -#include "desktop-handles.h" + #include "document.h" #include "desktop.h" #include "helper/action.h" @@ -309,7 +309,7 @@ PageSizer::PageSizer(Registry & _wr) // Setting default custom unit to document unit SPDesktop *dt = SP_ACTIVE_DESKTOP; - SPNamedView *nv = sp_desktop_namedview(dt); + SPNamedView *nv = dt->getNamedView(); _wr.setUpdating (true); if (nv->page_size_units) { _dimensionUnits.setUnit(nv->page_size_units->abbr); @@ -477,14 +477,15 @@ PageSizer::setDim (Inkscape::Util::Quantity w, Inkscape::Util::Quantity h, bool _unit = w.unit->abbr; if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { - SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); + SPDocument *doc = SP_ACTIVE_DESKTOP->getDocument(); Inkscape::Util::Quantity const old_height = doc->getHeight(); - doc->setWidth (w, changeSize); - doc->setHeight (h, changeSize); + doc->setWidthAndHeight (w, h, changeSize); // 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.value("px") - h.value("px")))); - doc->getRoot()->translateChildItems(vert_offset); + if (changeSize) { + 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")); } @@ -606,7 +607,7 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing() SPNamedView *nv; Inkscape::XML::Node *nv_repr; - if ((doc = sp_desktop_document(SP_ACTIVE_DESKTOP)) + if ((doc = SP_ACTIVE_DESKTOP->getDocument()) && (nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { _lockMarginUpdate = true; |
