Skip to content

Commit

Permalink
Fix #318326 - System Text Line missing in existing parts when added v…
Browse files Browse the repository at this point in the history
…ia drag&drop to non-top staff

If a TEXTLINE is dropped in a ScoreView, set firstStaffOnly to true if the dropped textline is a System TextLine.
  • Loading branch information
njvdberg authored and vpereverzev committed Apr 2, 2021
1 parent dfc2762 commit f2ef9ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/notation/internal/notationinteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,12 @@ bool NotationInteraction::drop(const QPointF& pos, Qt::KeyboardModifiers modifie
startEdit();
score()->addRefresh(m_dropData.ed.dropElement->canvasBoundingRect());
switch (m_dropData.ed.dropElement->type()) {
case ElementType::TEXTLINE:
firstStaffOnly = m_dropData.ed.dropElement->systemFlag();
// fall-thru
case ElementType::VOLTA:
// voltas drop to first staff by default, or closest staff if Control is held
firstStaffOnly = !(m_dropData.ed.modifiers & Qt::ControlModifier);
firstStaffOnly = firstStaffOnly || !(m_dropData.ed.modifiers & Qt::ControlModifier);
// fall-thru
case ElementType::OTTAVA:
case ElementType::TRILL:
Expand All @@ -774,7 +777,6 @@ bool NotationInteraction::drop(const QPointF& pos, Qt::KeyboardModifiers modifie
case ElementType::VIBRATO:
case ElementType::PALM_MUTE:
case ElementType::HAIRPIN:
case ElementType::TEXTLINE:
{
Ms::Spanner* spanner = ptr::checked_cast<Ms::Spanner>(m_dropData.ed.dropElement);
score()->cmdAddSpanner(spanner, pos, firstStaffOnly);
Expand Down

0 comments on commit f2ef9ec

Please sign in to comment.