Repository navigation
fix(skia): Draw spell-check squiggly as one continuous wave per word (backport #23990) - #24247
Merged
Merged
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]> (cherry picked from commit f791a78)
1 of 4 tasks
ajpinedam
approved these changes
Aug 27, 2026
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24247/wasm-skia-net9/index.html |
Contributor
|
The build 230681 did not find any UI Test snapshots differences. |
Contributor
Author
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
This is an automatic backport of pull request #23990 done by [Mergify](https://mergify.com).