gimp r27892 - in trunk: . app/display
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27892 - in trunk: . app/display
- Date: Sun, 4 Jan 2009 14:22:31 +0000 (UTC)
Author: martinn
Date: Sun Jan 4 14:22:31 2009
New Revision: 27892
URL: http://svn.gnome.org/viewvc/gimp?rev=27892&view=rev
Log:
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:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell.c
Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c (original)
+++ trunk/app/display/gimpdisplayshell.c Sun Jan 4 14:22:31 2009
@@ -1876,8 +1876,25 @@
disp_width = shell->disp_width;
disp_height = shell->disp_height;
- border_width = widget->allocation.width - disp_width;
- border_height = 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_width) * 0.75;
max_auto_height = (rect.height - border_height) * 0.75;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]