def wheelEvent(self, ev):
        # Scroll up/down when ctrl not pressed
        if not self.ctrl_down:
            if 0 > ev.delta():
                direction = 1
            else:
                direction = -1
            v = self.verticalScrollBar()
            v.setValue(v.value() - direction * 80)      # Opposite to slider direction
            return
        
        # Zoom in/out
        widget = self.widget()
        if isinstance(widget, LoadingIndicator):
            return
        
        ratio = self.ratio
        if ev.delta() > 0:
            ratio += self.zoom_delta
            if ratio > 2.0:
                ratio = 2.0
        else:
            ratio -= self.zoom_delta
            if ratio < 0.2:
                ratio = 0.2
                
        width = self.original_size.width() * ratio
        height = self.original_size.height() * ratio
        
        if widget.movie():
            pic = QMovie(self.image)
            pic.setScaledSize(QSize(width, height))
            pic.start()
            widget.setMovie(pic)
        else:
            pic = self.image.scaled(QSize(width, height), transformMode=Qt.SmoothTransformation)
            widget.setPixmap(pic)
        widget.resize(QSize(width, height))
        
        # Keep the position of viewport center not changed after zoom in/out
        w = self.viewport().width()
        h = self.viewport().height()
        x = self.horizontalScrollBar().value() + w / 2
        y = self.verticalScrollBar().value() + h / 2
        self.horizontalScrollBar().setValue(x * ratio / self.ratio - w / 2)
        self.verticalScrollBar().setValue(y * ratio / self.ratio - h / 2)
        
        self.ratio = ratio
        self.emit(SIGNAL_ZOOM, self.ratio)
dataset/ETHPy150Open hbprotoss/weii/app/widget/picture_viewer.py/ScrollArea.wheelEvent/swapped operands of `>`