From 2bec43c3c232eebd3ce12b9222fedf3a2a6f88a3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 12 Jul 2012 22:30:53 +0100 Subject: [PATCH] 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. --- clutter/clutter-actor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 340d5a0ce..314419be0 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -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;