Fix crash when pressing Ctrl+N while doing a rubberband selection

This commit is contained in:
Rebecca Breu 2024-02-19 19:07:51 +01:00
parent 40e9c27ca7
commit 09984faedf
3 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,11 @@
0.3.3 - (unreleased)
====================
Fixed
-----
* Fixed a crash when pressing the keyboard shortcut for New Scene
while in the process of doing a rubberband selection
0.3.2 - 2024-01-21

View file

@ -54,6 +54,7 @@ class BeeGraphicsScene(QtWidgets.QGraphicsScene):
def clear(self):
super().clear()
self.internal_clipboard = []
self.rubberband_item = RubberbandItem()
def addItem(self, item):
logger.debug(f'Adding item {item}')

View file

@ -639,7 +639,7 @@ class MultiSelectItem(SelectableMixin,
def fit_selection_area(self, rect):
"""Updates itself to fit the given selection area."""
logger.debug(f'Fit selection area to {rect}')
logger.trace(f'Fit selection area to {rect}')
# Only update when values have changed, otherwise we end up in an
# infinite event loop sceneChange -> itemChange -> sceneChange ...
@ -688,4 +688,4 @@ class RubberbandItem(BaseItemMixin, QtWidgets.QGraphicsRectItem):
"""Updates itself to fit the two given points."""
self.setRect(utils.get_rect_from_points(point1, point2))
logger.debug(f'Updated rubberband {self}')
logger.trace(f'Updated rubberband {self}')