Fix crash when dragging an image and toggling on crop mode

`crop_mode_event_start` would be set to `None` and thus crash the program. Add a check for this.
This commit is contained in:
DarkDefender 2024-05-30 16:57:28 +02:00 committed by Rebecca Breu
parent ef8189ec72
commit e804766dc4

View file

@ -584,7 +584,7 @@ class BeePixmapItem(BeeItemMixin, QtWidgets.QGraphicsPixmapItem):
return point
def mouseMoveEvent(self, event):
if self.crop_mode:
if self.crop_mode and self.crop_mode_event_start:
diff = event.pos() - self.crop_mode_event_start
if self.crop_mode_move == self.crop_handle_topleft:
new = self.ensure_point_within_crop_bounds(