From 75f4abc4e5fd29e09fe9315bae659761aeafa637 Mon Sep 17 00:00:00 2001 From: Igor Korsukov Date: Mon, 10 Jul 2023 14:02:31 +0300 Subject: [PATCH] [palette] added layout for Chord --- src/palette/internal/palettelayout.cpp | 12 +++++++++++- src/palette/internal/palettelayout.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/palette/internal/palettelayout.cpp b/src/palette/internal/palettelayout.cpp index 94da34de25535..cd60b74890bd2 100644 --- a/src/palette/internal/palettelayout.cpp +++ b/src/palette/internal/palettelayout.cpp @@ -87,6 +87,7 @@ #include "engraving/layout/v0/tlayout.h" #include "engraving/layout/v0/tremololayout.h" #include "engraving/layout/v0/arpeggiolayout.h" +#include "engraving/layout/v0/chordlayout.h" #include "log.h" @@ -199,9 +200,12 @@ void PaletteLayout::layoutItem(EngravingItem* item) break; case ElementType::VOLTA: layout(toVolta(item), ctx); break; + // drumset + case ElementType::CHORD: layout(toChord(item), ctx); + break; default: + LOGE() << "Not handled: " << item->typeName(); IF_ASSERT_FAILED(false) { - LOGE() << "Not handled: " << item->typeName(); layout::v0::LayoutContext ctxv0(item->score()); layout::v0::TLayout::layoutItem(item, ctxv0); } @@ -632,6 +636,12 @@ void PaletteLayout::layout(Capo* item, const Context& ctx) layoutTextBase(item, ctx); } +void PaletteLayout::layout(Chord* item, const Context& ctx) +{ + layout::v0::LayoutContext ctxv0(ctx.dontUseScore()); + layout::v0::ChordLayout::layout(item, ctxv0); +} + void PaletteLayout::layout(ChordLine* item, const Context& ctx) { item->setMag(1.0); diff --git a/src/palette/internal/palettelayout.h b/src/palette/internal/palettelayout.h index 72dbbdaf65571..a2a5c5a3c9399 100644 --- a/src/palette/internal/palettelayout.h +++ b/src/palette/internal/palettelayout.h @@ -43,6 +43,7 @@ class Bracket; class Breath; class Capo; +class Chord; class ChordLine; class Clef; @@ -157,6 +158,7 @@ class PaletteLayout static void layout(engraving::Breath* item, const Context&); static void layout(engraving::Capo* item, const Context& ctx); + static void layout(engraving::Chord* item, const Context& ctx); static void layout(engraving::ChordLine* item, const Context& ctx); static void layout(engraving::Clef* item, const Context& ctx);