[gtk+] label: Account for y-translation when rotating



commit 03fbb1f34f953336842e94722a3e59eda59f99b0
Author: Benjamin Otte <otte redhat com>
Date:   Sun May 22 03:53:02 2011 +0200

    label: Account for y-translation when rotating

 gtk/gtklabel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 0b35c96..169117f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3966,9 +3966,9 @@ get_layout_location (GtkLabel  *label,
    *   middle".  You want to read the first line, at least, to get some context.
    */
   if (pango_layout_get_line_count (priv->layout) == 1)
-    y = floor (allocation.y + ypad + (allocation.height - req_height) * yalign);
+    y = floor (allocation.y + ypad + (allocation.height - req_height) * yalign) - logical.y;
   else
-    y = floor (allocation.y + ypad + MAX ((allocation.height - req_height) * yalign, 0));
+    y = floor (allocation.y + ypad + MAX ((allocation.height - req_height) * yalign, 0)) - logical.y;
 
   if (xp)
     *xp = x;



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