Skip to content

Commit

Permalink
Merge pull request musescore#18551 from alexpavlov96/palette_stafftyp…
Browse files Browse the repository at this point in the history
…echange_layout
  • Loading branch information
alexpavlov96 committed Jul 12, 2023
2 parents 588f6e5 + fb8acc5 commit e588e44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/palette/internal/palettelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "engraving/libmscore/rehearsalmark.h"
#include "engraving/libmscore/slur.h"
#include "engraving/libmscore/stafftext.h"
#include "engraving/libmscore/stafftypechange.h"
#include "engraving/libmscore/symbol.h"
#include "engraving/libmscore/systemtext.h"
#include "engraving/libmscore/tempotext.h"
Expand Down Expand Up @@ -180,6 +181,8 @@ void PaletteLayout::layoutItem(EngravingItem* item)
break;
case ElementType::STAFF_TEXT: layout(toStaffText(item), ctx);
break;
case ElementType::STAFFTYPE_CHANGE: layout(toStaffTypeChange(item), ctx);
break;
case ElementType::SYMBOL: layout(toSymbol(item), ctx);
break;
case ElementType::SYSTEM_TEXT: layout(toSystemText(item), ctx);
Expand Down Expand Up @@ -1257,6 +1260,13 @@ void PaletteLayout::layout(StaffText* item, const Context& ctx)
layoutTextBase(item, ctx);
}

void PaletteLayout::layout(StaffTypeChange* item, const Context& ctx)
{
double spatium = ctx.style().spatium();
item->setbbox(RectF(-item->lw() * .5, -item->lw() * .5, spatium * 2.5 + item->lw(), spatium * 2.5 + item->lw()));
item->setPos(0.0, 0.0);
}

void PaletteLayout::layout(Symbol* item, const Context&)
{
item->setbbox(item->scoreFont() ? item->scoreFont()->bbox(item->sym(), item->magS()) : item->symBbox(item->sym()));
Expand Down
1 change: 1 addition & 0 deletions src/palette/internal/palettelayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class PaletteLayout
static void layout(engraving::Slur* item, const Context& ctx);
static void layout(engraving::Spacer* item, const Context&);
static void layout(engraving::StaffText* item, const Context& ctx);
static void layout(engraving::StaffTypeChange* item, const Context& ctx);
static void layout(engraving::Symbol* item, const Context& ctx);
static void layout(engraving::SystemText* item, const Context& ctx);

Expand Down

0 comments on commit e588e44

Please sign in to comment.