mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-22 06:21:00 -05:00
Merge pull request #810 from huderlem/huderlem/event-pan-conflict
Some checks failed
Build Porymap / build-linux (, 5.14.2) (push) Has been cancelled
Build Porymap / build-linux (, 6.8.*) (push) Has been cancelled
Build Porymap / build-linux (minimal, 5.14.2) (push) Has been cancelled
Build Porymap / build-macos (macos-15-intel) (push) Has been cancelled
Build Porymap / build-macos (macos-latest) (push) Has been cancelled
Build Porymap / build-static-windows (push) Has been cancelled
Some checks failed
Build Porymap / build-linux (, 5.14.2) (push) Has been cancelled
Build Porymap / build-linux (, 6.8.*) (push) Has been cancelled
Build Porymap / build-linux (minimal, 5.14.2) (push) Has been cancelled
Build Porymap / build-macos (macos-15-intel) (push) Has been cancelled
Build Porymap / build-macos (macos-latest) (push) Has been cancelled
Build Porymap / build-static-windows (push) Has been cancelled
Don't drag events when panning with middle-mouse click
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "mapruler.h"
|
||||
#include "metatile.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user