]> git.sur5r.net Git - glabels/commitdiff
Fix layout problems with center and right text alignment to text box.
authorJim Evins <evins@snaught.com>
Sat, 25 Jan 2014 23:14:31 +0000 (18:14 -0500)
committerJim Evins <evins@snaught.com>
Sat, 25 Jan 2014 23:34:06 +0000 (18:34 -0500)
Pango layout width should be 6 pts smaller than text object width to account
for a 3 pt margin around layout.

src/label-text.c

index f2216edc6f1f22ef8d67793e7592715fbc215cde..13e9f943939614c9aebaffc1b092153982aeb214 100644 (file)
@@ -1185,7 +1185,7 @@ layout_text (glLabelText      *this,
         }
         else
         {
-                pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x);
+                pango_layout_set_width (layout, (object_w - 2*GL_LABEL_TEXT_MARGIN) * PANGO_SCALE / scale_x);
         }
         pango_layout_set_wrap (layout, PANGO_WRAP_WORD);
         pango_layout_set_alignment (layout, this->priv->align);