Commit 632ab5ed authored by Martin Nordholts's avatar Martin Nordholts

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.

svn path=/trunk/; revision=27892
parent 59c9c6d8
2009-01-04 Martin Nordholts <martinn@svn.gnome.org>
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.
2009-01-04 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_shrink_wrap):
......
......@@ -1876,8 +1876,25 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell,
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment