summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-09-11 23:22:50 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-09-11 23:22:50 +0000
commit339aeee1f861a5f917bebafbdbb341b7cd08bb00 (patch)
treec6f9d474910c0e219a9e8476c8aadbcdcf41aad1 /src/file.cpp
parentCompute farthest-from-center point correctly in Alt+rotation (diff)
downloadinkscape-339aeee1f861a5f917bebafbdbb341b7cd08bb00.tar.gz
inkscape-339aeee1f861a5f917bebafbdbb341b7cd08bb00.zip
Preserve current zoom and view for reverted documents
(bzr r3724)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index a08be62c0..abb00be4c 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -264,7 +264,16 @@ sp_file_revert_dialog()
if (do_revert) {
// Allow overwriting of current document.
doc->virgin = TRUE;
+
+ // remember current zoom and view
+ double zoom = desktop->current_zoom();
+ NR::Point c = desktop->get_display_area().midpoint();
+
reverted = sp_file_open(uri,NULL);
+ if (reverted) {
+ // restore zoom and view
+ desktop->zoom_absolute(c[NR::X], c[NR::Y], zoom);
+ }
} else {
reverted = false;
}