call do_*_motion() regardless of drawing status
This commit is contained in:
parent
4a7e677bf3
commit
03754f3cec
@ -252,7 +252,7 @@ class SketchWidget:
|
|||||||
self.view_center[1] - this_pt[1] + start_pt[1])
|
self.view_center[1] - this_pt[1] + start_pt[1])
|
||||||
self.panning_start = (event.x, self.size[1] - event.y)
|
self.panning_start = (event.x, self.size[1] - event.y)
|
||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
elif self.drawingShape is not None:
|
else:
|
||||||
if self.mode == 'line':
|
if self.mode == 'line':
|
||||||
self.do_line_motion(event.x, event.y)
|
self.do_line_motion(event.x, event.y)
|
||||||
elif self.mode == 'circle':
|
elif self.mode == 'circle':
|
||||||
@ -383,6 +383,7 @@ class SketchWidget:
|
|||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
|
|
||||||
def do_line_motion(self, x, y):
|
def do_line_motion(self, x, y):
|
||||||
|
if self.drawingShape is not None:
|
||||||
this_pt = self.screenPtToPt((x, self.size[1] - y))
|
this_pt = self.screenPtToPt((x, self.size[1] - y))
|
||||||
start = self.drawingShape.getPt(0)
|
start = self.drawingShape.getPt(0)
|
||||||
angle = math.atan2(this_pt[1] - start[1], this_pt[0] - start[0])
|
angle = math.atan2(this_pt[1] - start[1], this_pt[0] - start[0])
|
||||||
@ -423,6 +424,7 @@ class SketchWidget:
|
|||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
|
|
||||||
def do_circle_motion(self, x, y):
|
def do_circle_motion(self, x, y):
|
||||||
|
if self.drawingShape is not None:
|
||||||
pt = self.screenPtToPt((x, self.size[1] - y))
|
pt = self.screenPtToPt((x, self.size[1] - y))
|
||||||
r = self.dist_bw(self.drawingShape.getPt(0), pt)
|
r = self.dist_bw(self.drawingShape.getPt(0), pt)
|
||||||
self.drawingShape.setRadius(r)
|
self.drawingShape.setRadius(r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user