[clutter] actor: Round the adjusted allocation origin correctly



commit 2bec43c3c232eebd3ce12b9222fedf3a2a6f88a3
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jul 12 22:30:53 2012 +0100

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 340d5a0..314419b 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]