Skip to content

Commit

Permalink
Merge pull request #27017 from mike-spa/fixDynamicsEndOfDuration
Browse files Browse the repository at this point in the history
Fix attach dynamic to end of duration
  • Loading branch information
mike-spa authored Mar 11, 2025
2 parents 9f0151f + 89bfa3f commit 8a66e6d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/engraving/dom/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,10 @@ EngravingItem* Segment::firstInNextSegments(staff_idx_t activeStaff) const

EngravingItem* Segment::firstElementOfSegment(staff_idx_t activeStaff) const
{
if (isTimeTickType()) {
return nullptr;
}

for (auto i: m_elist) {
if (i && i->staffIdx() == activeStaff) {
if (i->isDurationElement()) {
Expand Down Expand Up @@ -1853,6 +1857,10 @@ EngravingItem* Segment::prevElementOfSegment(EngravingItem* e, staff_idx_t activ

EngravingItem* Segment::lastElementOfSegment(staff_idx_t activeStaff) const
{
if (isTimeTickType()) {
return nullptr;
}

const std::vector<EngravingItem*>& elements = m_elist;
for (auto it = elements.rbegin(); it != elements.rend(); ++it) {
EngravingItem* item = *it;
Expand Down Expand Up @@ -2173,6 +2181,10 @@ EngravingItem* Segment::prevElement(staff_idx_t activeStaff)
return lastEl;
}
}
if (isTimeTickType()) {
Segment* prevSeg = prev1MMenabled();
return prevSeg ? prevSeg->lastElementOfSegment(activeStaff) : nullptr;
}
track_idx_t track = score()->nstaves() * VOICES - 1;
Segment* s = this;
EngravingItem* el = s->element(track);
Expand Down
4 changes: 3 additions & 1 deletion src/engraving/dom/textbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3364,7 +3364,9 @@ bool TextBase::isNonTextualEditAllowed(EditData& ed) const
Key_Down
};

return muse::contains(ARROW_KEYS, static_cast<KeyboardKey>(ed.key)) && !(ed.modifiers & AltModifier);
bool altKeyWithoutShift = (ed.modifiers & AltModifier) && !(ed.modifiers & ShiftModifier);

return muse::contains(ARROW_KEYS, static_cast<KeyboardKey>(ed.key)) && !altKeyWithoutShift;
}

void TextBase::checkMeasureBoundariesAndMoveIfNeed()
Expand Down

0 comments on commit 8a66e6d

Please sign in to comment.