conform: Do not use deprecated API in test-clutter-units
Setting the DPI is done through the ClutterSettings:font-dpi property.
This commit is contained in:
parent
7e6b60270d
commit
c2b8a0272b
@ -8,21 +8,23 @@ test_units_cache (TestConformSimpleFixture *fixture,
|
|||||||
gconstpointer data)
|
gconstpointer data)
|
||||||
{
|
{
|
||||||
ClutterUnits units;
|
ClutterUnits units;
|
||||||
|
ClutterSettings *settings;
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
gfloat pixels;
|
gfloat pixels;
|
||||||
gdouble dpi;
|
gint dpi;
|
||||||
|
|
||||||
backend = clutter_get_default_backend ();
|
backend = clutter_get_default_backend ();
|
||||||
|
settings = clutter_settings_get_default ();
|
||||||
|
|
||||||
dpi = clutter_backend_get_resolution (backend);
|
dpi = clutter_backend_get_resolution (backend);
|
||||||
|
|
||||||
clutter_units_from_em (&units, 1.0);
|
clutter_units_from_em (&units, 1.0);
|
||||||
pixels = clutter_units_to_pixels (&units);
|
pixels = clutter_units_to_pixels (&units);
|
||||||
|
|
||||||
clutter_backend_set_resolution (backend, dpi + 10);
|
g_object_set (settings, "font-dpi", ((dpi + 10) * 1024), NULL);
|
||||||
g_assert_cmpfloat (clutter_units_to_pixels (&units), !=, pixels);
|
g_assert_cmpfloat (clutter_units_to_pixels (&units), !=, pixels);
|
||||||
|
|
||||||
clutter_backend_set_resolution (backend, dpi);
|
g_object_set (settings, "font-dpi", (dpi * 1024), NULL);
|
||||||
g_assert_cmpfloat (clutter_units_to_pixels (&units), ==, pixels);
|
g_assert_cmpfloat (clutter_units_to_pixels (&units), ==, pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user