summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
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;
}