From cc376d931bf13add7d861f7c5df6f605ea010ee0 Mon Sep 17 00:00:00 2001 From: Charles Merriam Date: Sat, 31 Jan 2015 17:04:28 -0800 Subject: [PATCH] Minor code documentation and whitespace --- examples/canvas/bezier.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/canvas/bezier.py b/examples/canvas/bezier.py index b9141fcf4..45ebdfb60 100644 --- a/examples/canvas/bezier.py +++ b/examples/canvas/bezier.py @@ -9,10 +9,10 @@ class BezierTest(FloatLayout): def __init__(self, points=[], loop=False, *args, **kwargs): super(BezierTest, self).__init__(*args, **kwargs) - self.d = 10 + self.d = 10 # pixel tolerance when clicking on a point self.points = points self.loop = loop - self.current_point = None + self.current_point = None # index of point being dragged with self.canvas: Color(1.0, 0.0, 0.0) @@ -51,9 +51,8 @@ class BezierTest(FloatLayout): def on_touch_down(self, touch): if self.collide_point(touch.pos[0], touch.pos[1]): for i, p in enumerate(list(zip(self.points[::2], self.points[1::2]))): - if ( - abs(touch.pos[0] - self.pos[0] - p[0]) < self.d and - abs(touch.pos[1] - self.pos[1] - p[1]) < self.d): + if ( abs(touch.pos[0] - self.pos[0] - p[0]) < self.d and + abs(touch.pos[1] - self.pos[1] - p[1]) < self.d): self.current_point = i + 1 return True return super(BezierTest, self).on_touch_down(touch)