added cancel_drawing_shape()
This commit is contained in:
parent
47ac5cb3fd
commit
4a7e677bf3
@ -367,8 +367,7 @@ class SketchWidget:
|
|||||||
else:
|
else:
|
||||||
self.widget.window.set_cursor(self.cursors['arrow'])
|
self.widget.window.set_cursor(self.cursors['arrow'])
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.drawingShape = None
|
self.cancel_drawing_shape()
|
||||||
self.drawingConstraints = []
|
|
||||||
|
|
||||||
def do_line_left_click(self, x, y):
|
def do_line_left_click(self, x, y):
|
||||||
start = self.screenPtToPt((x, self.size[1] - y))
|
start = self.screenPtToPt((x, self.size[1] - y))
|
||||||
@ -380,8 +379,7 @@ class SketchWidget:
|
|||||||
|
|
||||||
def do_line_right_click(self, x, y):
|
def do_line_right_click(self, x, y):
|
||||||
if self.drawingShape is not None:
|
if self.drawingShape is not None:
|
||||||
# cancel line currently being drawn
|
self.cancel_drawing_shape()
|
||||||
self.drawingShape = None
|
|
||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
|
|
||||||
def do_line_motion(self, x, y):
|
def do_line_motion(self, x, y):
|
||||||
@ -421,8 +419,7 @@ class SketchWidget:
|
|||||||
|
|
||||||
def do_circle_right_click(self, x, y):
|
def do_circle_right_click(self, x, y):
|
||||||
if self.drawingShape is not None:
|
if self.drawingShape is not None:
|
||||||
# cancel circle currently being drawn
|
self.cancel_drawing_shape()
|
||||||
self.drawingShape = None
|
|
||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
|
|
||||||
def do_circle_motion(self, x, y):
|
def do_circle_motion(self, x, y):
|
||||||
@ -431,6 +428,10 @@ class SketchWidget:
|
|||||||
self.drawingShape.setRadius(r)
|
self.drawingShape.setRadius(r)
|
||||||
self.queue_redraw()
|
self.queue_redraw()
|
||||||
|
|
||||||
|
def cancel_drawing_shape(self):
|
||||||
|
self.drawingShape = None
|
||||||
|
self.drawingConstraints = []
|
||||||
|
|
||||||
def merge_in_drawing_shape(self):
|
def merge_in_drawing_shape(self):
|
||||||
self.sketch.shapes.append(self.drawingShape)
|
self.sketch.shapes.append(self.drawingShape)
|
||||||
for c in self.drawingConstraints:
|
for c in self.drawingConstraints:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user