Skip to content

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

Merged
ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/fix.spellcheck-squiggly
Aug 10, 2026
Merged

ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/fix.spellcheck-squiggly

Conversation

@ramezgerges

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

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]>
Copilot AI lite review requested due to automatic review settings August 6, 2026 16:14
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Aug 6, 2026
@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 226161 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
  • skia-windows-screenshots: 2348 changed over 2394

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonWithIconTest.png
    • AppBar_KeyBoard.png-dark
    • AndroidWindowInsets.png
    • AutoBorderStretchwithtopmargin.png-dark
    • AppWindowClosing.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • ArcSegment.png
    • AutoBorderStretchwithbottommargin.png
    • BadgeNotificationTests.png-dark
    • AutomationPropertiesExtensions_Role.png
    • AutoSizedPathCentered.png
    • Basics Pivot Test.png
    • AutoSuggestBox_Icons.png
    • AutoSuggestBox_SoftKeboard.png
    • Battery.png
    • Basics.png-dark
    • Basics_Automated.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BitmapIcon_Foreground.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Uno_Web.Http.CookieManagerTests
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 226161 has failed on Uno.UI - CI.

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/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 226731 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2348, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Examples.png-dark
    • Examples.png
    • ImageIconPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • skia-windows-screenshots: 2348 changed over 2394

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBarButtonTest.png
    • ApplicationViewSpanningRectsPage.png
    • AutoBorderStretchwithbottommargin.png-dark
    • AutomationProperties_Name.png-dark
    • AutoSuggestBox_Keyboard.png
    • BasicAutoSuggestBox.png-dark
    • Battery.png-dark
    • BezierSegment.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderBottomwithmargins.png-dark
    • Border_Clipped_Change_Property.png-dark
    • Border_Clipped_Change_Property.png
    • Border_Simple_No_Background.png
    • Border_Simple_No_Background_With_Content_Border_With_Background.png-dark
    • Brushes_ImplicitConvert.png-dark
    • Brushes_ImplicitConvert.png
    • CalendarDatePicker_Basics.png-dark
    • CalendarDatePicker_Basics.png
    • ChatBox.png-dark
    • ChatBox.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

  • Queue this pull request

@ramezgerges
ramezgerges merged commit 9c53616 into unoplatform:master Aug 10, 2026
60 of 65 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/fix.spellcheck-squiggly branch August 10, 2026 19:42
@ajpinedam

Copy link
Copy Markdown
Contributor

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

kazo0 added a commit that referenced this pull request Aug 28, 2026
…6.7/pr-23990

fix(skia): Draw spell-check squiggly as one continuous wave per word (backport #23990)
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
…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
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