Explorar el Código

Don't allow creating points outside of pixmap

This was not checked against in the mouse press handler.
Michael Pitidis hace 13 años
padre
commit
541b237fbb
Se han modificado 1 ficheros con 2 adiciones y 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)