|
|
@@ -45,16 +45,19 @@ class TransformationTracker(GestureTracker):
|
|
|
self.update_centroid()
|
|
|
|
|
|
def on_point_move(self, point):
|
|
|
- if len(self.points) > 1:
|
|
|
+ l = len(self.points)
|
|
|
+
|
|
|
+ if l > 1:
|
|
|
# Rotation (around the previous centroid)
|
|
|
if self.is_type_bound('rotate'):
|
|
|
- rotation = point.rotation_around(self.centroid)
|
|
|
+ rotation = point.rotation_around(self.centroid) / l
|
|
|
self.trigger(RotationGesture(self.centroid, rotation))
|
|
|
|
|
|
# Scale
|
|
|
if self.is_type_bound('pinch'):
|
|
|
prev = point.get_previous_position().distance_to(self.centroid)
|
|
|
dist = point.distance_to(self.centroid)
|
|
|
+ dist = prev + (dist - prev) / l
|
|
|
scale = dist / prev
|
|
|
self.trigger(PinchGesture(self.centroid, scale))
|
|
|
|