[glabels] Fix layout problems with center and right text alignment to text box.



commit a65a7dfee1053660679989a9a28ae10d4e589648
Author: Jim Evins <evins snaught com>
Date:   Sat Jan 25 18:14:31 2014 -0500

    Fix layout problems with center and right text alignment to text box.
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/label-text.c b/src/label-text.c
index f2216ed..13e9f94 100644
--- a/src/label-text.c
+++ b/src/label-text.c
@@ -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);


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