Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time signatures to skyline #19358

Merged
merged 1 commit into from Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.