IconEditor/IconEditorGrid.py

changeset 2957
c7f8c7561542
parent 2404
cba0ff902c2b
child 2992
dbdf27746da5
equal deleted inserted replaced
2956:615dbd8a696a 2957:c7f8c7561542
438 """ 438 """
439 Private method to determine the rectangle for a given pixel coordinate. 439 Private method to determine the rectangle for a given pixel coordinate.
440 440
441 @param i x-coordinate of the pixel in the image (integer) 441 @param i x-coordinate of the pixel in the image (integer)
442 @param j y-coordinate of the pixel in the image (integer) 442 @param j y-coordinate of the pixel in the image (integer)
443 return rectangle for the given pixel coordinates (QRect) 443 @return rectangle for the given pixel coordinates (QRect)
444 """ 444 """
445 if self.__zoom >= 3 and self.__gridEnabled: 445 if self.__zoom >= 3 and self.__gridEnabled:
446 return QRect(self.__zoom * i + 1, self.__zoom * j + 1, 446 return QRect(self.__zoom * i + 1, self.__zoom * j + 1,
447 self.__zoom - 1, self.__zoom - 1) 447 self.__zoom - 1, self.__zoom - 1)
448 else: 448 else:
607 self.__updateImageRect(self.__pasteRect.topLeft(), 607 self.__updateImageRect(self.__pasteRect.topLeft(),
608 self.__pasteRect.bottomRight() + QPoint(1, 1)) 608 self.__pasteRect.bottomRight() + QPoint(1, 1))
609 609
610 def __drawTool(self, pos, mark): 610 def __drawTool(self, pos, mark):
611 """ 611 """
612 Public method to perform a draw operation depending of the current tool. 612 Public method to perform a draw operation depending of the current
613 tool.
613 614
614 @param pos widget coordinate to perform the draw operation at (QPoint) 615 @param pos widget coordinate to perform the draw operation at (QPoint)
615 @param mark flag indicating a mark operation (boolean) 616 @param mark flag indicating a mark operation (boolean)
616 @param flag indicating a successful draw (boolean) 617 @return flag indicating a successful draw (boolean)
617 """ 618 """
618 self.__unMark() 619 self.__unMark()
619 620
620 if mark: 621 if mark:
621 self.__endPos = QPoint(pos) 622 self.__endPos = QPoint(pos)

eric ide

mercurial