Prevent dragging events that aren't selected

This commit is contained in:
GriffinR 2025-04-20 09:24:32 -04:00
parent e26be84d91
commit 84882a5fad

View File

@ -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());