From b8167baf078b8914bbfa5239132d1d159dd55102 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Wed, 11 Jun 2014 04:29:33 -0400 Subject: [PATCH] Clear refs and anchors when clearing text. Fixes #2250. --- kivy/uix/label.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kivy/uix/label.py b/kivy/uix/label.py index 176c958cd..f311198a3 100644 --- a/kivy/uix/label.py +++ b/kivy/uix/label.py @@ -182,12 +182,16 @@ class Label(Widget): After this function call, the :attr:`texture` and :attr:`texture_size` will be updated in this order. ''' + mrkup = self._label.__class__ is CoreMarkupLabel self.texture = None + if (not self._label.text or (self.halign[-1] == 'y' or self.strip) and not self._label.text.strip()): self.texture_size = (0, 0) + if mrkup: + self.refs, self._label._refs = {}, {} + self.anchors, self._label._anchors = {}, {} else: - mrkup = self._label.__class__ is CoreMarkupLabel if mrkup: text = self._label.text # we must strip here, otherwise, if the last line is empty,