add Connect constraints for sequentially drawn lines

This commit is contained in:
Josh Holtrop 2011-07-28 09:19:19 -04:00
parent b5080f14dd
commit c75fbc50ab

View File

@ -377,10 +377,15 @@ class SketchWidget:
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))
previous_line = None
if self.drawingShape is not None: if self.drawingShape is not None:
start = self.drawingShape.getPt(1) # start at last snap point start = self.drawingShape.getPt(1) # start at last snap point
previous_line = self.drawingShape
self.merge_in_drawing_shape() self.merge_in_drawing_shape()
self.drawingShape = Line(start[0], start[1], start[0], start[1]) self.drawingShape = Line(start[0], start[1], start[0], start[1])
if previous_line is not None:
connect = Connect(previous_line, 1, self.drawingShape, 0)
self.drawingConstraints['c'] = connect
self.queue_redraw() self.queue_redraw()
def do_line_right_click(self, x, y): def do_line_right_click(self, x, y):