Skip to content

Commit 6b5bbad

Browse files
mike-spaJojo-Schmitz
authored andcommitted
Clear big time sigs not shown
1 parent 1d1764c commit 6b5bbad

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/engraving/rendering/score/systemlayout.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ System* SystemLayout::collectSystem(LayoutContext& ctx)
420420
HorizontalSpacing::justifySystem(system, curSysWidth, targetSystemWidth);
421421
}
422422

423+
clearBigTimeSigNotShown(system, ctx);
424+
423425
// LAYOUT MEASURES
424426
bool createBrackets = false;
425427
for (MeasureBase* mb : system->measures()) {
@@ -872,6 +874,33 @@ void SystemLayout::updateTimeSigAboveStavesXPos(System* system, LayoutContext& c
872874
}
873875
}
874876

877+
void SystemLayout::clearBigTimeSigNotShown(System* system, LayoutContext& ctx)
878+
{
879+
if (ctx.conf().styleV(Sid::timeSigPlacement).value<TimeSigPlacement>() == TimeSigPlacement::NORMAL) {
880+
return;
881+
}
882+
883+
for (MeasureBase* mb : system->measures()) {
884+
if (!mb->isMeasure()) {
885+
continue;
886+
}
887+
for (Segment& seg : toMeasure(mb)->segments()) {
888+
if (!seg.isType(SegmentType::TimeSigType)) {
889+
continue;
890+
}
891+
for (staff_idx_t staffIdx = 0; staffIdx < ctx.dom().nstaves(); ++staffIdx) {
892+
TimeSig* ts = toTimeSig(seg.element(staff2track(staffIdx)));
893+
if (!ts) {
894+
continue;
895+
}
896+
if (!ts->showOnThisStaff() || ts->effectiveStaffIdx() == muse::nidx) {
897+
ts->mutldata()->reset(); // Deletes shape
898+
}
899+
}
900+
}
901+
}
902+
}
903+
875904
void SystemLayout::layoutSticking(const std::vector<Sticking*> stickings, System* system, LayoutContext& ctx)
876905
{
877906
if (stickings.empty()) {

src/engraving/rendering/score/systemlayout.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class SystemLayout
203203
static bool shouldBeJustified(System* system, double curSysWidth, double targetSystemWidth, LayoutContext& ctx);
204204

205205
static void updateTimeSigAboveStavesXPos(System* system, LayoutContext& ctx);
206+
static void clearBigTimeSigNotShown(System* system, LayoutContext& ctx);
206207

207208
static void layoutSticking(const std::vector<Sticking*> stickings, System* system, LayoutContext& ctx);
208209

0 commit comments

Comments
 (0)