diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-07-12 01:06:28 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-07-14 13:54:09 +0100 |
commit | df751a8a255dbca77779fd361d990cfd6d4f5095 (patch) | |
tree | 3b4485a67ba07ef1b730d48331e7c3751a18811b | |
parent | 32487af55b72e5a1be34176bc462ff11d8d378fc (diff) | |
download | clutter-df751a8a255dbca77779fd361d990cfd6d4f5095.tar.gz |
actor: improve rounding in get_allocation_geometry
Instead of relying on C to round the floating point allocation to
integers by flooring the values we now use CLUTTER_NEARBYINT to round
the allocation's position and size to the nearest integers instead. Using
floor leads to rather unstable rounding for the width and height when
there may be tiny fluctuations in the floating point width/height.
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
-rw-r--r-- | clutter/clutter-actor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index ce0b94d85..a2b44869f 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -6122,10 +6122,10 @@ clutter_actor_get_allocation_geometry (ClutterActor *self, clutter_actor_get_allocation_box (self, &box); - geom->x = clutter_actor_box_get_x (&box); - geom->y = clutter_actor_box_get_y (&box); - geom->width = clutter_actor_box_get_width (&box); - geom->height = clutter_actor_box_get_height (&box); + geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box)); + geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box)); + geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box)); + geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box)); } /** |