actor: Round the adjusted allocation origin correctly

We use floorf() for the allocation origin, and ceilf() for the
allocation size. Swapping the two introduces rounding errors if
the original allocation is not clamped to the nearest pixel.
This commit is contained in:
Emmanuele Bassi 2012-07-12 22:30:53 +01:00
parent ee06fbeb61
commit 2bec43c3c2

View File

@ -8777,7 +8777,7 @@ adjust_for_alignment (ClutterActorAlign alignment,
case CLUTTER_ACTOR_ALIGN_CENTER:
if (allocated_size > natural_size)
{
*allocated_start += ceilf ((allocated_size - natural_size) / 2);
*allocated_start += floorf ((allocated_size - natural_size) / 2);
*allocated_end = *allocated_start + MIN (allocated_size, natural_size);
}
break;