]> Pileus Git - ~andy/gtk/commitdiff
label: Account for y-translation when rotating
authorBenjamin Otte <otte@redhat.com>
Sun, 22 May 2011 01:53:02 +0000 (03:53 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 22 May 2011 03:56:11 +0000 (05:56 +0200)
gtk/gtklabel.c

index 0b35c96466b8a73c991d8166c2bfd9ce936ab61c..169117f2321f1da4ff6ccaa869af3c20e54ee42a 100644 (file)
@@ -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;