[gtk+] notebook: Fix rounding error in vertical alignment of arrow



commit b609377e3ee60001761bb285bd6027f54bb27e0a
Author: William Jon McCann <william jon mccann gmail com>
Date:   Wed Aug 7 13:01:34 2013 +0200

    notebook: Fix rounding error in vertical alignment of arrow
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707920

 gtk/gtknotebook.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index aab78ee..b582a0a 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -27,6 +27,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 
 #include "gtknotebook.h"
 
@@ -2713,7 +2714,7 @@ gtk_notebook_get_arrow_rect (GtkNotebook     *notebook,
               else
                 rectangle->x = event_window_pos.x + event_window_pos.width - 2 * rectangle->width;
             }
-          rectangle->y = event_window_pos.y + (event_window_pos.height - rectangle->height) / 2;
+          rectangle->y = floor ((gdouble)event_window_pos.y + (event_window_pos.height - rectangle->height) 
/ 2.0 + 0.5);
           break;
         }
     }


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