Procházet zdrojové kódy

Minor refactoring, change pen size

Michael Pitidis před 13 roky
rodič
revize
4be2bbba25
2 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 3 3
      canvas.py
  2. 1 0
      shape.py

+ 3 - 3
canvas.py

@@ -23,8 +23,8 @@ class Canvas(QWidget):
         self.current = None
         self.selectedShape=None # save the selected shape here
         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.prevPoint=QPoint()
         self.scale = 1.0
@@ -61,7 +61,7 @@ class Canvas(QWidget):
         # Polygon drawing.
         if self.current and self.editing():
             pos = self.transformPos(ev.posF())
-            color = self.line_color
+            color = self.lineColor
             if self.outOfPixmap(pos):
                 # Don't allow the user to draw outside the pixmap.
                 # Project the point to the pixmap's edges.

+ 1 - 0
shape.py

@@ -45,6 +45,7 @@ class Shape(object):
     def paint(self, painter):
         if self.points:
             pen = QPen(self.select_color if self.selected else self.line_color)
+            pen.setWidth(2)
             painter.setPen(pen)
 
             line_path = QPainterPath()