Skip to content

fix(skia): Draw spell-check squiggly as one continuous wave per word (backport #23990) - #24247

Merged
kazo0 merged 1 commit into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-23990
Aug 28, 2026
Merged

kazo0 merged 1 commit into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-23990

Conversation

@mergify

@mergify mergify Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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: type DomainAdmin in any spell-check-enabled TextBox).

Two defects in UnicodeText.skia.cs, both fixed:

  1. The wave was built per glyph cluster. Each cluster restarted the zigzag phase at the midline and ended with a hard LineTo back 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.

  2. 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 amplitude 1×scale / half-period 3×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 ✅


🤖 Generated with Claude Code


This is an automatic backport of pull request #23990 done by [Mergify](https://mergify.com).

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)
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Aug 27, 2026
@kazo0

kazo0 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 230681 did not find any UI Test snapshots differences.

@mergify

mergify Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@kazo0
kazo0 merged commit b29bcd1 into release/stable/6.7 Aug 28, 2026
48 checks passed
@kazo0
kazo0 deleted the mergify/bp/release/stable/6.7/pr-23990 branch August 28, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants