summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorStephen Silver <sasilver@yahoo.com>2008-05-31 15:16:57 +0000
committersasilver <sasilver@users.sourceforge.net>2008-05-31 15:16:57 +0000
commitf709f7f377a37c2bec986965d5b0709675ef4538 (patch)
tree9f6461a79cfea499b1fd58e6b51c4930125dcae5 /src/document.cpp
parentCmake: added windows path to find modules. (diff)
downloadinkscape-f709f7f377a37c2bec986965d5b0709675ef4538.tar.gz
inkscape-f709f7f377a37c2bec986965d5b0709675ef4538.zip
wrtlprnft's patch for bug 234834 - keeps guidelines in same position relative to objects when doing "Fit page to selection", and also keeps the objects in the same position on the screen
(bzr r5771)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/document.cpp b/src/document.cpp
index d0792ab8a..bf5ef089e 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -48,6 +48,8 @@
#include "inkscape-private.h"
#include "inkscape_version.h"
#include "sp-object-repr.h"
+#include "sp-namedview.h"
+#include "desktop.h"
#include "document-private.h"
#include "dir-util.h"
#include "unit-constants.h"
@@ -557,6 +559,14 @@ void SPDocument::fitToRect(NR::Rect const &rect)
NR::translate const tr(NR::Point(0, (old_height - h))
- rect.min());
SP_GROUP(root)->translateChildItems(tr);
+ SPNamedView *nv = sp_document_namedview(this, 0);
+ if(nv) {
+ NR::translate tr2(-rect.min());
+ nv->translateGuides(tr2);
+
+ // update the viewport so the drawing appears to stay where it was
+ nv->scrollAllDesktops(-tr2[0], tr2[1], false);
+ }
}
void sp_document_set_uri(SPDocument *document, gchar const *uri)