summaryrefslogtreecommitdiff
path: root/libdocument/ev-document-misc.c
diff options
context:
space:
mode:
authorMatthew Petroff <[email protected]>2016-10-19 12:36:30 -0400
committerraveit65 <[email protected]>2017-08-15 15:31:07 +0200
commitc75f49d323a17d244e3363c2fc9152bc275c5fb2 (patch)
treeb4639d39a203c15e702b06973b0626222d9fc561 /libdocument/ev-document-misc.c
parent31251cb1202aec7cb3bb1addfbbfe55c125f10d7 (diff)
downloadatril-c75f49d323a17d244e3363c2fc9152bc275c5fb2.tar.bz2
atril-c75f49d323a17d244e3363c2fc9152bc275c5fb2.tar.xz
Take monitor scale factor into account when calculating zoom.
https://github.com/linuxmint/xreader/commit/c47a1f4
Diffstat (limited to 'libdocument/ev-document-misc.c')
-rw-r--r--libdocument/ev-document-misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index 1afa1d77..c8d15ae1 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -379,7 +379,7 @@ ev_document_misc_invert_pixbuf (GdkPixbuf *pixbuf)
}
gdouble
-ev_document_misc_get_screen_dpi (GdkScreen *screen)
+ev_document_misc_get_screen_dpi (GdkScreen *screen, gint monitor)
{
gdouble dp, di;
@@ -389,6 +389,10 @@ ev_document_misc_get_screen_dpi (GdkScreen *screen)
/*diagonal in inches*/
di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4;
+#ifdef HAVE_HIDPI_SUPPORT
+ di /= gdk_screen_get_monitor_scale_factor(screen, monitor);
+#endif
+
return (dp / di);
}