diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-05-09 12:40:32 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-05-09 12:40:32 +0000 |
| commit | 3273a297ec79e7391dfdd1c5b9756791fa497f37 (patch) | |
| tree | c6afac157a4cdfc8f7cc5b622391573b9648369a /src/ui | |
| parent | Another intermediate update (diff) | |
| download | inkscape-3273a297ec79e7391dfdd1c5b9756791fa497f37.tar.gz inkscape-3273a297ec79e7391dfdd1c5b9756791fa497f37.zip | |
When changing document size, the origin (lower left corner) should be stationary. This way the guides will keep their relative position w.r.t. the objects (bug #167762), and also everything will be redrawn properly (bug #179373)
(bzr r7840)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index cdb0feff3..02688a55e 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -36,6 +36,7 @@ #include "desktop.h" #include "page-sizer.h" #include "helper/action.h" +#include "sp-root.h" using std::pair; @@ -346,8 +347,13 @@ PageSizer::setDim (double w, double h, bool changeList) if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); + double const old_height = sp_document_height(doc); sp_document_set_width (doc, w, &_px_unit); sp_document_set_height (doc, h, &_px_unit); + // 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))); + SP_GROUP(SP_ROOT(doc->root))->translateChildItems(vert_offset); sp_document_done (doc, SP_VERB_NONE, _("Set page size")); } |
