Explorar o código

Don't allow creating points outside of pixmap

This was not checked against in the mouse press handler.
Michael Pitidis %!s(int64=13) %!d(string=hai) anos
pai
achega
541b237fbb
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      canvas.py

+ 2 - 0
canvas.py

@@ -86,6 +86,8 @@ class Canvas(QWidget):
                     self.repaint()
                 else:
                     pos = self.transformPos(ev.posF())
+                    if self.outOfPixmap(pos):
+                        return
                     self.current = Shape()
                     self.line.points = [pos, pos]
                     self.current.addPoint(pos)