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

fix #315636: no space between barline and note with invisible key or time signature #7328

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4429,13 +4429,21 @@ void Measure::computeMinWidth(Segment* s, qreal x, bool isSystemHeader)

while (s) {
s->rxpos() = x;
if (!s->enabled() || !s->visible() || s->allElementsInvisible()) {
// skip disabled / invisible segments
// segments with all elements invisible are skipped,
// but only for headers or segments later in the measure -
// invisible key or time signatures at the beginning of non-header measures are treated normally here
// otherwise we would not allocate enough space for the first note
// as it is, this isn't quite right as the space will be given by key or time margins,
// not the bar to note distance
// TODO: skip these segments entirely and get the correct bar to note distance
if (!s->enabled() || !s->visible() || ((header() || s->rtick().isNotZero()) && s->allElementsInvisible())) {
s->setWidth(0);
s = s->next();
continue;
}
Segment* ns = s->nextActive();
while (ns && ns->allElementsInvisible())
while (ns && ((header() || ns->rtick().isNotZero()) && ns->allElementsInvisible()))
ns = ns->nextActive();
// end barline might be disabled
// but still consider it for spacing of previous segment
Expand Down Expand Up @@ -4517,6 +4525,9 @@ void Measure::computeMinWidth()
//
// skip disabled segment
//
// TODO: skip segments with all elements invisible also
// this will eventually allow us to calculate correct bar to note distance
// even if there is an invisible key or time signature present
for (s = first(); s && !s->enabled(); s = s->next()) {
s->rxpos() = 0;
s->setWidth(0);
Expand Down