gimp r26613 - in trunk: . app/display



Author: martinn
Date: Sun Aug 17 07:38:25 2008
New Revision: 26613
URL: http://svn.gnome.org/viewvc/gimp?rev=26613&view=rev

Log:
2008-08-17  Martin Nordholts  <martinn svn gnome org>

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_size_allocate): If the image ends up
	below or to the right of the viewport top and left edges, and the
	image is not centered on a given axis, align the top left image
	edge with the top left viewport edge. This is basically the best
	we can do without an API for start and end of a window resize
	cycle using the mouse.


Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell-callbacks.c

Modified: trunk/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.c	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.c	Sun Aug 17 07:38:25 2008
@@ -312,10 +312,12 @@
         {
           if (! shell->zoom_on_resize)
             {
-              gint sw;
-              gint sh;
               gboolean center_horizontally;
               gboolean center_vertically;
+              gint     target_offset_x;
+              gint     target_offset_y;
+              gint     sw;
+              gint     sh;
 
               gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
 
@@ -325,6 +327,27 @@
               gimp_display_shell_scroll_center_image (shell,
                                                       center_horizontally,
                                                       center_vertically);
+
+              /* This is basically the best we can do before we get an
+               * API for storing the image offset at the start of an
+               * image window resize using the mouse
+               */
+              target_offset_x = shell->offset_x;
+              target_offset_y = shell->offset_y;
+ 
+              if (! center_horizontally)
+                {
+                  target_offset_x = MAX (shell->offset_x, 0);
+                }
+ 
+              if (! center_vertically)
+                {
+                  target_offset_y = MAX (shell->offset_y, 0);
+                }
+ 
+              gimp_display_shell_scroll_set_offset (shell,
+                                                    target_offset_x,
+                                                    target_offset_y);
             }
 
           shell->size_allocate_from_configure_event = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]