From a134dcdcd6e4b6934c5e8f3cc66ac824d9914d5b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 19 Oct 2016 12:36:30 -0400 Subject: Take monitor scale factor into account when calculating zoom. https://github.com/linuxmint/xreader/commit/c47a1f4 --- libdocument/ev-document-misc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libdocument/ev-document-misc.c') diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index d4f16482..fc47a9ee 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -372,7 +372,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; @@ -382,6 +382,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); } -- cgit v1.2.1