markup: fix float texture size when using pil markup rendering. closes #1082

credits to ihaque
This commit is contained in:
Mathieu Virbel 2013-04-03 22:59:23 +02:00
parent ba77aaf035
commit dd8050c962
1 changed files with 3 additions and 3 deletions

View File

@ -37,13 +37,13 @@ If you need to escape the markup from the current text, use
__all__ = ('MarkupLabel', )
from kivy.graphics.texture import Texture
import re
from kivy.properties import dpi2px
from kivy.parser import parse_color
from kivy.logger import Logger
import re
from kivy.core.text import Label, LabelBase
from copy import copy
from math import ceil
# We need to do this trick when documentation is generated
MarkupLabelBase = Label
@ -216,7 +216,7 @@ class MarkupLabel(MarkupLabelBase):
h = 1
else:
h = sum([line[1] for line in lines])
return w, h
return int(ceil(w)), int(ceil(h))
def _pre_render_label(self, word, options, lines):
# precalculate id/name