From c712bdf24e9ab12447285404b8dbc889ad5a2f44 Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Fri, 7 Jul 2023 19:17:48 +0300 Subject: [PATCH] fix #18467 --- src/engraving/libmscore/tremolo.cpp | 20 ++++++++++++++++++++ src/engraving/libmscore/tremolo.h | 10 ++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/engraving/libmscore/tremolo.cpp b/src/engraving/libmscore/tremolo.cpp index f74ab0fc1bb94..c5dda74609573 100644 --- a/src/engraving/libmscore/tremolo.cpp +++ b/src/engraving/libmscore/tremolo.cpp @@ -600,6 +600,26 @@ void Tremolo::triggerLayout() const } } +bool Tremolo::needStartEditingAfterSelecting() const +{ + return twoNotes(); +} + +int Tremolo::gripsCount() const +{ + return twoNotes() ? 3 : 0; +} + +Grip Tremolo::initialEditModeGrip() const +{ + return twoNotes() ? Grip::END : Grip::NO_GRIP; +} + +Grip Tremolo::defaultGrip() const +{ + return twoNotes() ? Grip::MIDDLE : Grip::NO_GRIP; +} + //--------------------------------------------------------- // gripsPositions //--------------------------------------------------------- diff --git a/src/engraving/libmscore/tremolo.h b/src/engraving/libmscore/tremolo.h index 066e75bc41f77..e9e4fc828f0e3 100644 --- a/src/engraving/libmscore/tremolo.h +++ b/src/engraving/libmscore/tremolo.h @@ -132,15 +132,13 @@ class Tremolo final : public EngravingItem void setUp(bool up) { _up = up; } // only need grips for two-note trems - bool needStartEditingAfterSelecting() const override { return twoNotes(); } - int gripsCount() const override { return 3; } - Grip initialEditModeGrip() const override { return Grip::END; } - Grip defaultGrip() const override { return Grip::MIDDLE; } + bool needStartEditingAfterSelecting() const override; + int gripsCount() const override; + Grip initialEditModeGrip() const; + Grip defaultGrip() const override; std::vector gripsPositions(const EditData&) const override; bool isMovable() const override { return true; } - void startDrag(EditData&) override {} bool isEditable() const override { return true; } - void startEdit(EditData&) override {} void endEdit(EditData&) override; void editDrag(EditData&) override;