Skip to content
Open
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
16 changes: 13 additions & 3 deletions src/engraving/rendering/score/slurtielayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,10 @@ void SlurTieLayout::computeBezier(TieSegment* tieSeg, PointF shoulderOffset)

computeMidThickness(tieSeg, tieLengthInSp);

PointF tieThickness(0.0, tieSeg->ldata()->midThickness());
PointF tieThickness(0.0, 0.0);
if (tieSeg->tie()->styleType() == SlurStyleType::Solid) {
tieThickness.setY(tieSeg->ldata()->midThickness());
}

const PointF bezier1Offset = t.map(tieSeg->ups(Grip::BEZIER1).off);
const PointF bezier2Offset = t.map(tieSeg->ups(Grip::BEZIER2).off);
Expand Down Expand Up @@ -2843,7 +2846,11 @@ void SlurTieLayout::computeBezier(SlurSegment* slurSeg, PointF shoulderOffset)

// Set slur thickness
computeMidThickness(slurSeg, p2.x() / slurSeg->spatium());
PointF thick(0.0, slurSeg->ldata()->midThickness());

PointF thick(0.0, 0.0);
if (slurSeg->slur()->styleType() == SlurStyleType::Solid) {
thick.setY(slurSeg->ldata()->midThickness());
}

// Set path
PainterPath path = PainterPath();
Expand Down Expand Up @@ -3216,7 +3223,10 @@ void SlurTieLayout::fillShape(SlurTieSegment* slurTieSeg, double slurTieLengthIn
double percent = pow(sin(0.5 * M_PI * (double(i) / double(nbShapes))), 2);
const PointF point = b.pointAtPercent(percent);
RectF re = RectF(startPoint, point).normalized();
double approxThicknessAtPercent = (1 - 2 * std::abs(0.5 - percent)) * midThickness;
double approxThicknessAtPercent = midThickness;
if (slurTieSeg->slurTie()->styleType() == SlurStyleType::Solid) {
approxThicknessAtPercent *= (1 - 2 * std::abs(0.5 - percent));
}
Comment on lines +3226 to +3229
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Paint-time width sources for non-solid slur/tie styles
rg -n -C3 --type=cpp 'SlurStyleType::(Dotted|Dashed|WideDashed)|Sid::slurDottedWidth|Sid::slurWideDashedWidth' src/engraving

# 2) Layout-time thickness source in this change
rg -n -C3 --type=cpp 'approxThicknessAtPercent|midThickness|styleType\(\) == SlurStyleType::Solid' src/engraving/rendering/score/slurtielayout.cpp

# 3) Style/UI plumbing: confirm whether global slur/tie thickness updates dotted/wide-dashed widths too
rg -n -C3 --type=cpp --type=h 'slur.*thickness|tie.*thickness|Sid::slurMidWidth|Sid::slurEndWidth|Sid::slurDottedWidth|Sid::slurWideDashedWidth' src

Repository: musescore/MuseScore

Length of output: 21169


🏁 Script executed:

#!/bin/bash
# 1. Find computeMidThickness implementation
rg -n -A20 'void.*computeMidThickness\(' src/engraving/rendering/score/slurtielayout.cpp

# 2. Check if slurDottedWidth is consulted during layout
rg -n 'slurDottedWidth|Sid::slurDottedWidth' src/engraving/rendering/score/slurtielayout.cpp

# 3. Check style change invalidation for slurs
rg -n 'onStyleChanged|invalidate' src/engraving/dom/slur.cpp | head -20

Repository: musescore/MuseScore

Length of output: 1322


🏁 Script executed:

#!/bin/bash
# 1. Check if slurs are invalidated when style changes
rg -n -B5 -A10 'onStyleChanged' src/engraving/dom/slur.cpp

# 2. Check if slurDottedWidth is initialized/coupled anywhere
rg -n 'slurDottedWidth' src/engraving/style/style.cpp | head -20

# 3. Verify whether shape is recalculated on style change
rg -n 'updateLayout|invalidateLayout' src/engraving/dom/slurtie.h
rg -n 'styleChanged' src/engraving/dom/slurtie.h

Repository: musescore/MuseScore

Length of output: 231


🏁 Script executed:

#!/bin/bash
# 1. Check SlurTieSegment class - find where midThickness is used/initialized
rg -n 'midThickness' src/engraving/dom/slurtie.h

# 2. Check if there's any special handling for non-solid in layout
rg -n -B5 -A5 'styleType.*Solid' src/engraving/rendering/score/slurtielayout.cpp

# 3. Verify if slurDottedWidth should affect collision box
rg -n 'collision|Shape|bbox' src/engraving/rendering/score/slurtielayout.cpp | grep -A2 -B2 '3216\|3225\|3230'

Repository: musescore/MuseScore

Length of output: 2459


🏁 Script executed:

#!/bin/bash
# 1. Check endWidth() and midWidth() implementations
rg -n -A3 'endWidth\(\)|midWidth\(\)' src/engraving/dom/slur.cpp

# 2. Check if slurMidWidth or slurEndWidth have any relationship to slurDottedWidth
rg -n 'slurMidWidth|slurEndWidth' src/engraving/style/style.cpp

# 3. Check git history or comments about non-solid style width handling
rg -n 'non-solid|dotted.*width|dashed.*width' src/engraving/rendering/score/slurtielayout.cpp

Repository: musescore/MuseScore

Length of output: 601


🏁 Script executed:

#!/bin/bash
# 1. Search for any comments or documentation about non-solid width handling
rg -n -B3 'Dotted|Dashed|WideDashed' src/engraving/rendering/score/slurtielayout.cpp

# 2. Check if slurDottedWidth is supposed to be synced with slurMidWidth
rg -n 'slurDottedWidth.*slurMidWidth|slurMidWidth.*slurDottedWidth' src

# 3. Look at default style values to see if they're related
rg -n 'Sid::slurMidWidth|Sid::slurDottedWidth' src/engraving/style/styledef.cpp

Repository: musescore/MuseScore

Length of output: 45


🏁 Script executed:

#!/bin/bash
# 1. Find where style defaults are defined
fd -type f 'styledef\|stylev2\|style.*default' src/engraving/style/

# 2. Search for any initialization of slurDottedWidth to understand its purpose
rg -n 'slurDottedWidth' src/engraving/style/

# 3. Check if there's any comment about width differences between solid and non-solid
rg -n -B10 'fillShape' src/engraving/rendering/score/slurtielayout.cpp | head -30

Repository: musescore/MuseScore

Length of output: 1841


🏁 Script executed:

#!/bin/bash
# 1. Check the default values of slurMidWidth and slurDottedWidth
rg -n 'styleDef.*slurMidWidth|styleDef.*slurDottedWidth' src/engraving/style/styledef.cpp

# 2. Look at the actual fillShape implementation to confirm it uses midThickness
rg -n -A25 'void SlurTieLayout::fillShape' src/engraving/rendering/score/slurtielayout.cpp

# 3. Check if there's any relationship or coupling in other files
rg -n 'slurDottedWidth|slurMidWidth' src/engraving/ | grep -E '(couple|sync|relation|same)'

Repository: musescore/MuseScore

Length of output: 1601


Non-solid slur/tie collision shape uses wrong width source.

The shape collision box for non-solid styles (Dotted/Dashed/WideDashed) is based on midThickness (computed from Sid::slurMidWidth, default 0.21 sp), while the paint-time stroke uses Sid::slurDottedWidth (default 0.10 sp). These are independent style values with no synchronization. Updating one does not update the other, causing collision geometry and visible width to diverge.

Solid slurs are unaffected because both shape and paint derive from the same midWidth value.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/engraving/rendering/score/slurtielayout.cpp` around lines 3226 - 3229,
The collision-width calculation currently always uses midThickness (derived from
Sid::slurMidWidth) even for non-solid slur styles; change the logic in the block
around approxThicknessAtPercent so that when slurTieSeg->slurTie()->styleType()
is not Solid you derive the base width from Sid::slurDottedWidth (the same style
value used at paint time) instead of midThickness, then apply the same
percent-based tapering; keep using midThickness only for Solid styles so
collision geometry matches visible stroke width.

if (re.height() < approxThicknessAtPercent) {
double adjust = (approxThicknessAtPercent - re.height()) * .5;
re.adjust(0.0, -adjust, 0.0, adjust);
Expand Down
Loading