From 75b9fa0aeaba4283e2d3224756547ead3f9d3b3d Mon Sep 17 00:00:00 2001 From: Ell Date: Thu, 3 May 2018 20:07:31 -0400 Subject: [PATCH] app: take window scale-factor into account when rendering image In gimp_display_shell_draw_image(), enable the code that adjusts the scale-factor used for rendering the image by the window scale factor, so that we make full use of the screen resolution even on HiDPI displays. This also fixes artifacts along render-chunk borders. --- app/display/gimpdisplayshell-draw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 4afeb2b12e..62955bf629 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -42,7 +42,7 @@ #include "gimpdisplayxfer.h" -/* #define GIMP_DISPLAY_RENDER_ENABLE_SCALING 1 */ +#define GIMP_DISPLAY_RENDER_ENABLE_SCALING 1 /* public functions */ @@ -160,7 +160,10 @@ gimp_display_shell_draw_image (GimpDisplayShell *shell, chunk_height = GIMP_DISPLAY_RENDER_BUF_HEIGHT; #ifdef GIMP_DISPLAY_RENDER_ENABLE_SCALING - /* if we had this future API, things would look pretty on hires (retina) */ + /* multiply the image scale-factor by the window scale-factor, and divide + * the cairo scale-factor by the same amount (further down), so that we make + * full use of the screen resolution, even on hidpi displays. + */ scale *= gdk_window_get_scale_factor ( gtk_widget_get_window (gtk_widget_get_toplevel (GTK_WIDGET (shell))));