프로젝트

일반

사용자정보

개정판 68867375

ID68867375db36a1f447a27fff6e05eaebc339a346
상위 5f360e2f
하위 817f058d

함의성이(가) 6년 이상 전에 추가함

issue #000: zoom comm mouse button response fix

차이점 보기:

DTI_PID/DTI_PID/Commands/AreaZoomCommand.py
26 26

  
27 27
        self._rubberBand = QRubberBand(QRubberBand.Rectangle, self.imageViewer)
28 28
        self._origin = QPoint()
29
        self.isLeftClicked = False
29 30
    
30 31
    '''
31 32
        @brief      pan image by left click and drag
......
38 39
        
39 40
        self.isTreated = False
40 41
        if 'mousePressEvent' == param[0]:
41
            if self.imageViewer.canZoom:
42
                if event.button() == Qt.LeftButton:
42
            if event.button() == Qt.LeftButton:
43
                self.isLeftClicked = True
44
                if self.imageViewer.canZoom:
43 45
                    self._origin = event.pos()
44 46
                    self._rubberBand.setGeometry(QRect(self._origin, QSize()))
45 47
                    self._rubberBand.show()
......
50 52
                self._rubberBand.setGeometry(QRect(self._origin, event.pos()).normalized())
51 53
        elif 'mouseReleaseEvent' == param[0]:
52 54
            try:
55
                if event.button() == Qt.LeftButton:
56
                    self.isLeftClicked = False
53 57
                if self.imageViewer.canZoom and event.button() == Qt.LeftButton:
54 58
                    self._rubberBand.hide()
55 59
                    topLeft = self.imageViewer.mapToScene(self._rubberBand.geometry().topLeft())
......
57 61
                    self.imageViewer.zoomStack.append(QRectF(topLeft.x(), topLeft.y(), bottomRight.x() - topLeft.x(), bottomRight.y() - topLeft.y()))
58 62
                    self.imageViewer.updateViewer()
59 63
                elif event.button() == Qt.RightButton:
60
                    self.onRejected.emit(self)
64
                    if self.isLeftClicked == False:
65
                        self.onRejected.emit(self)
61 66
            finally:
62 67
                pass
63 68

  

내보내기 Unified diff