gimp r27893 - in branches/gimp-2-6: . app/display



Author: martinn
Date: Sun Jan  4 14:25:59 2009
New Revision: 27893
URL: http://svn.gnome.org/viewvc/gimp?rev=27893&view=rev

Log:
Merged from trunk:

Bug 562818 â First image opened in GIMP offset

* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
Only rely on disp_width/height for border calculation if they are
larger than 1. If not, special-case the calculation so we don't
get a severly mispositioned image.


Modified:
   branches/gimp-2-6/ChangeLog
   branches/gimp-2-6/app/display/gimpdisplayshell.c

Modified: branches/gimp-2-6/app/display/gimpdisplayshell.c
==============================================================================
--- branches/gimp-2-6/app/display/gimpdisplayshell.c	(original)
+++ branches/gimp-2-6/app/display/gimpdisplayshell.c	Sun Jan  4 14:25:59 2009
@@ -1860,8 +1860,25 @@
   disp_width  = shell->disp_width;
   disp_height = shell->disp_height;
 
-  border_x = widget->allocation.width  - disp_width;
-  border_y = widget->allocation.height - disp_height;
+
+  /* As long as the disp_width/disp_heightheight is larger than 1 we
+   * can reliably depend on it to calculate the
+   * border_width/border_height because that means there is enough
+   * room in the top-level for the canvas as well as the rulers and
+   * scrollbars. If it is 1 or smaller it is likely that the rulers
+   * and scrollbars are overlapping each other and thus we cannot use
+   * the normal approach to border size, so special case that.
+   */
+  if (disp_width > 1 || !shell->vsb)
+    border_width = widget->allocation.width - disp_width;
+  else
+    border_width = widget->allocation.width - disp_width + shell->vsb->allocation.width;
+
+  if (disp_height > 1 || !shell->hsb)
+    border_height = widget->allocation.height - disp_height;
+  else
+    border_height = widget->allocation.height - disp_height + shell->hsb->allocation.height;
+
 
   max_auto_width  = (rect.width  - border_x) * 0.75;
   max_auto_height = (rect.height - border_y) * 0.75;



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