Skip to content

Commit

Permalink
Merge pull request #19358 from miiizen/16426-timesig-skyline
Browse files Browse the repository at this point in the history
Add time signatures to skyline
  • Loading branch information
RomanPudashkin committed Sep 11, 2023
2 parents 22531d1 + 0c857d9 commit 6a4f730
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/engraving/rendering/dev/systemlayout.cpp
Expand Up @@ -49,6 +49,7 @@
#include "dom/stafflines.h"
#include "dom/system.h"
#include "dom/tie.h"
#include "dom/timesig.h"
#include "dom/tremolo.h"
#include "dom/tuplet.h"
#include "dom/volta.h"
Expand Down Expand Up @@ -780,7 +781,7 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
ss->skyline().add(m->staffLines(staffIdx)->layoutData()->bbox().translated(m->pos()));
}
for (Segment& s : m->segments()) {
if (!s.enabled() || s.isTimeSigType()) { // hack: ignore time signatures
if (!s.enabled()) {
continue;
}
PointF p(s.pos() + m->pos());
Expand All @@ -791,6 +792,11 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
RectF r = TLayout::layoutRect(bl, ctx);
skyline.add(r.translated(bl->pos() + p));
}
} else if (s.segmentType() & SegmentType::TimeSig) {
TimeSig* ts = toTimeSig(s.element(staffIdx * VOICES));
if (ts && ts->addToSkyline()) {
skyline.add(ts->shape().translate(ts->pos() + p));
}
} else {
track_idx_t strack = staffIdx * VOICES;
track_idx_t etrack = strack + VOICES;
Expand Down
Binary file added vtest/scores/timesig-1.mscz
Binary file not shown.

0 comments on commit 6a4f730

Please sign in to comment.