Reimplement to increase readability.
2008-08-16 Martin Nordholts <martinn@svn.gnome.org> * app/display/gimpdisplayshell-scale.c (gimp_display_shell_scale_to): Reimplement to increase readability. svn path=/trunk/; revision=26587
This commit is contained in:

committed by
Martin Nordholts

parent
46f7ce1a01
commit
8d7b13ae01
@ -1,3 +1,9 @@
|
|||||||
|
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell-scale.c
|
||||||
|
(gimp_display_shell_scale_to): Reimplement to increase
|
||||||
|
readability.
|
||||||
|
|
||||||
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
|
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
|
||||||
|
|
||||||
* app/display/gimpdisplayshell-scale.c
|
* app/display/gimpdisplayshell-scale.c
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "gimpdisplayshell-scale.h"
|
#include "gimpdisplayshell-scale.h"
|
||||||
#include "gimpdisplayshell-scroll.h"
|
#include "gimpdisplayshell-scroll.h"
|
||||||
#include "gimpdisplayshell-title.h"
|
#include "gimpdisplayshell-title.h"
|
||||||
|
#include "gimpdisplayshell-transform.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
@ -403,29 +404,32 @@ gimp_display_shell_scale_to (GimpDisplayShell *shell,
|
|||||||
gint viewport_x,
|
gint viewport_x,
|
||||||
gint viewport_y)
|
gint viewport_y)
|
||||||
{
|
{
|
||||||
gdouble current;
|
gdouble image_focus_x, image_focus_y;
|
||||||
gdouble offset_x;
|
gint target_offset_x, target_offset_y;
|
||||||
gdouble offset_y;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||||
|
|
||||||
if (! shell->display)
|
if (! shell->display)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
current = gimp_zoom_model_get_factor (shell->zoom);
|
gimp_display_shell_untransform_xy_f (shell,
|
||||||
|
viewport_x,
|
||||||
|
viewport_y,
|
||||||
|
&image_focus_x,
|
||||||
|
&image_focus_y,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
offset_x = shell->offset_x + viewport_x;
|
target_offset_x = scale * image_focus_x - viewport_x;
|
||||||
offset_y = shell->offset_y + viewport_y;
|
target_offset_y = scale * image_focus_y - viewport_y;
|
||||||
|
|
||||||
offset_x /= current;
|
/* Note that we never come here if we need to
|
||||||
offset_y /= current;
|
* resize_windows_on_zoom
|
||||||
|
*/
|
||||||
offset_x *= scale;
|
gimp_display_shell_scale_by_values (shell,
|
||||||
offset_y *= scale;
|
scale,
|
||||||
|
target_offset_x,
|
||||||
gimp_display_shell_scale_by_values (shell, scale,
|
target_offset_y,
|
||||||
offset_x - viewport_x, offset_y - viewport_y,
|
FALSE);
|
||||||
shell->display->config->resize_windows_on_zoom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user