mirror of https://github.com/kivy/kivy.git
widget: fix opacity not working when passed in a constructor. closes #734
This commit is contained in:
parent
fc9e819b24
commit
fb12e1579c
|
@ -141,7 +141,7 @@ class Widget(EventDispatcher):
|
|||
|
||||
# Create the default canvas if not exist
|
||||
if self.canvas is None:
|
||||
self.canvas = Canvas()
|
||||
self.canvas = Canvas(opacity=self.opacity)
|
||||
|
||||
# Apply all the styles
|
||||
if '__no_builder' not in kwargs:
|
||||
|
@ -586,7 +586,9 @@ class Widget(EventDispatcher):
|
|||
'''
|
||||
|
||||
def on_opacity(self, instance, value):
|
||||
self.canvas.opacity = value
|
||||
canvas = self.canvas
|
||||
if canvas is not None:
|
||||
canvas.opacity = value
|
||||
|
||||
canvas = None
|
||||
'''Canvas of the widget.
|
||||
|
|
Loading…
Reference in New Issue