[nautilus] all: don't use eel_round()



commit f9a02d23fb7fc3d325313666977eb4eeadeaa5f5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 11 10:58:43 2012 -0400

    all: don't use eel_round()
    
    Just use floor().

 eel/eel-graphic-effects.c                     |    7 ++++---
 libnautilus-private/nautilus-icon-container.c |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/eel/eel-graphic-effects.c b/eel/eel-graphic-effects.c
index ad25dd7..b193a0f 100644
--- a/eel/eel-graphic-effects.c
+++ b/eel/eel-graphic-effects.c
@@ -30,6 +30,7 @@
 #include "eel-graphic-effects.h"
 #include "eel-glib-extensions.h"
 
+#include <math.h>
 #include <string.h>
 
 /* shared utility to create a new pixbuf from the passed-in one */
@@ -183,9 +184,9 @@ eel_create_colorized_pixbuf (GdkPixbuf *src,
 				  && gdk_pixbuf_get_n_channels (src) == 4), NULL);
 	g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (src) == 8, NULL);
 
-	red_value = eel_round (color->red * 255);
-	green_value = eel_round (color->green * 255);
-	blue_value = eel_round (color->blue * 255);	
+	red_value = (gint) floor (color->red * 255);
+	green_value = (gint) floor (color->green * 255);
+	blue_value = (gint) floor (color->blue * 255);	
 
 	dest = create_new_pixbuf (src);
 	
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 7179f5f..7c67845 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -120,8 +120,8 @@
 #define SNAP_HORIZONTAL(func,x) ((func ((double)((x) - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X) * SNAP_SIZE_X) + DESKTOP_PAD_HORIZONTAL)
 #define SNAP_VERTICAL(func, y) ((func ((double)((y) - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y) * SNAP_SIZE_Y) + DESKTOP_PAD_VERTICAL)
 
-#define SNAP_NEAREST_HORIZONTAL(x) SNAP_HORIZONTAL (eel_round, x)
-#define SNAP_NEAREST_VERTICAL(y) SNAP_VERTICAL (eel_round, y)
+#define SNAP_NEAREST_HORIZONTAL(x) SNAP_HORIZONTAL (floor, x + .5)
+#define SNAP_NEAREST_VERTICAL(y) SNAP_VERTICAL (floor, y + .5)
 
 #define SNAP_CEIL_HORIZONTAL(x) SNAP_HORIZONTAL (ceil, x)
 #define SNAP_CEIL_VERTICAL(y) SNAP_VERTICAL (ceil, y)



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