mirror of https://github.com/kivy/kivy.git
label: prevent creation of initial label until text is set. Closes #160
This commit is contained in:
parent
1e3f928dd8
commit
f0b8309c0a
|
@ -74,10 +74,13 @@ class Label(Widget):
|
|||
After this function call, the :data:`texture` and :data`texture_size`
|
||||
will be updated in this order.
|
||||
'''
|
||||
self._label.refresh()
|
||||
self.texture = None
|
||||
self.texture = self._label.texture
|
||||
self.texture_size = list(self.texture.size)
|
||||
if self._label.text.strip() == '':
|
||||
self.texture_size = (0, 0)
|
||||
else:
|
||||
self._label.refresh()
|
||||
self.texture = self._label.texture
|
||||
self.texture_size = list(self.texture.size)
|
||||
|
||||
#
|
||||
# Properties
|
||||
|
|
Loading…
Reference in New Issue