Commit e4ba543c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

swallow the code of gimp_display_shell_image_size_starts_to_fit() because

2009-03-28  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplayshell-handlers.c
	(gimp_display_shell_size_changed_detailed_handler): swallow the
	code of gimp_display_shell_image_size_starts_to_fit() because it
	didn't make things clearer. Add local variables instead to make
	things more readable.


svn path=/trunk/; revision=28229
parent ebf0a98b
2009-03-28 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-handlers.c
(gimp_display_shell_size_changed_detailed_handler): swallow the
code of gimp_display_shell_image_size_starts_to_fit() because it
didn't make things clearer. Add local variables instead to make
things more readable.
2009-03-28 Sven Neumann <sven@gimp.org>
Bug 577024 – help-browser plugin crashes when used with webkit 1.1.3
......
......@@ -486,21 +486,6 @@ gimp_display_shell_update_sample_point_handler (GimpImage *image,
gimp_display_shell_expose_sample_point (shell, sample_point);
}
static void
gimp_display_shell_image_size_starts_to_fit (GimpDisplayShell *shell,
gint previous_width,
gint previous_height,
gint new_width,
gint new_height,
gboolean *horizontally,
gboolean *vertically)
{
*horizontally = SCALEX (shell, previous_width) > shell->disp_width &&
SCALEX (shell, new_width) <= shell->disp_width;
*vertically = SCALEY (shell, previous_height) > shell->disp_height &&
SCALEY (shell, new_height) <= shell->disp_height;
}
static void
gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
gint previous_origin_x,
......@@ -518,20 +503,18 @@ gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
}
else
{
GimpImage *image;
gboolean horizontally, vertically;
GimpImage *image = GIMP_IMAGE (shell->display->image);
gint new_width = gimp_image_get_width (image);
gint new_height = gimp_image_get_height (image);
gint scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
gint scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
gboolean horizontally;
gboolean vertically;
image = GIMP_IMAGE (shell->display->image);
gimp_display_shell_image_size_starts_to_fit (shell,
previous_width,
previous_height,
gimp_image_get_width (image),
gimp_image_get_height (image),
&horizontally,
&vertically);
horizontally = (SCALEX (shell, previous_width) > shell->disp_width &&
SCALEX (shell, new_width) <= shell->disp_width);
vertically = (SCALEY (shell, previous_height) > shell->disp_height &&
SCALEY (shell, new_height) <= shell->disp_height);
gimp_display_shell_scroll_set_offset (shell,
shell->offset_x + scaled_previous_origin_x,
......
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