-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #305487: Invisible accidentals take space #6100
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3429,10 +3429,10 @@ Shape Note::shape() const | |
Shape shape(r, name()); | ||
for (NoteDot* dot : _dots) | ||
shape.add(symBbox(SymId::augmentationDot).translated(dot->pos()), dot->name()); | ||
if (_accidental) | ||
if (_accidental && _accidental->addToSkyline()) | ||
shape.add(_accidental->bbox().translated(_accidental->pos()), _accidental->name()); | ||
for (auto e : _el) { | ||
if (e->autoplace() && e->visible()) { | ||
if (e->addToSkyline()) { | ||
if (e->isFingering() && toFingering(e)->layoutType() != ElementType::NOTE) | ||
continue; | ||
shape.add(e->bbox().translated(e->pos()), e->name()); | ||
|
@@ -3442,10 +3442,10 @@ Shape Note::shape() const | |
Shape shape(r); | ||
for (NoteDot* dot : _dots) | ||
shape.add(symBbox(SymId::augmentationDot).translated(dot->pos())); | ||
if (_accidental) | ||
if (_accidental && _accidental->addToSkyline()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, I wonder if we could lose this NDEBUG duplication? Right now it buys us some better debug info on the shapes when compiling in debug mode, without a performance penalty otherwise. But maybe there is a less error-prone way of doing that? Way too easy for these two sections of code to get out of sync. |
||
shape.add(_accidental->bbox().translated(_accidental->pos())); | ||
for (auto e : _el) { | ||
if (e->autoplace() && e->visible()) { | ||
if (e->addToSkyline()) { | ||
if (e->isFingering() && toFingering(e)->layoutType() != ElementType::NOTE) | ||
continue; | ||
shape.add(e->bbox().translated(e->pos())); | ||
|
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.
For the purpose of making sure accidentals can tuck over/under other notes, this is not needed. Which is to say, it could be visible() instead of addToSkyline(). As it is, this change means non-autoplaced accidentals can not only tuck over/under, they can also collide with previous notes. I guess that's expected, although not what I was originally thinking might be nice. I suppose it's more of a hack, though, so I'm fine leaving this as you have it. Just wanted to mention it in case it sparks any additional thoughts.