소스 검색

Don't allow creating points outside of pixmap

This was not checked against in the mouse press handler.
Michael Pitidis 13 년 전
부모
커밋
541b237fbb
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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)