mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
script: Clean up Color parsing rules
All the ClutterColor parsing rules should be coalesced inside clutter_script_parse_color(): object, array and string notations are the canonical ways of defining a ClutterColor inside a ClutterScript definition. Having a single function in charge of the parsing cleans up the code.
This commit is contained in:
@ -10,6 +10,7 @@ test_script_single (TestConformSimpleFixture *fixture,
|
||||
gconstpointer dummy)
|
||||
{
|
||||
ClutterScript *script = clutter_script_new ();
|
||||
ClutterColor color = { 0, };
|
||||
GObject *actor = NULL;
|
||||
GError *error = NULL;
|
||||
ClutterActor *rect;
|
||||
@ -26,6 +27,11 @@ test_script_single (TestConformSimpleFixture *fixture,
|
||||
g_assert_cmpfloat (clutter_actor_get_width (rect), ==, 50.0);
|
||||
g_assert_cmpfloat (clutter_actor_get_y (rect), ==, 100.0);
|
||||
|
||||
clutter_rectangle_get_color (CLUTTER_RECTANGLE (rect), &color);
|
||||
g_assert_cmpint (color.red, ==, 255);
|
||||
g_assert_cmpint (color.green, ==, 0xcc);
|
||||
g_assert_cmpint (color.alpha, ==, 0xff);
|
||||
|
||||
g_object_unref (script);
|
||||
|
||||
clutter_actor_destroy (rect);
|
||||
|
Reference in New Issue
Block a user