app: clean up gimp_display_shell_scroll() a bit
and document the difference to gimp_display_shell_scroll_set_offset() and why we need both.
This commit is contained in:
@ -757,14 +757,17 @@ gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
||||
}
|
||||
else
|
||||
{
|
||||
GimpImage *image = gimp_display_get_image (shell->display);
|
||||
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);
|
||||
GimpImage *image = gimp_display_get_image (shell->display);
|
||||
gint new_width = gimp_image_get_width (image);
|
||||
gint new_height = gimp_image_get_height (image);
|
||||
gint scaled_previous_origin_x;
|
||||
gint scaled_previous_origin_y;
|
||||
gboolean horizontally;
|
||||
gboolean vertically;
|
||||
|
||||
scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
|
||||
scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
|
||||
|
||||
horizontally = (SCALEX (shell, previous_width) > shell->disp_width &&
|
||||
SCALEX (shell, new_width) <= shell->disp_width);
|
||||
vertically = (SCALEY (shell, previous_height) > shell->disp_height &&
|
||||
@ -777,9 +780,12 @@ gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
||||
gimp_display_shell_scroll_center_image (shell, horizontally, vertically);
|
||||
|
||||
/* The above calls might not lead to a call to
|
||||
* gimp_display_shell_scroll_clamp_and_update() in all cases we
|
||||
* need it to be called, so simply call it explicitly here at
|
||||
* the end
|
||||
* gimp_display_shell_scroll_clamp_and_update() and
|
||||
* gimp_display_shell_expose_full() in all cases because when
|
||||
* scaling the old and new scroll offset might be the same.
|
||||
*
|
||||
* We need them to be called in all cases, so simply call them
|
||||
* explicitly here at the end
|
||||
*/
|
||||
gimp_display_shell_scroll_clamp_and_update (shell);
|
||||
|
||||
|
Reference in New Issue
Block a user