Revert "units: Handle negative values in clutter_units_from_string()"
Stray commit got pushed too soon.
This reverts commit 44f283bb72
.
This commit is contained in:
parent
44f283bb72
commit
0065fb459c
@ -480,21 +480,11 @@ clutter_units_from_string (ClutterUnits *units,
|
|||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
ClutterUnitType unit_type;
|
ClutterUnitType unit_type;
|
||||||
gfloat value;
|
gfloat value;
|
||||||
gboolean negative = FALSE;
|
|
||||||
|
|
||||||
g_return_val_if_fail (units != NULL, FALSE);
|
g_return_val_if_fail (units != NULL, FALSE);
|
||||||
g_return_val_if_fail (str != NULL, FALSE);
|
g_return_val_if_fail (str != NULL, FALSE);
|
||||||
|
|
||||||
/* strip leading space */
|
/* strip leading space */
|
||||||
while (g_ascii_isspace (*str) || *str == '+')
|
|
||||||
str++;
|
|
||||||
|
|
||||||
if (*str == '-')
|
|
||||||
{
|
|
||||||
negative = TRUE;
|
|
||||||
str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (g_ascii_isspace (*str))
|
while (g_ascii_isspace (*str))
|
||||||
str++;
|
str++;
|
||||||
|
|
||||||
@ -560,9 +550,6 @@ clutter_units_from_string (ClutterUnits *units,
|
|||||||
if (*str != '\0')
|
if (*str != '\0')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (negative)
|
|
||||||
value *= -1;
|
|
||||||
|
|
||||||
backend = clutter_get_default_backend ();
|
backend = clutter_get_default_backend ();
|
||||||
|
|
||||||
units->unit_type = unit_type;
|
units->unit_type = unit_type;
|
||||||
|
@ -108,10 +108,6 @@ units_string (TestConformSimpleFixture *fixture,
|
|||||||
g_assert (clutter_units_get_unit_type (&units) == CLUTTER_UNIT_POINT);
|
g_assert (clutter_units_get_unit_type (&units) == CLUTTER_UNIT_POINT);
|
||||||
g_assert_cmpfloat (clutter_units_get_unit_value (&units), ==, 0.5f);
|
g_assert_cmpfloat (clutter_units_get_unit_value (&units), ==, 0.5f);
|
||||||
|
|
||||||
g_assert (clutter_units_from_string (&units, "-3 px") == TRUE);
|
|
||||||
g_assert (clutter_units_get_unit_type (&units) == CLUTTER_UNIT_PIXEL);
|
|
||||||
g_assert_cmpfloat (clutter_units_get_unit_value (&units), ==, -3.0);
|
|
||||||
|
|
||||||
g_assert (clutter_units_from_string (&units, "1 omg!!pony") == FALSE);
|
g_assert (clutter_units_from_string (&units, "1 omg!!pony") == FALSE);
|
||||||
|
|
||||||
clutter_units_from_pt (&units, 24.0);
|
clutter_units_from_pt (&units, 24.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user