diff --git a/.version b/.version index 23c38c2..bb8edae 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v1.3.1 \ No newline at end of file +v1.3.2 \ No newline at end of file diff --git a/cli/selection.py b/cli/selection.py index 37be0ee..ef7dc3c 100755 --- a/cli/selection.py +++ b/cli/selection.py @@ -129,7 +129,6 @@ def mousePressEvent(self, event): self.pressMode = self.getPositionPressMode(x, y) - # Creating if self.pressMode == PressMode.Creating: self.selPos = (x, y, 0, 0) self.selDims = (0, 0, 0, 0) @@ -159,6 +158,9 @@ def mouseReleaseEvent(self, event): self.leftPressed = False self.pressMode = None + # Fix mirrored selections + self.selPos = self.selDims + self.updateCursor() def mouseMoveEvent(self, event): @@ -259,41 +261,42 @@ def keyPressEvent(self, event): self.capture(dx, dy, dw, dh) elif key in [Qt.Key_Left, Qt.Key_Up, Qt.Key_Right, Qt.Key_Down]: - diffx = 0 - diffy = 0 + if self.pressMode is None: + diffx = 0 + diffy = 0 - if key == Qt.Key_Left: - diffx = -1 + if key == Qt.Key_Left: + diffx = -1 - elif key == Qt.Key_Up: - diffy = -1 + elif key == Qt.Key_Up: + diffy = -1 - elif key == Qt.Key_Right: - diffx = 1 + elif key == Qt.Key_Right: + diffx = 1 - elif key == Qt.Key_Down: - diffy = 1 + elif key == Qt.Key_Down: + diffy = 1 - if event.modifiers() & Qt.ShiftModifier: - diffx *= 4 - diffy *= 4 + if event.modifiers() & Qt.ShiftModifier: + diffx *= 4 + diffy *= 4 - x += diffx - dx += diffx + x += diffx + dx += diffx - y += diffy - dy += diffy + y += diffy + dy += diffy - self.selPos = (x, y, w, h) - self.selDims = (dx, dy, dw, dh) + self.selPos = (x, y, w, h) + self.selDims = (dx, dy, dw, dh) - self.selection.setRect(dx, dy, dw, dh) - self.coverLeft.setRect(0, 0, x, th) - self.coverRight.setRect(x + w, 0, tw, th) - self.coverTop.setRect(x, 0, w, y) - self.coverBottom.setRect(x, y + h, w, th - y - h) + self.selection.setRect(dx, dy, dw, dh) + self.coverLeft.setRect(0, 0, x, th) + self.coverRight.setRect(x + w, 0, tw, th) + self.coverTop.setRect(x, 0, w, y) + self.coverBottom.setRect(x, y + h, w, th - y - h)