From 97d0a4845ab971c032d55d4268c92bf311e51c47 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 9 Mar 2009 17:31:44 +0000 Subject: [PATCH] [texture] Fix ClutterFixed usage Do not use ClutterFixed and its macros inside the Texture. --- clutter/clutter-texture.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index 454d06eb8..bd380fd2a 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -352,15 +352,14 @@ clutter_texture_get_preferred_width (ClutterActor *self, else { /* Set the natural width so as to preserve the aspect ratio */ - ClutterFixed ratio, height; + gfloat ratio, height; - ratio = CLUTTER_FIXED_DIV ((float)(priv->width), - (float)(priv->height)); + ratio = (float)(priv->width) / (float)(priv->height); - height = CLUTTER_UNITS_TO_FIXED (for_height); + height = CLUTTER_UNITS_TO_FLOAT (for_height); *natural_width_p = - CLUTTER_UNITS_FROM_FIXED (CLUTTER_FIXED_MUL (ratio, height)); + CLUTTER_UNITS_FROM_FLOAT (ratio * height); } } } @@ -397,15 +396,14 @@ clutter_texture_get_preferred_height (ClutterActor *self, else { /* Set the natural height so as to preserve the aspect ratio */ - ClutterFixed ratio, width; + gfloat ratio, width; - ratio = CLUTTER_FIXED_DIV ((float)(priv->height), - (float)(priv->width)); + ratio = (float)(priv->height) / (float)(priv->width); - width = CLUTTER_UNITS_TO_FIXED (for_width); + width = CLUTTER_UNITS_TO_FLOAT (for_width); *natural_height_p = - CLUTTER_UNITS_FROM_FIXED (CLUTTER_FIXED_MUL (ratio, width)); + CLUTTER_UNITS_FROM_FLOAT (ratio * width); } } }