mirror of https://github.com/kivy/kivy.git
Change effectwidget to work with bg alpha
This commit is contained in:
parent
02b2ff7deb
commit
e71f8381fc
|
@ -647,7 +647,7 @@ class EffectWidget(RelativeLayout):
|
||||||
with self.fbo:
|
with self.fbo:
|
||||||
ClearColor(0, 0, 0, 0)
|
ClearColor(0, 0, 0, 0)
|
||||||
ClearBuffers()
|
ClearBuffers()
|
||||||
Color(*self.background_color)
|
self._background_color = Color(*self.background_color)
|
||||||
self.fbo_rectangle = Rectangle(size=self.size)
|
self.fbo_rectangle = Rectangle(size=self.size)
|
||||||
with self.fbo.after:
|
with self.fbo.after:
|
||||||
PopMatrix()
|
PopMatrix()
|
||||||
|
@ -657,10 +657,14 @@ class EffectWidget(RelativeLayout):
|
||||||
Clock.schedule_interval(self._update_glsl, 0)
|
Clock.schedule_interval(self._update_glsl, 0)
|
||||||
|
|
||||||
self.bind(size=self.refresh_fbo_setup,
|
self.bind(size=self.refresh_fbo_setup,
|
||||||
effects=self.refresh_fbo_setup)
|
effects=self.refresh_fbo_setup,
|
||||||
|
background_color=self._refresh_background_color)
|
||||||
|
|
||||||
self.refresh_fbo_setup()
|
self.refresh_fbo_setup()
|
||||||
|
|
||||||
|
def _refresh_background_color(self, *args):
|
||||||
|
self._background_color.rgba = self.background_color
|
||||||
|
|
||||||
def _update_glsl(self, *largs):
|
def _update_glsl(self, *largs):
|
||||||
'''(internal) Passes new time and resolution uniform
|
'''(internal) Passes new time and resolution uniform
|
||||||
variables to the shader.
|
variables to the shader.
|
||||||
|
@ -683,8 +687,9 @@ class EffectWidget(RelativeLayout):
|
||||||
with self.canvas:
|
with self.canvas:
|
||||||
new_fbo = EffectFbo(size=self.size)
|
new_fbo = EffectFbo(size=self.size)
|
||||||
with new_fbo:
|
with new_fbo:
|
||||||
ClearColor(1, 1, 1, 1)
|
ClearColor(0, 0, 0, 0)
|
||||||
ClearBuffers()
|
ClearBuffers()
|
||||||
|
Color(1, 1, 1, 1)
|
||||||
new_fbo.texture_rectangle = Rectangle(size=self.size)
|
new_fbo.texture_rectangle = Rectangle(size=self.size)
|
||||||
|
|
||||||
new_fbo.texture_rectangle.size = self.size
|
new_fbo.texture_rectangle.size = self.size
|
||||||
|
|
Loading…
Reference in New Issue