Skip to content

Commit

Permalink
[palette] added layout for Chord
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Jul 10, 2023
1 parent 1f22c24 commit 75f4abc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/palette/internal/palettelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/palette/internal/palettelayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Bracket;
class Breath;

class Capo;
class Chord;
class ChordLine;
class Clef;

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 75f4abc

Please sign in to comment.