From dd8050c9626166ffbacbf08eab5d9982e917114c Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 3 Apr 2013 22:59:23 +0200 Subject: [PATCH] markup: fix float texture size when using pil markup rendering. closes #1082 credits to ihaque --- kivy/core/text/markup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kivy/core/text/markup.py b/kivy/core/text/markup.py index 400e69891..3180b6127 100644 --- a/kivy/core/text/markup.py +++ b/kivy/core/text/markup.py @@ -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