From 10014e93560d3f28d3a455e39675f3def9e543e6 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 21 Feb 2010 11:33:47 +0000 Subject: [libview] Use ev_document_misc_get_screen_dpi() --- (limited to 'libview') diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c index 1991168..b1cff28 100644 --- a/libview/ev-annotation-window.c +++ b/libview/ev-annotation-window.c @@ -26,6 +26,7 @@ #include "ev-annotation-window.h" #include "ev-stock-icons.h" #include "ev-view-marshal.h" +#include "ev-document-misc.h" enum { PROP_0, @@ -103,17 +104,12 @@ send_focus_change (GtkWidget *widget, } static gdouble -get_screen_dpi (GtkWindow *window) +get_screen_dpi (EvAnnotationWindow *window) { GdkScreen *screen; - gdouble xdpi, ydpi; - screen = gtk_window_get_screen (window); - - xdpi = 25.4 * gdk_screen_get_width (screen) / gdk_screen_get_width_mm (screen); - ydpi = 25.4 * gdk_screen_get_height (screen) / gdk_screen_get_height_mm (screen); - - return (xdpi + ydpi) / 2.0; + screen = gtk_window_get_screen (GTK_WINDOW (window)); + return ev_document_misc_get_screen_dpi (screen); } static GtkIconSize @@ -423,7 +419,7 @@ ev_annotation_window_constructor (GType type, rect = window->rect; /* Rectangle is at doc resolution (72.0) */ - scale = get_screen_dpi (GTK_WINDOW (window)) / 72.0; + scale = get_screen_dpi (window) / 72.0; gtk_window_resize (GTK_WINDOW (window), (gint)((rect->x2 - rect->x1) * scale), (gint)((rect->y2 - rect->y1) * scale)); -- cgit v0.9.1