call do_*_motion() regardless of drawing status

This commit is contained in:
Josh Holtrop 2011-07-27 22:58:55 -04:00
parent 4a7e677bf3
commit 03754f3cec

View File

@ -252,7 +252,7 @@ class SketchWidget:
self.view_center[1] - this_pt[1] + start_pt[1])
self.panning_start = (event.x, self.size[1] - event.y)
self.queue_redraw()
elif self.drawingShape is not None:
else:
if self.mode == 'line':
self.do_line_motion(event.x, event.y)
elif self.mode == 'circle':
@ -383,6 +383,7 @@ class SketchWidget:
self.queue_redraw()
def do_line_motion(self, x, y):
if self.drawingShape is not None:
this_pt = self.screenPtToPt((x, self.size[1] - y))
start = self.drawingShape.getPt(0)
angle = math.atan2(this_pt[1] - start[1], this_pt[0] - start[0])
@ -423,6 +424,7 @@ class SketchWidget:
self.queue_redraw()
def do_circle_motion(self, x, y):
if self.drawingShape is not None:
pt = self.screenPtToPt((x, self.size[1] - y))
r = self.dist_bw(self.drawingShape.getPt(0), pt)
self.drawingShape.setRadius(r)