From 622e69d46d2e53e8bf2562dff810ebb8eb811e91 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Tue, 11 Sep 2007 23:22:50 +0000 Subject: [PATCH] Preserve current zoom and view for reverted documents --- src/file.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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; } -- 2.30.2