[evolution/foocanvas] Fix for e-minicard-label.c : The clip width became in some cases negative. Fix this by using fabs.



commit 5b988f2188e50f73d2124bac9c955045812c9b7b
Author: H.Habighorst <h habighorst googlemail com>
Date:   Tue May 11 18:54:12 2010 +0200

    Fix for e-minicard-label.c : The clip width became in some cases negative. Fix this by using fabs.
    
    TODO: Further investigation?!

 addressbook/gui/widgets/e-minicard-label.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index f9748c9..1e02e02 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -24,14 +24,16 @@
 
 #include "e-minicard-label.h"
 
+#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <libfoocanvas/foo-canvas-rect-ellipse.h>
-#include <glib/gi18n.h>
+#include <math.h>
+
 #include <e-util/e-util.h>
-#include <text/e-text.h>
 #include <misc/e-canvas.h>
 #include <misc/e-canvas-utils.h>
-#include <gdk/gdkkeysyms.h>
+#include <text/e-text.h>
 
 static void e_minicard_label_init		(EMinicardLabel		 *card);
 static void e_minicard_label_class_init	(EMinicardLabelClass	 *klass);
@@ -305,7 +307,7 @@ e_minicard_label_realize (FooCanvasItem *item)
 	  foo_canvas_item_new( group,
 				 e_text_get_type(),
 				 "anchor", GTK_ANCHOR_NW,
-				 "clip_width", (gdouble) ( e_minicard_label->width / 2 - 4 ),
+				 "clip_width", (gdouble) fabs( e_minicard_label->width / 2 - 4 ),
 				 "clip", TRUE,
 				 "use_ellipsis", TRUE,
 				 "fill_color", "black",
@@ -318,7 +320,7 @@ e_minicard_label_realize (FooCanvasItem *item)
 	  foo_canvas_item_new( group,
 				 e_text_get_type(),
 				 "anchor", GTK_ANCHOR_NW,
-				 "clip_width", (gdouble) ( ( e_minicard_label->width + 1 ) / 2 - 4 ),
+				 "clip_width", (gdouble) fabs( ( e_minicard_label->width + 1 ) / 2 - 4 ),
 				 "clip", TRUE,
 				 "use_ellipsis", TRUE,
 				 "fill_color", "black",



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