summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7db3d30)
raw | patch | inline | side by side (parent: 7db3d30)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 9 May 2009 12:40:32 +0000 (12:40 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 9 May 2009 12:40:32 +0000 (12:40 +0000) |
src/ui/widget/page-sizer.cpp | patch | blob | history |
index cdb0feff30b68b52db7631c794ae6df6b77f2c52..02688a55e67ac6370c31ba744e2027915ec07596 100644 (file)
#include "desktop.h"
#include "page-sizer.h"
#include "helper/action.h"
+#include "sp-root.h"
using std::pair;
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"));
}