From 9860af0b35fb1a2d4bc0b63d5ac0d20cdba3321c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 8 Jan 2014 16:39:46 +0900 Subject: [PATCH] Textblock: Fix padding with styles (part 2) Summary: If ONE single item in the whole textblock has a padding of k, then ALL the lines of the textblock will be padded by k pixels. Here's a solution to add the padding only to the first line. Test Plan: Write any multiline text, without styles, in an entry. Add some glow to one element. All lines should be spaced by an extra 2 pixels. Reviewers: tasn CC: cedric Differential Revision: https://phab.enlightenment.org/D442 --- src/lib/evas/canvas/evas_object_textblock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 8e47a10ce2..6a5695631a 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3433,7 +3433,7 @@ loop_advance: if ((it->x + it->adv) > c->ln->w) c->ln->w = it->x + it->adv; } - c->ln->y = (c->y - c->par->y) + c->o->style_pad.t; + c->ln->y = c->y - c->par->y; c->ln->h = c->ascent + c->descent; /* Handle max ascent and descent if at the edges */ @@ -3448,6 +3448,8 @@ loop_advance: ascdiff = c->maxascent - c->ascent; c->ln->y += ascdiff; c->y += ascdiff; + c->ln->y += c->o->style_pad.t; + c->y += c->o->style_pad.t; } }