Repository navigation
fix(skia): Draw spell-check squiggly as one continuous wave per word - #23990
Conversation
The squiggly underline path was built per glyph cluster: each cluster restarted the wave phase at the midline and ended with a hard LineTo back to the midline at the cluster's right edge. Since cluster widths are not multiples of the wave step, this rendered as an irregular scribble with flat gaps under narrow glyphs instead of a regular wave. The cluster loop now only widens the underline span of the word the cluster belongs to, keyed by (word, line, font scale) so a word that wraps or switches fonts mid-word still gets a coherent wave per span. After the loop, each span is drawn as a single phase-continuous zigzag whose trailing partial half-wave is truncated by interpolation instead of snapping to the midline. The wave band is also sized and clamped to fit above y + lineHeight (where the text visual clips): the previous metrics extended below the font descent, which cut off the wave's lower vertices and rendered the continuous wave as disconnected peaks. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23990/wasm-skia-net9/index.html |
|
The build 226161 found UI Test snapshots differences: Details
|
|
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23990/wasm-skia-net9/index.html |
|
The build 226731 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
@Mergifyio backport release/stable/6.7 |
✅ Backports have been createdDetails
|
…6.7/pr-23990 fix(skia): Draw spell-check squiggly as one continuous wave per word (backport #23990)
…23990 unoplatform#23990 strokes the squiggly with round joins and caps; the neutral port handed it to StrokePath, which implies flat caps and miter joins. Ported by widening the path with round caps/joins and filling it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
GitHub Issue: closes unoplatform/kahua-private#533
PR Type:
🐞 Bugfix
What changed? 🚀
With
IsSpellCheckEnabled="True"on Skia targets, the squiggly underline rendered as an irregular scribble instead of a regular wave (see the linked issue's screenshots — repro: typeDomainAdminin any spell-check-enabledTextBox).Two defects in
UnicodeText.skia.cs, both fixed:The wave was built per glyph cluster. Each cluster restarted the zigzag phase at the midline and ended with a hard
LineToback to the midline at its right edge. Cluster widths are not multiples of the wave step, so every character contributed a phase-reset mini-scribble with a snap-back, and clusters narrower than one step (i,l) drew a flat line. The cluster loop now only widens the underline span of the word the cluster belongs to (keyed by word / line / font scale, so a word wrapping lines or switching fonts via fallback still gets a coherent wave per span), and each span is drawn after the loop as a single phase-continuous zigzag whose trailing partial half-wave is truncated by interpolation instead of snapping to the midline.The wave band extended below the font's descent. The text visual clips at
y + lineHeight, so the wave's lower vertices were cut off, rendering a continuous wave as disconnected peaks (invisible before this PR because the per-cluster paths rarely drew true bottom vertices). The wave is now amplitude1×scale/ half-period3×scale(proportionally matching the WinUI native squiggly) and its midline is clamped so the whole band including the stroke stays above the line bottom. Stroke joins/caps are round so peaks render as wave crests rather than miter spikes.Verified in the Kahua desktop app (Skia,
net10.0-desktop) by pixel-mapping the rendered underline: connected uniform wave, correct period, nothing clipped.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code