From 0abbe02f00c7b7a31ae661854964d094e3eb0d5a Mon Sep 17 00:00:00 2001 From: Gipzo Date: Thu, 25 Apr 2013 11:00:13 +0300 Subject: [PATCH 1/2] Fixes issue 1140 --- kivy/uix/screenmanager.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kivy/uix/screenmanager.py b/kivy/uix/screenmanager.py index 9c3e121c9..3a74a6fb0 100644 --- a/kivy/uix/screenmanager.py +++ b/kivy/uix/screenmanager.py @@ -135,7 +135,8 @@ from kivy.uix.relativelayout import RelativeLayout from kivy.lang import Builder from kivy.graphics.transformation import Matrix from kivy.graphics import RenderContext, Rectangle, Fbo, \ - ClearColor, ClearBuffers, BindTexture + ClearColor, ClearBuffers, BindTexture, Rotate +from kivy.config import Config class ScreenManagerException(Exception): @@ -405,12 +406,19 @@ class ShaderTransition(TransitionBase): self.fbo_out = self.make_screen_fbo(self.screen_out) self.manager.canvas.add(self.fbo_in) self.manager.canvas.add(self.fbo_out) + + screen_rotation = Config.getfloat('graphics', 'rotation') + pos = (0, 1) + if screen_rotation == 90: pos = (0, 0) + if screen_rotation == 180: pos = (-1, 0) + if screen_rotation == 270: pos = (-1, 1) self.render_ctx = RenderContext(fs=self.fs) with self.render_ctx: BindTexture(texture=self.fbo_out.texture, index=1) BindTexture(texture=self.fbo_in.texture, index=2) - Rectangle(size=(1, -1), pos=(0, 1)) + Rotate(screen_rotation, 0, 0 , 1) + Rectangle(size=(1, -1), pos=pos) self.render_ctx['projection_mat'] = Matrix().\ view_clip(0, 1, 0, 1, 0, 1, 0) self.render_ctx['tex_out'] = 1 From 938e830c6c631ec9b0d429e603bf4cd8b679fe37 Mon Sep 17 00:00:00 2001 From: Gipzo Date: Thu, 25 Apr 2013 12:07:12 +0300 Subject: [PATCH 2/2] Cleaned ifs Thanks to Ian-Foote --- kivy/uix/screenmanager.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kivy/uix/screenmanager.py b/kivy/uix/screenmanager.py index 3a74a6fb0..bac1a5862 100644 --- a/kivy/uix/screenmanager.py +++ b/kivy/uix/screenmanager.py @@ -408,10 +408,13 @@ class ShaderTransition(TransitionBase): self.manager.canvas.add(self.fbo_out) screen_rotation = Config.getfloat('graphics', 'rotation') - pos = (0, 1) - if screen_rotation == 90: pos = (0, 0) - if screen_rotation == 180: pos = (-1, 0) - if screen_rotation == 270: pos = (-1, 1) + pos = (0, 1) + if screen_rotation == 90: + pos = (0, 0) + elif screen_rotation == 180: + pos = (-1, 0) + elif screen_rotation == 270: + pos = (-1, 1) self.render_ctx = RenderContext(fs=self.fs) with self.render_ctx: