[gtk+] entry: don't blindly center the text area in the allocated height



commit 3ca795d447868aaa03af5c4cf669b6f5271c309c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Jan 30 14:05:16 2012 -0500

    entry: don't blindly center the text area in the allocated height
    
    Since top/bottom borders might be different.

 gtk/gtkentry.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 4f0d909..f094fd2 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3228,7 +3228,7 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
     *x = borders.left;
 
   if (y)
-    *y = frame_height / 2 - (req_height - borders.top - borders.bottom) / 2;
+    *y = floor ((frame_height - req_height) / 2) + borders.top;
 
   if (width)
     *width = allocation.width - borders.left - borders.right;



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