From 84882a5fadb58b0cab2cc5ec4711656a40560da5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 20 Apr 2025 09:24:32 -0400 Subject: [PATCH] Prevent dragging events that aren't selected --- src/ui/eventpixmapitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/eventpixmapitem.cpp b/src/ui/eventpixmapitem.cpp index 7c0b43d3..bc7bb964 100644 --- a/src/ui/eventpixmapitem.cpp +++ b/src/ui/eventpixmapitem.cpp @@ -74,6 +74,7 @@ void EventPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { if (selectionToggle || !m_selected) { // User is either toggling this selection on/off as part of a group selection, // or they're newly selecting just this item. + m_selected = (selectionToggle) ? !m_selected : true; emit selected(m_event, selectionToggle); } else { // This item is already selected and the user isn't toggling the selection, so there are 4 possibilities: @@ -89,7 +90,7 @@ void EventPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { } void EventPixmapItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) { - if (!m_active) + if (!m_active || !m_selected) return; QPoint pos = Metatile::coordFromPixmapCoord(mouseEvent->scenePos());