mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
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:
parent
ee06fbeb61
commit
2bec43c3c2
@ -8777,7 +8777,7 @@ adjust_for_alignment (ClutterActorAlign alignment,
|
|||||||
case CLUTTER_ACTOR_ALIGN_CENTER:
|
case CLUTTER_ACTOR_ALIGN_CENTER:
|
||||||
if (allocated_size > natural_size)
|
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);
|
*allocated_end = *allocated_start + MIN (allocated_size, natural_size);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user