[gimp/gtk3-port: 326/444] app: take window scale-factor into account when rendering image



commit 67ca7dde31dd4cf6a6c388d0cbfbd688f520eb23
Author: Ell <ell_se yahoo com>
Date:   Thu May 3 20:07:31 2018 -0400

    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 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index 4afeb2b..62955bf 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))));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]