From ea68b0d902dd9c688bb165f9dc1972976bd14a1f Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 25 Nov 2005 06:44:08 +0000 Subject: [PATCH] (layout_glyphs): Fix handling of left/righ_padding. --- src/draw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/draw.c b/src/draw.c index 01abd7d..0d1d48b 100644 --- a/src/draw.c +++ b/src/draw.c @@ -605,7 +605,10 @@ layout_glyphs (MFrame *frame, MGlyphString *gstring, int from, int to, if (base->left_padding && base->lbearing < 0) { base->xoff = - base->lbearing; - base->width += base->xoff; + if (base->rbearing < 0) + base->width = base->rbearing - base->lbearing; + else + base->width += base->xoff; base->rbearing += base->xoff; base->lbearing = 0; } @@ -613,9 +616,8 @@ layout_glyphs (MFrame *frame, MGlyphString *gstring, int from, int to, { base->width = base->rbearing; } - lbearing = (base->xoff + base->lbearing < 0 - ? base->xoff + base->lbearing : 0); - rbearing = base->xoff + base->rbearing; + lbearing = base->lbearing; + rbearing = base->rbearing; } else { -- 1.7.10.4