[StThemeNode] round padding values intead of truncating them.
This way, 49.9999 will end up as 50 instead of 49. https://bugzilla.gnome.org/show_bug.cgi?id=598651
This commit is contained in:
parent
81d579aca0
commit
5b769138b6
@ -992,18 +992,22 @@ do_padding_property_term (StThemeNode *node,
|
|||||||
gboolean bottom)
|
gboolean bottom)
|
||||||
{
|
{
|
||||||
gdouble value;
|
gdouble value;
|
||||||
|
int int_value;
|
||||||
|
|
||||||
if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
|
if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Round the value */
|
||||||
|
int_value = (int) (0.5 + value);
|
||||||
|
|
||||||
if (left)
|
if (left)
|
||||||
node->padding[ST_SIDE_LEFT] = value;
|
node->padding[ST_SIDE_LEFT] = int_value;
|
||||||
if (right)
|
if (right)
|
||||||
node->padding[ST_SIDE_RIGHT] = value;
|
node->padding[ST_SIDE_RIGHT] = int_value;
|
||||||
if (top)
|
if (top)
|
||||||
node->padding[ST_SIDE_TOP] = value;
|
node->padding[ST_SIDE_TOP] = int_value;
|
||||||
if (bottom)
|
if (bottom)
|
||||||
node->padding[ST_SIDE_BOTTOM] = value;
|
node->padding[ST_SIDE_BOTTOM] = int_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user