app: change some integers in gimpdisplayshell-scale.c to gdouble

which does not have any effect by itself, but is needed for fixing
viewport calculation for rotated canvases.
This commit is contained in:
Michael Natterer 2015-10-18 14:40:19 +02:00
parent 7e62875d48
commit b7f471b1a3
1 changed files with 17 additions and 15 deletions

View File

@ -51,8 +51,8 @@
static void gimp_display_shell_scale_to (GimpDisplayShell *shell, static void gimp_display_shell_scale_to (GimpDisplayShell *shell,
gdouble scale, gdouble scale,
gint viewport_x, gdouble viewport_x,
gint viewport_y); gdouble viewport_y);
static gboolean gimp_display_shell_scale_image_starts_to_fit static gboolean gimp_display_shell_scale_image_starts_to_fit
(GimpDisplayShell *shell, (GimpDisplayShell *shell,
@ -76,8 +76,8 @@ static void gimp_display_shell_scale_get_image_center_viewport
static void gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell, static void gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
gdouble new_scale, gdouble new_scale,
gdouble current_scale, gdouble current_scale,
gint *x, gdouble *x,
gint *y, gdouble *y,
GimpZoomFocus zoom_focus); GimpZoomFocus zoom_focus);
@ -412,7 +412,6 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
gdouble new_scale, gdouble new_scale,
GimpZoomFocus zoom_focus) GimpZoomFocus zoom_focus)
{ {
gint x, y;
gdouble current_scale; gdouble current_scale;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@ -448,6 +447,7 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
gboolean zoom_focus_almost_centered_vert; gboolean zoom_focus_almost_centered_vert;
gboolean image_center_almost_centered_horiz; gboolean image_center_almost_centered_horiz;
gboolean image_center_almost_centered_vert; gboolean image_center_almost_centered_vert;
gdouble x, y;
gint image_center_x; gint image_center_x;
gint image_center_y; gint image_center_y;
@ -889,12 +889,12 @@ gimp_display_shell_push_zoom_focus_pointer_pos (GimpDisplayShell *shell,
static void static void
gimp_display_shell_scale_to (GimpDisplayShell *shell, gimp_display_shell_scale_to (GimpDisplayShell *shell,
gdouble scale, gdouble scale,
gint viewport_x, gdouble viewport_x,
gint viewport_y) gdouble viewport_y)
{ {
gdouble scale_x, scale_y; gdouble scale_x, scale_y;
gdouble image_focus_x, image_focus_y; gdouble image_focus_x, image_focus_y;
gint target_offset_x, target_offset_y; gdouble target_offset_x, target_offset_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
@ -1041,8 +1041,8 @@ static void
gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell, gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
gdouble new_scale, gdouble new_scale,
gdouble current_scale, gdouble current_scale,
gint *x, gdouble *x,
gint *y, gdouble *y,
GimpZoomFocus zoom_focus) GimpZoomFocus zoom_focus)
{ {
GimpZoomFocus real_zoom_focus = zoom_focus; GimpZoomFocus real_zoom_focus = zoom_focus;
@ -1060,7 +1060,7 @@ gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
GtkWidget *window; GtkWidget *window;
gboolean event_looks_sane; gboolean event_looks_sane;
gboolean cursor_within_canvas; gboolean cursor_within_canvas;
gint canvas_pointer_x, canvas_pointer_y; gdouble canvas_pointer_x, canvas_pointer_y;
window = GTK_WIDGET (gimp_display_shell_get_window (shell)); window = GTK_WIDGET (gimp_display_shell_get_window (shell));
@ -1086,9 +1086,12 @@ gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
if (g_queue_peek_head (shell->zoom_focus_pointer_queue) == NULL) if (g_queue_peek_head (shell->zoom_focus_pointer_queue) == NULL)
{ {
gtk_widget_get_pointer (shell->canvas, gint px, py;
&canvas_pointer_x,
&canvas_pointer_y); gtk_widget_get_pointer (shell->canvas, &px, &py);
canvas_pointer_x = px;
canvas_pointer_y = py;
} }
else else
{ {
@ -1105,7 +1108,6 @@ gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
canvas_pointer_x < shell->disp_width && canvas_pointer_x < shell->disp_width &&
canvas_pointer_y < shell->disp_height; canvas_pointer_y < shell->disp_height;
if (event_looks_sane && cursor_within_canvas) if (event_looks_sane && cursor_within_canvas)
{ {
other_x = canvas_pointer_x; other_x = canvas_pointer_x;