[clutter] backend: Return the correct default resolution
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] backend: Return the correct default resolution
- Date: Mon, 5 Dec 2011 11:45:48 +0000 (UTC)
commit 943a65b476431400bd0436e1be243a2917385866
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Dec 5 11:42:49 2011 +0000
backend: Return the correct default resolution
If ClutterSettings:font-dpi is set to -1 then the default resolution
should be returned by ClutterBackend â i.e. 96.0.
clutter/clutter-backend.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index 1851d1d..b052d17 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -200,14 +200,20 @@ clutter_backend_real_resolution_changed (ClutterBackend *backend)
ClutterBackendPrivate *priv = backend->priv;
ClutterMainContext *context;
ClutterSettings *settings;
+ gdouble resolution;
gint dpi;
settings = clutter_settings_get_default ();
g_object_get (settings, "font-dpi", &dpi, NULL);
+ if (dpi < 0)
+ resolution = 96.0;
+ else
+ resolution = dpi / 1024.0;
+
context = _clutter_context_get_default ();
if (context->font_map != NULL)
- cogl_pango_font_map_set_resolution (context->font_map, dpi / 1024.0);
+ cogl_pango_font_map_set_resolution (context->font_map, resolution);
priv->units_per_em = get_units_per_em (backend, NULL);
priv->units_serial += 1;
@@ -1084,6 +1090,9 @@ clutter_backend_get_resolution (ClutterBackend *backend)
settings = clutter_settings_get_default ();
g_object_get (settings, "font-dpi", &resolution, NULL);
+ if (resolution < 0)
+ return 96.0;
+
return resolution / 1024.0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]