diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2012-07-12 22:30:53 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2012-08-11 10:31:09 +0100 |
commit | 70b7955de0bde0b8ac129ab5f9d7ba8fbad0df3f (patch) | |
tree | 1fe01780df67d5d4a1c47478eeaadb5c8c542c2e | |
parent | 60330a80b9563ee32f514b9bf60bcdeff36e0658 (diff) | |
download | clutter-70b7955de0bde0b8ac129ab5f9d7ba8fbad0df3f.tar.gz |
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.
(cherry picked from commit 2bec43c3c232eebd3ce12b9222fedf3a2a6f88a3)
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
-rw-r--r-- | clutter/clutter-actor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index c3faff78a..2b7c86f28 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -7776,7 +7776,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; |