Merge pull request #427 from akshayaurora/markup_width

fix markup positioning incase of glyphs with kerning
This commit is contained in:
Mathieu Virbel 2012-03-19 03:07:28 -07:00
commit fafc8fedaa
2 changed files with 5 additions and 4 deletions

View File

@ -226,9 +226,10 @@ class MarkupLabel(MarkupLabelBase):
# calculate the size of the part
# (extract all extents of the part,
# sum the width, and get the maximum height)
# calculate width through extents due to kerning
# and get the maximum height)
pg = [cache[g] for g in part]
pw = sum([g[0] for g in pg])
pw = get_extents(part)[0]
ph = max([g[1] for g in pg])
options = copy(options)

View File

@ -93,7 +93,7 @@
padding_y: 6
canvas.before:
Color:
rgb: self.background_color
rgba: self.background_color
BorderImage:
border: (16, 16, 16, 16)
pos: self.pos
@ -105,7 +105,7 @@
pos: map(int, self.cursor_pos)
size: 1, -self.line_height
Color:
rgb: self.foreground_color
rgba: self.foreground_color
<TextInputCutCopyPaste>:
size_hint: None, None