Skip to content
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
4 changes: 2 additions & 2 deletions src/engraving/dom/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/dev/chordlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ShowTiedFret>();
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()));
Expand Down
23 changes: 10 additions & 13 deletions src/engraving/rendering/dev/slurtielayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<TieSegment*>& stackedTies)
Expand Down
6 changes: 4 additions & 2 deletions src/engraving/rendering/dev/systemlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/****************************************************************************
Expand Down
Binary file added vtest/scores/tie-16.mscz
Binary file not shown.
Binary file added vtest/scores/tie-17.mscz
Binary file not shown.