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.
This commit is contained in:
Ell 2018-05-03 20:07:31 -04:00 committed by Michael Natterer
parent 4e8fbbe951
commit 75b9fa0aea
1 changed files with 5 additions and 2 deletions

View File

@ -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))));