Skip to content

A deep overhaul of dynamics and expression #17001

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

Merged
merged 5 commits into from
Apr 28, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified fonts/mscore/MusescoreIcon.ttf
Binary file not shown.
18 changes: 16 additions & 2 deletions src/engraving/layout/layoutsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
if (e->isDynamic()) {
Dynamic* d = toDynamic(e);
d->layout();

if (d->autoplace()) {
d->manageBarlineCollisions();
d->autoplaceSegmentElement(false);
dynamics.push_back(d);
}
Expand All @@ -970,7 +970,6 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
}

// add dynamics shape to skyline

for (Dynamic* d : dynamics) {
if (!d->addToSkyline()) {
continue;
Expand All @@ -981,6 +980,21 @@ void LayoutSystem::layoutSystemElements(const LayoutOptions& options, LayoutCont
system->staff(si)->skyline().add(d->shape().translate(d->pos() + s->pos() + m->pos()));
}

//-------------------------------------------------------------
// Expressions
// Must be done after dynamics. Remember that expressions may
// also snap into alignment with dynamics.
//-------------------------------------------------------------
for (Segment* s : sl) {
Measure* m = s->measure();
for (EngravingItem* e : s->annotations()) {
if (e->isExpression()) {
e->layout();
system->staff(e->staffIdx())->skyline().add(e->shape().translate(e->pos() + s->pos() + m->pos()));
}
}
}

//-------------------------------------------------------------
// layout SpannerSegments for current system
// voltas and tempo change lines are collected here, but laid out later
Expand Down
1 change: 1 addition & 0 deletions src/engraving/libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ EngravingItem* ChordRest::drop(EditData& data)
// fall through
case ElementType::TEMPO_TEXT:
case ElementType::DYNAMIC:
case ElementType::EXPRESSION:
case ElementType::FRET_DIAGRAM:
case ElementType::TREMOLOBAR:
case ElementType::SYMBOL:
Expand Down
Loading