From c80f0136ba117c857964df4bb84f68ebd12e882e Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 5 Jan 2016 18:52:03 +0100 Subject: [PATCH] app: make gimp_display_shell_calculate_scale_x_and_y() private --- app/display/gimpdisplayshell-scale.c | 67 ++++++++++++++-------------- app/display/gimpdisplayshell-scale.h | 4 -- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index ef0459d19e..85a4fcc4b9 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -58,6 +58,11 @@ static void gimp_display_shell_scale_get_image_size_for_scale gdouble scale, gint *w, gint *h); +static void gimp_display_shell_calculate_scale_x_and_y + (GimpDisplayShell *shell, + gdouble scale, + gdouble *scale_x, + gdouble *scale_y); static void gimp_display_shell_scale_to (GimpDisplayShell *shell, gdouble scale, @@ -693,40 +698,6 @@ gimp_display_shell_scale_resize (GimpDisplayShell *shell, gimp_display_shell_resume (shell); } -/** - * gimp_display_shell_calculate_scale_x_and_y: - * @shell: - * @scale: - * @scale_x: - * @scale_y: - * - **/ -void -gimp_display_shell_calculate_scale_x_and_y (GimpDisplayShell *shell, - gdouble scale, - gdouble *scale_x, - gdouble *scale_y) -{ - GimpImage *image; - gdouble xres; - gdouble yres; - gdouble screen_xres; - gdouble screen_yres; - - g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - - image = gimp_display_get_image (shell->display); - - g_return_if_fail (GIMP_IS_IMAGE (image)); - - gimp_image_get_resolution (image, &xres, &yres); - gimp_display_shell_scale_get_screen_resolution (shell, - &screen_xres, &screen_yres); - - if (scale_x) *scale_x = scale * screen_xres / xres; - if (scale_y) *scale_y = scale * screen_yres / yres; -} - void gimp_display_shell_set_initial_scale (GimpDisplayShell *shell, gdouble scale, @@ -878,6 +849,34 @@ gimp_display_shell_scale_get_image_size_for_scale (GimpDisplayShell *shell, if (h) *h = scale_y * gimp_image_get_height (image); } +/** + * gimp_display_shell_calculate_scale_x_and_y: + * @shell: + * @scale: + * @scale_x: + * @scale_y: + * + **/ +static void +gimp_display_shell_calculate_scale_x_and_y (GimpDisplayShell *shell, + gdouble scale, + gdouble *scale_x, + gdouble *scale_y) +{ + GimpImage *image = gimp_display_get_image (shell->display); + gdouble xres; + gdouble yres; + gdouble screen_xres; + gdouble screen_yres; + + gimp_image_get_resolution (image, &xres, &yres); + gimp_display_shell_scale_get_screen_resolution (shell, + &screen_xres, &screen_yres); + + if (scale_x) *scale_x = scale * screen_xres / xres; + if (scale_y) *scale_y = scale * screen_yres / yres; +} + /** * gimp_display_shell_scale_to: * @shell: diff --git a/app/display/gimpdisplayshell-scale.h b/app/display/gimpdisplayshell-scale.h index 1940f5346c..ab5fac7623 100644 --- a/app/display/gimpdisplayshell-scale.h +++ b/app/display/gimpdisplayshell-scale.h @@ -59,10 +59,6 @@ void gimp_display_shell_scale_shrink_wrap (GimpDisplayShell *sh void gimp_display_shell_scale_resize (GimpDisplayShell *shell, gboolean resize_window, gboolean grow_only); -void gimp_display_shell_calculate_scale_x_and_y (GimpDisplayShell *shell, - gdouble scale, - gdouble *scale_x, - gdouble *scale_y); void gimp_display_shell_set_initial_scale (GimpDisplayShell *shell, gdouble scale, gint *display_width,