|
|
@@ -111,8 +111,9 @@ class TransformationTracker(GestureTracker):
|
|
|
|
|
|
def update_centroid(self):
|
|
|
if not self.points:
|
|
|
+ prev = self.centroid
|
|
|
self.centroid = None
|
|
|
- return
|
|
|
+ return prev
|
|
|
|
|
|
# Calculate average touch point coordinates
|
|
|
l = len(self.points)
|
|
|
@@ -124,6 +125,7 @@ class TransformationTracker(GestureTracker):
|
|
|
# Update centroid positionable
|
|
|
if self.centroid:
|
|
|
self.centroid.set_position(x, y)
|
|
|
+ return self.centroid.prev
|
|
|
else:
|
|
|
self.centroid = MovingPositionable(x, y)
|
|
|
|
|
|
@@ -176,13 +178,14 @@ class TransformationTracker(GestureTracker):
|
|
|
self.centroid.translation(), l))
|
|
|
|
|
|
def on_point_up(self, event):
|
|
|
- if event.point in self.points:
|
|
|
- self.points.remove(event.point)
|
|
|
+ point = event.get_touch_object()
|
|
|
+
|
|
|
+ if point in self.points:
|
|
|
+ self.points.remove(point)
|
|
|
+ prev = self.update_centroid()
|
|
|
|
|
|
if not self.points:
|
|
|
- self.trigger(FlickGesture(event, self.centroid,
|
|
|
- self.centroid.translation()))
|
|
|
- self.update_centroid()
|
|
|
+ self.trigger(FlickGesture(event, point, point - prev))
|
|
|
|
|
|
if not self.propagate_events:
|
|
|
event.stop_propagation()
|