Clear refs and anchors when clearing text. Fixes #2250.

This commit is contained in:
Matthew Einhorn 2014-06-11 04:29:33 -04:00
parent 11f27e1143
commit b8167baf07
1 changed files with 5 additions and 1 deletions

View File

@ -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,