- Working project and draw on exiting

This commit is contained in:
bklronin
2024-07-11 20:16:20 +02:00
parent cb471b4108
commit d2b8d9540a
4 changed files with 256 additions and 55 deletions

View File

@@ -637,7 +637,7 @@ class SketchWidget(QWidget):
def draw_cross(self, painter, x, y, size=10):
# Set up the pen
pen = QPen(QColor('red')) # You can change the color as needed
pen.setWidth(2) # Set the line width
pen.setWidth(int(2 / self.zoom)) # Set the line widt)h
painter.setPen(pen)
# Calculate the endpoints of the cross
@@ -677,10 +677,6 @@ class SketchWidget(QWidget):
for point in self.slv_points_main:
painter.drawEllipse(point['ui_point'], 3 / self.zoom, 3 / self.zoom)
for cross in self.proj_snap_points:
# Calculate the endpoints of the cross
self.draw_cross(painter, cross[0], cross[1], 10)
for dic in self.slv_lines_main:
p1 = dic['ui_points'][0]
p2 = dic['ui_points'][1]
@@ -716,6 +712,10 @@ class SketchWidget(QWidget):
painter.setPen(QPen(Qt.red, 2))
painter.drawLine(p1, p2)
for cross in self.proj_snap_points:
# Calculate the endpoints of the cross
self.draw_cross(painter, cross[0], cross[1], 10)
# self.drawBackgroundGrid(painter)
painter.end()