summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2019-06-15 13:02:16 +0200
committermonsta <[email protected]>2020-01-09 15:54:39 +0300
commitb236700a039d0eabff31b95a494af99b06e614dd (patch)
tree348f1afa3f67e136bb579ecfa5580e3b46d7f3a3
parent9d00584b18c592cf49c3812b50d7fcbd621b5e65 (diff)
downloadeom-b236700a039d0eabff31b95a494af99b06e614dd.tar.bz2
eom-b236700a039d0eabff31b95a494af99b06e614dd.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
-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;