From c7000474b97325414f471f9d7bd8f36ce817d6f8 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 16 Apr 2013 17:35:42 -0400 Subject: [PATCH 1/2] Fix scrolling to always increase proportional to amount dragged. --- kivy/uix/splitter.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/kivy/uix/splitter.py b/kivy/uix/splitter.py index 35d31d310..6b096a01f 100644 --- a/kivy/uix/splitter.py +++ b/kivy/uix/splitter.py @@ -212,14 +212,12 @@ class Splitter(BoxLayout): diff_y = (touch.dy) if sz_frm == 'b': sign = -1 - if not self.size_hint_y: - if self.height > 0: - self.height += sign * diff_y - else: - self.height = 1 + if self.size_hint_y: + self.size_hint_y = None + if self.height > 0: + self.height += sign * diff_y else: - diff = (diff_y / self.parent.height) - self.size_hint_y += sign * (diff) + self.height = 1 height = self.height self.height = max(min_size, min(height, max_size)) @@ -227,14 +225,12 @@ class Splitter(BoxLayout): diff_x = (touch.dx) if sz_frm == 'l': sign = -1 - if not self.size_hint_x: - if self.width > 0: - self.width += sign * (diff_x) - else: - self.width = 1 + if self.size_hint_x: + self.size_hint_x = None + if self.width > 0: + self.width += sign * (diff_x) else: - diff = (diff_x / self.parent.width) - self.size_hint_x += sign * (diff) + self.width = 1 width = self.width self.width = max(min_size, min(width, max_size)) From b0d5b75b0d54d3ffa0f70abc5a840e6d90e87da3 Mon Sep 17 00:00:00 2001 From: rogererens Date: Sun, 21 Apr 2013 02:49:59 +0300 Subject: [PATCH 2/2] Update main.py Make main.py in step 4 consistent with main.py in the other steps --- examples/tutorials/pong/steps/step4/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/pong/steps/step4/main.py b/examples/tutorials/pong/steps/step4/main.py index 33691a56f..febc34b6c 100644 --- a/examples/tutorials/pong/steps/step4/main.py +++ b/examples/tutorials/pong/steps/step4/main.py @@ -8,7 +8,7 @@ from random import randint class PongBall(Widget): - velocity_x = NumericProperty(1) + velocity_x = NumericProperty(0) velocity_y = NumericProperty(0) velocity = ReferenceListProperty(velocity_x, velocity_y)