-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 hidden staff conditions with spanners #20846
Conversation
While at it, couldn't you also change this a few lines above? diff --git a/src/engraving/rendering/dev/systemlayout.cpp b/src/engraving/rendering/dev/systemlayout.cpp
index d8833d5e31..a6e3191af8 100644
--- a/src/engraving/rendering/dev/systemlayout.cpp
+++ b/src/engraving/rendering/dev/systemlayout.cpp
@@ -596,7 +596,7 @@ void SystemLayout::hideEmptyStaves(System* system, LayoutContext& ctx, bool isFi
Fraction stick = system->measures().front()->tick();
Fraction etick = system->measures().back()->endTick();
- auto spanners = ctx.dom().spannerMap().findOverlapping(stick.ticks(), etick.ticks() - 1);
+ auto& spanners = ctx.dom().spannerMap().findOverlapping(stick.ticks(), etick.ticks() - 1);
for (const Staff* staff : ctx.dom().staves()) {
SysStaff* ss = system->staff(staffIdx);
@@ -609,7 +609,7 @@ void SystemLayout::hideEmptyStaves(System* system, LayoutContext& ctx, bool isFi
&& !(isFirstSystem && ctx.conf().styleB(Sid::dontHideStavesInFirstSystem))
&& hideMode != Staff::HideMode::NEVER)) {
bool hideStaff = true;
- for (auto spanner : spanners) {
+ for (auto& spanner : spanners) {
if (spanner.value->staff() == staff
&& !spanner.value->systemFlag()
&& !spanner.value->isHairpin() It'd fix code warnings "'auto' doesn't deduce a reference . A possible unintended copy is being made" Also why only in ...dev/systemlayout.cpp and not also in ...stable/systemlayout.cpp? |
@@ -612,7 +612,8 @@ void SystemLayout::hideEmptyStaves(System* system, LayoutContext& ctx, bool isFi | |||
for (auto spanner : spanners) { | |||
if (spanner.value->staff() == staff | |||
&& !spanner.value->systemFlag() | |||
&& !spanner.value->isHairpin()) { | |||
&& !spanner.value->isHairpin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't that hairpin condition get dropped here?
Looking at the reasoning for having added it in #19679, which I meanwhile believe to have been wrong
3600579
to
29d5c27
Compare
@@ -596,7 +596,7 @@ void SystemLayout::hideEmptyStaves(System* system, LayoutContext& ctx, bool isFi | |||
|
|||
Fraction stick = system->measures().front()->tick(); | |||
Fraction etick = system->measures().back()->endTick(); | |||
auto spanners = ctx.dom().spannerMap().findOverlapping(stick.ticks(), etick.ticks() - 1); | |||
auto& spanners = ctx.dom().spannerMap().findOverlapping(stick.ticks(), etick.ticks() - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto&
or const SpannerMap::IntervalList&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry for having misled you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, MSVC believes it to be const
without explicitly being qualified as such
Resolves: #20782
Spanners should only make the following bar visible if the spanner is a slur.