From eb3964bcc3e02f885cec656fa88fca40d203abd5 Mon Sep 17 00:00:00 2001 From: garak Date: Thu, 9 May 2019 00:44:57 -0400 Subject: [PATCH] improve way selected events are rendered on top --- include/editor.h | 6 +++++- src/editor.cpp | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/editor.h b/include/editor.h index 3f022388..553868f2 100644 --- a/include/editor.h +++ b/include/editor.h @@ -204,7 +204,11 @@ public: int y = event->getPixelY(); setX(x); setY(y); - setZValue(event->y()); + if (editor->selected_events && editor->selected_events->contains(this)) { + setZValue(event->y() + 1); + } else { + setZValue(event->y()); + } } void move(int x, int y); void emitPositionChanged() { diff --git a/src/editor.cpp b/src/editor.cpp index ee79edab..e209f0aa 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1243,7 +1243,6 @@ void Editor::selectMapEvent(DraggablePixmapItem *object, bool toggle) { selected_events->append(object); } updateSelectedEvents(); - object->setZValue(object->y() + 1); } }