From 83e231d8a4c9a7571e6b230ea234617f959f0cb9 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 6 Oct 2026 18:31:33 -0500 Subject: [PATCH] Fix bug where middle-click panning on an event moves the event's position --- src/ui/eventpixmapitem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/eventpixmapitem.cpp b/src/ui/eventpixmapitem.cpp index c85e5f59..e1e8480a 100644 --- a/src/ui/eventpixmapitem.cpp +++ b/src/ui/eventpixmapitem.cpp @@ -4,6 +4,8 @@ #include "mapruler.h" #include "metatile.h" +#include + EventPixmapItem::EventPixmapItem(Event *event) : QGraphicsPixmapItem(event->getPixmap()), m_basePixmap(pixmap()), @@ -75,6 +77,11 @@ void EventPixmapItem::updatePixelPosition() { void EventPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { if (m_active) return; + if (QApplication::mouseButtons() & Qt::MiddleButton) { + // Let the view handle the event so that it can pan instead of dragging this item. + mouseEvent->ignore(); + return; + } m_active = true; m_lastPos = Metatile::coordFromPixmapCoord(mouseEvent->scenePos());