summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2019-06-15 13:02:16 +0200
committerraveit65 <[email protected]>2020-01-03 15:13:58 +0100
commitc8773d8a8ad908db7cc14e600c359f116e0d241a (patch)
treecd2b41e2de9438d05034187d3648fc890ec291e3 /src
parent144678da64621dbb26e29345369afc82abc7c556 (diff)
downloadeom-c8773d8a8ad908db7cc14e600c359f116e0d241a.tar.bz2
eom-c8773d8a8ad908db7cc14e600c359f116e0d241a.tar.xz
EomPrintPreview: Fix preview thumbnail on HiDPI displays
Simply scale the preview thumbnail according to the display scale setting. That should provide a good looking preview at the correct size. origin commit: https://gitlab.gnome.org/GNOME/eog/commit/d17e1b20ebfd878
Diffstat (limited to 'src')
-rw-r--r--src/eom-print-preview.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c
index 214d285..47ff4a7 100644
--- a/src/eom-print-preview.c
+++ b/src/eom-print-preview.c
@@ -630,6 +630,7 @@ create_image_scaled (EomPrintPreview *preview)
gdouble scale;
scale = MIN ((gdouble) allocation.width/i_width,
(gdouble) allocation.height/i_height);
+ scale *= gtk_widget_get_scale_factor (GTK_WIDGET (priv->area));
priv->image_scaled = gdk_pixbuf_scale_simple (priv->image,
i_width*scale,
i_height*scale,
@@ -645,7 +646,7 @@ static GdkPixbuf *
create_preview_buffer (EomPrintPreview *preview)
{
GdkPixbuf *pixbuf;
- gint width, height;
+ gint width, height, widget_scale;
GdkInterpType type = GDK_INTERP_TILES;
if (preview->priv->image == NULL) {
@@ -656,9 +657,12 @@ create_preview_buffer (EomPrintPreview *preview)
width = gdk_pixbuf_get_width (preview->priv->image);
height = gdk_pixbuf_get_height (preview->priv->image);
+ widget_scale = gtk_widget_get_scale_factor (GTK_WIDGET (preview->priv->area));
- width *= preview->priv->i_scale * preview->priv->p_scale;
- height *= preview->priv->i_scale * preview->priv->p_scale;
+ width *= preview->priv->i_scale * preview->priv->p_scale
+ * widget_scale;
+ height *= preview->priv->i_scale * preview->priv->p_scale
+ * widget_scale;
if (width < 1 || height < 1)
return NULL;