From 5148ff2c9fe4f7e68071df902f41fa2031c7a8a8 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 10 Aug 2008 14:34:10 +0000 Subject: [PATCH] Recent refactorings seems to have made the centering hack obsolete so use 2008-08-10 Martin Nordholts * app/display/gimpdisplayshell.c (gimp_display_shell_fill): Recent refactorings seems to have made the centering hack obsolete so use gimp_display_shell_scroll_center_image_on_next_size_allocate() instead. svn path=/trunk/; revision=26488 --- ChangeLog | 7 +++++++ app/display/gimpdisplayshell.c | 38 +--------------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index c42e79f837..4104eabe3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-10 Martin Nordholts + + * app/display/gimpdisplayshell.c (gimp_display_shell_fill): Recent + refactorings seems to have made the centering hack obsolete so use + gimp_display_shell_scroll_center_image_on_next_size_allocate() + instead. + 2008-08-10 Martin Nordholts * app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap): diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 1e1fc065ca..a726fff625 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1326,35 +1326,6 @@ gimp_display_shell_empty (GimpDisplayShell *shell) gimp_ui_manager_update (shell->popup_manager, shell->display); } -static void -gimp_display_shell_center_image_callback (GimpDisplayShell *shell, - GtkAllocation *allocation, - GtkWidget *canvas) -{ - gint sw, sh; - gboolean center_horizontally; - gboolean center_vertically; - - gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh); - - /* We only want to center on the axes on which the image is smaller - * than the display canvas. If it is larger, it will be centered on - * that axis later, and if we center on all axis unconditionally, we - * end up with the wrong centering if the image is larger than the - * display canvas. - */ - center_horizontally = sw < shell->disp_width; - center_vertically = sh < shell->disp_height; - - gimp_display_shell_scroll_center_image (shell, - center_horizontally, - center_vertically); - - g_signal_handlers_disconnect_by_func (canvas, - gimp_display_shell_center_image_callback, - shell); -} - static gboolean gimp_display_shell_fill_idle (GimpDisplayShell *shell) { @@ -1390,14 +1361,7 @@ gimp_display_shell_fill (GimpDisplayShell *shell, gimp_help_set_help_data (shell->canvas, NULL, NULL); - /* Not pretty, but we need to center the image as soon as the canvas - * has got its new size allocated. The centering will be wrong if we - * do it too early, and if we do it too late flickering will occur - * due to the image being rendered twice. - */ - g_signal_connect_swapped (shell->canvas, "size-allocate", - G_CALLBACK (gimp_display_shell_center_image_callback), - shell); + gimp_display_shell_scroll_center_image_on_next_size_allocate (shell); shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) gimp_display_shell_fill_idle,