|
@@ -23,8 +23,8 @@ class Canvas(QWidget):
|
|
self.current = None
|
|
self.current = None
|
|
self.selectedShape=None # save the selected shape here
|
|
self.selectedShape=None # save the selected shape here
|
|
self.selectedShapeCopy=None
|
|
self.selectedShapeCopy=None
|
|
- self.line_color = QColor(0, 0, 255)
|
|
|
|
- self.line = Shape(line_color=self.line_color)
|
|
|
|
|
|
+ self.lineColor = QColor(0, 0, 255)
|
|
|
|
+ self.line = Shape(line_color=self.lineColor)
|
|
self.mouseButtonIsPressed=False #when it is true and shape is selected , move the shape with the mouse move event
|
|
self.mouseButtonIsPressed=False #when it is true and shape is selected , move the shape with the mouse move event
|
|
self.prevPoint=QPoint()
|
|
self.prevPoint=QPoint()
|
|
self.scale = 1.0
|
|
self.scale = 1.0
|
|
@@ -61,7 +61,7 @@ class Canvas(QWidget):
|
|
# Polygon drawing.
|
|
# Polygon drawing.
|
|
if self.current and self.editing():
|
|
if self.current and self.editing():
|
|
pos = self.transformPos(ev.posF())
|
|
pos = self.transformPos(ev.posF())
|
|
- color = self.line_color
|
|
|
|
|
|
+ color = self.lineColor
|
|
if self.outOfPixmap(pos):
|
|
if self.outOfPixmap(pos):
|
|
# Don't allow the user to draw outside the pixmap.
|
|
# Don't allow the user to draw outside the pixmap.
|
|
# Project the point to the pixmap's edges.
|
|
# Project the point to the pixmap's edges.
|