mirror of
https://github.com/serialexperiments0815/PythonJigsaw01.git
synced 2026-07-12 15:32:26 +00:00
Removed print debugging
This commit is contained in:
parent
67035f5bc0
commit
e32b6d82c7
2 changed files with 0 additions and 14 deletions
|
|
@ -40,11 +40,6 @@ class JigsawPiece(QGraphicsPixmapItem):
|
|||
|
||||
JigsawPiece.allPieces.append(self)
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
|
||||
print("Momentane Position: {", self.getPositionX() , " - ", self.getPositionY(), "} Piece number: ", self.number, " Row: ", self.row, " Col: ", self.col, " Starting pos:", self.startPos)
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
if event.buttons() == Qt.LeftButton and self.pos():
|
||||
delta = self.mapToParent(event.pos()) - self.pos()
|
||||
|
|
@ -54,10 +49,6 @@ class JigsawPiece(QGraphicsPixmapItem):
|
|||
|
||||
def mouseReleaseEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
neighbors = self.getDistanceToNeighborPieces()
|
||||
print(len(JigsawPiece.allPieces))
|
||||
for item in neighbors:
|
||||
print(f"Neighbor {item[0]} {item[3]}: distance x{item[1]}. y{item[2]}")
|
||||
self.checkPieceCluster()
|
||||
|
||||
def getPositionX(self):
|
||||
|
|
@ -122,9 +113,7 @@ class PuzzleWindow(QGraphicsScene):
|
|||
|
||||
self.filePath = filePath
|
||||
self.rows = rows
|
||||
print("ROWS: ", self.rows-1)
|
||||
self.cols = cols
|
||||
print("COLS: ", self.cols-1)
|
||||
if (filePath != None):
|
||||
|
||||
self.createPuzzle(rows, cols)
|
||||
|
|
@ -157,8 +146,6 @@ class PuzzleWindow(QGraphicsScene):
|
|||
qimage = QImage(data, width, height, 3 * width, QImage.Format_RGB888)
|
||||
pixmap = QPixmap.fromImage(qimage)
|
||||
piece = JigsawPiece(pixmap, (j*pieceW, i*pieceH), i, j)
|
||||
print(f"Piecenumber: {piece.number} | Row: {i} Col: {j} | H: {pieceImg.height} W: {pieceImg.width}")
|
||||
|
||||
piece.setPos(random.randint(0, w-pieceW), random.randint(0, h-pieceH))
|
||||
self.addItem(piece)
|
||||
piece.setPos(random.randint(1, int(self.width()-pieceW)), random.randint(1, int(self.height()-pieceH)))
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class SettingsWindow(QDialog):
|
|||
|
||||
|
||||
def updateSliderValue(self, value):
|
||||
print(value)
|
||||
snapped = 2 * round(value / 2)
|
||||
self.sliderText.setText(f"Number of puzzle pieces: {snapped}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue