ui/ImageView.py
def calc_drag_rect(self):
        """
        Compute the drag selection rectangle if possible
        :return: Rectangle if possible, else None
        """
        if self.pt_1 and self.pt_2:
            x = self.pt_1.x()
            y = self.pt_1.y()
            w = self.pt_2.x() - x
            h = self.pt_2.y() - y

            if w < 0:
                w = -w
                x = self.pt_2.x()
            if h < 0:
                h = -h
                y = self.pt_2.y()

            return QRectF(x, y, w, h)
        return None

        Compute the drag selection rectangle if possible
        :return: Rectangle if possible, else None
        
Compute the drag selection rectangle if possible
Compute the drag selection rectangle if possible
def calc_drag_rect(self):
        if self.pt_1 and self.pt_2:
            x = self.pt_1.x()
            y = self.pt_1.y()
            w = self.pt_2.x() - x
            h = self.pt_2.y() - y
            if w < 0:
                w = -w
                x = self.pt_2.x()
            if h < 0:
                h = -h
                y = self.pt_2.y()
            return QRectF(x, y, w, h)
        return None
def calc_drag_rect ( self ) : if self . pt_1 and self . pt_2 : x = self . pt_1 . x ( ) y = self . pt_1 . y ( ) w = self . pt_2 . x ( ) - x h = self . pt_2 . y ( ) - y if w < 0 : w = - w x = self . pt_2 . x ( ) if h < 0 : h = - h y = self . pt_2 . y ( ) return QRectF ( x , y , w , h ) return None
Compute the drag selection rectangle if possible
Compute the drag selection rectangle if possible
"""
        Compute the drag selection rectangle if possible
        :return: Rectangle if possible, else None
        """
Rectangle if possible, else None
Rectangle if possible else None
self