From 68577404829e5c9a9914682ea07fba5f9f5d3213 Mon Sep 17 00:00:00 2001 From: Christopher Denter Date: Thu, 14 Apr 2011 12:03:06 +0200 Subject: [PATCH] scatter: respect scatter.do_scale property and don't scale if it's set to False --- kivy/uix/scatter.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kivy/uix/scatter.py b/kivy/uix/scatter.py index 258edabcd..d71afe2ee 100644 --- a/kivy/uix/scatter.py +++ b/kivy/uix/scatter.py @@ -348,13 +348,14 @@ class Scatter(Widget): new_line = Vector(*touch.pos) - anchor angle = radians(new_line.angle(old_line)) * self.do_rotation - scale = new_line.length() / old_line.length() - new_scale = scale * self.scale - if new_scale < self.scale_min or new_scale > self.scale_max: - scale = 1.0 - self.apply_transform(Matrix().rotate(angle, 0, 0, 1), anchor=anchor) - self.apply_transform(Matrix().scale(scale, scale, scale), anchor=anchor) + + if self.do_scale: + scale = new_line.length() / old_line.length() + new_scale = scale * self.scale + if new_scale < self.scale_min or new_scale > self.scale_max: + scale = 1.0 + self.apply_transform(Matrix().scale(scale, scale, scale), anchor=anchor) def on_touch_down(self, touch): x, y = touch.x, touch.y