[Xfce4-commits] <ristretto:ristretto-0.0> Do not change zoom-mode when switching to fullscreen, recalculate scale when fitting image to window.

Stephan Arts noreply at xfce.org
Sun Oct 23 19:20:16 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to a4f7e2f0e83118bfd8cb5ff2cee068c60f19efe3 (commit)
       from 21468830a5194de5ecabf3cc1739b9e283f2077f (commit)

commit a4f7e2f0e83118bfd8cb5ff2cee068c60f19efe3
Author: Stephan Arts <stephan at xfce.org>
Date:   Tue Sep 22 23:44:11 2009 +0200

    Do not change zoom-mode when switching to fullscreen, recalculate scale when fitting image to window.

 ChangeLog            |    6 ++++++
 src/main_window.c    |    2 +-
 src/picture_viewer.c |   14 +++++++++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b1a76c5..6b8721e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-22  Stephan Arts <stephan at xfce.org>
+
+	* src/main_window.c,
+	  src/picture_viewer.c: Do not change zoom-mode when switching to
+	  fullscreen, recalculate scale when fitting image to window (zoom-fit)
+
 2009-09-19  Stephan Arts <stephan at xfce.org>
 
 	* src/preferences_dialog.c: Set current value to 'show-preview'
diff --git a/src/main_window.c b/src/main_window.c
index 3bc4a0a..d95959c 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1209,7 +1209,7 @@ cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event,
                 gtk_widget_hide (window->priv->thumbnailbar);
             }
 
-            rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER (window->priv->picture_viewer));
+            /*rstto_picture_viewer_zoom_fit (RSTTO_PICTURE_VIEWER (window->priv->picture_viewer));*/
 
             gtk_ui_manager_add_ui (window->priv->ui_manager,
                                    window->priv->toolbar_unfullscreen_merge_id,
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 63d934c..6bbcafc 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1137,19 +1137,23 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer)
         scale = *p_scale;
         fit_to_screen = *p_fit_to_screen;
 
-        if (scale <= 0)
+        if (scale <= 0.0)
         {
             scale = rstto_picture_viewer_calculate_scale (viewer);
-            if (scale > 1)
-                scale = 1;
+            if (scale > 1.0)
+            {
+                scale = 1.0;
+                fit_to_screen = FALSE;
+            }
             else
                 fit_to_screen = TRUE;
         }
         if (fit_to_screen == TRUE)
         {
-            *p_fit_to_screen = TRUE;
-            *p_scale = scale;
+            scale = rstto_picture_viewer_calculate_scale (viewer);
         }
+        *p_fit_to_screen = fit_to_screen;
+        *p_scale = scale;
     }
 
 


More information about the Xfce4-commits mailing list