diff --git a/src/engraving/dom/note.cpp b/src/engraving/dom/note.cpp index 1a7867ad9122b..1813a36d7e825 100644 --- a/src/engraving/dom/note.cpp +++ b/src/engraving/dom/note.cpp @@ -1407,11 +1407,11 @@ void Note::updateFrettingForTiesAndBends() bool Note::shouldHideFret() const { - if (!tieBack() || shouldForceShowFret()) { + if (!tieBack() || shouldForceShowFret() || !staffType()->isTabStaff()) { return false; } - if (isContinuationOfBend()) { + if (isContinuationOfBend() && !rtick().isZero()) { return true; } diff --git a/src/engraving/rendering/dev/chordlayout.cpp b/src/engraving/rendering/dev/chordlayout.cpp index c63d619013c8a..217937ca68144 100644 --- a/src/engraving/rendering/dev/chordlayout.cpp +++ b/src/engraving/rendering/dev/chordlayout.cpp @@ -3471,7 +3471,7 @@ void ChordLayout::layoutNote2(Note* item, LayoutContext& ctx) // the tie spans a system boundary. This can't be done in layout as the system of each note is not decided yet ShowTiedFret showTiedFret = item->style().value(Sid::tabShowTiedFret).value(); bool useParens = isTabStaff && !item->fixed() && item->tieBack() - && showTiedFret != ShowTiedFret::TIE_AND_FRET && !item->shouldHideFret(); + && (showTiedFret != ShowTiedFret::TIE_AND_FRET || item->isContinuationOfBend()) && !item->shouldHideFret(); if (useParens) { if (!item->fretString().startsWith(u'(')) { // Hack: don't add parentheses if already added item->setFretString(String(u"(%1)").arg(item->fretString())); diff --git a/src/engraving/rendering/dev/slurtielayout.cpp b/src/engraving/rendering/dev/slurtielayout.cpp index d4e5d550bb6e1..042f50ef0a3b2 100644 --- a/src/engraving/rendering/dev/slurtielayout.cpp +++ b/src/engraving/rendering/dev/slurtielayout.cpp @@ -1615,24 +1615,20 @@ PointF SlurTieLayout::computeDefaultStartOrEndPoint(const Tie* tie, Grip startOr const bool up = tie->up(); const bool inside = tie->isInside(); + const bool noteIsHiddenFret = note->shouldHideFret(); const int upSign = up ? -1 : 1; const int leftRightSign = start ? +1 : -1; const double noteWidth = note->width(); const double noteHeight = note->height(); const double spatium = tie->spatium(); - double baseX, baseY = 0.0; - if (inside) { - baseX = start ? noteWidth : 0.0; - } else { - baseX = noteOpticalCenterForTie(note, up); - baseY = upSign * noteHeight / 2; - } + double baseX = (inside && !noteIsHiddenFret) ? (start ? noteWidth : 0.0) : noteOpticalCenterForTie(note, up); + double baseY = inside ? 0.0 : upSign * noteHeight / 2; result += PointF(baseX, baseY); double visualInsetSp = 0.0; - if (inside || note->headGroup() == NoteHeadGroup::HEAD_SLASH) { + if (inside || note->headGroup() == NoteHeadGroup::HEAD_SLASH || noteIsHiddenFret) { visualInsetSp = 0.2; } else if (note->hasAnotherStraightAboveOrBelow(up)) { visualInsetSp = 0.45; @@ -1719,7 +1715,7 @@ void SlurTieLayout::adjustX(TieSegment* tieSegment, SlurTiePos& sPos, Grip start Tie* tie = tieSegment->tie(); Note* note = start ? tie->startNote() : tie->endNote(); - if (!note) { + if (!note || note->shouldHideFret()) { return; } @@ -1881,7 +1877,7 @@ void SlurTieLayout::adjustY(TieSegment* tieSegment) const double halfLineThicknessCorrection = 0.5 * staffLineThickness * upSign; const double protrusion = abs(endPointY - (closestLineToEndpoints * spatium - halfLineThicknessCorrection)); - const double badIntersectionLimit = 0.20 * spatium; // TODO: style + const double badIntersectionLimit = 0.15 * spatium; // TODO: style bool badIntersection = protrusion < badIntersectionLimit && (isEndInsideStaff || isEndInsideLedgerLines); if (badIntersection) { @@ -1909,8 +1905,8 @@ void SlurTieLayout::adjustY(TieSegment* tieSegment) return; } - double outwardMargin = -upSign * (yOuterApogee - (closestLineToArc * spatium - halfLineThicknessCorrection)); - double inwardMargin = upSign * (yInnerApogee - (closestLineToArc * spatium + halfLineThicknessCorrection)); + double outwardMargin = -upSign * (yOuterApogee - (closestLineToArc * staffLineDist - halfLineThicknessCorrection)); + double inwardMargin = upSign * (yInnerApogee - (closestLineToArc * staffLineDist + halfLineThicknessCorrection)); const double badArcIntersectionLimit = tieLength < 3 * spatium ? 0.1 * spatium : 0.15 * spatium; bool increaseArc = outwardMargin - 0.5 * badArcIntersectionLimit < inwardMargin; @@ -1979,7 +1975,8 @@ bool SlurTieLayout::hasEndPointAboveNote(TieSegment* tieSegment) PointF tieStartPos = tieSegment->ups(Grip::START).pos(); PointF tieEndPos = tieSegment->ups(Grip::END).pos(); - return tieStartPos.x() < startNotePos.x() + startNote->width() || tieEndPos.x() > endNotePos.x(); + return (tieStartPos.x() < startNotePos.x() + startNote->width() && !startNote->shouldHideFret()) + || (tieEndPos.x() > endNotePos.x() && !endNote->shouldHideFret()); } void SlurTieLayout::resolveVerticalTieCollisions(const std::vector& stackedTies) diff --git a/src/engraving/rendering/dev/systemlayout.cpp b/src/engraving/rendering/dev/systemlayout.cpp index 53b48c037b348..442b6e2c9c3a9 100644 --- a/src/engraving/rendering/dev/systemlayout.cpp +++ b/src/engraving/rendering/dev/systemlayout.cpp @@ -1587,8 +1587,10 @@ void SystemLayout::layoutTies(Chord* ch, System* system, const Fraction& stick, } } } - SlurTieLayout::resolveVerticalTieCollisions(stackedForwardTies); - SlurTieLayout::resolveVerticalTieCollisions(stackedBackwardTies); + if (!ch->staffType()->isTabStaff()) { + SlurTieLayout::resolveVerticalTieCollisions(stackedForwardTies); + SlurTieLayout::resolveVerticalTieCollisions(stackedBackwardTies); + } } /**************************************************************************** diff --git a/vtest/scores/tie-16.mscz b/vtest/scores/tie-16.mscz new file mode 100644 index 0000000000000..a2b7a2393aed7 Binary files /dev/null and b/vtest/scores/tie-16.mscz differ diff --git a/vtest/scores/tie-17.mscz b/vtest/scores/tie-17.mscz new file mode 100644 index 0000000000000..4d763f5a34790 Binary files /dev/null and b/vtest/scores/tie-17.mscz differ