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); } }