diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 18e8b1950..f0eca72e8 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -113,6 +113,9 @@ pos: self.center_x - self.norm_image_size[0] / 2., self.center_y - self.norm_image_size[1] / 2. : + canvas.before: + Translate: + xy: -self.x, -self.y canvas: Color: rgba: 1, 1, 1, 1 diff --git a/kivy/uix/effectwidget.py b/kivy/uix/effectwidget.py index b295ae207..879e2383f 100644 --- a/kivy/uix/effectwidget.py +++ b/kivy/uix/effectwidget.py @@ -644,11 +644,10 @@ class EffectWidget(RelativeLayout): with self.fbo.before: PushMatrix() - self.fbo_translation = Translate(-self.x, -self.y, 0) with self.fbo: - ClearColor(1, 1, 1, 1) - Color(*self.background_color) + ClearColor(0, 0, 0, 0) ClearBuffers() + Color(*self.background_color) self.fbo_rectangle = Rectangle(size=self.size) with self.fbo.after: PopMatrix() @@ -657,18 +656,11 @@ class EffectWidget(RelativeLayout): Clock.schedule_interval(self._update_glsl, 0) - self.bind(pos=self._update_translation, - size=self.refresh_fbo_setup, + self.bind(size=self.refresh_fbo_setup, effects=self.refresh_fbo_setup) self.refresh_fbo_setup() - def _update_translation(self, *args): - '''(internal) Makes sure everything is translated correctly to - appear in the fbo.''' - self.fbo_translation.x = -self.x - self.fbo_translation.y = -self.y - def _update_glsl(self, *largs): '''(internal) Passes new time and resolution uniform variables to the shader. @@ -692,7 +684,6 @@ class EffectWidget(RelativeLayout): new_fbo = EffectFbo(size=self.size) with new_fbo: ClearColor(1, 1, 1, 1) - Color(*self.background_color) ClearBuffers() new_fbo.texture_rectangle = Rectangle(size=self.size)