-
Notifications
You must be signed in to change notification settings - Fork 831
fix: Measurement logic for native elements #21957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the measurement logic for native macOS elements in the Skia runtime. Previously, the code incorrectly retrieved dimensions from the first subview's frame, which didn't align with how other platforms handle native element measurement. The new implementation establishes a fallback hierarchy: it prioritizes availableWidth/availableHeight, then falls back to childWidth/childHeight, and finally to the element's bounds.size when other values are unavailable or invalid.
Key Changes:
- Replaced subview-based measurement with a parameter-based resolution strategy
- Added finite value checks using
isfinite()to handle infinite/NaN dimensions - Implemented fallback to element bounds when resolved dimensions are invalid
src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNONative.m
Outdated
Show resolved
Hide resolved
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21957/wasm-skia-net9/index.html |
|
|
|
The build 184972 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21957/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21957/docs/index.html |
|
The build 185359 found UI Test snapshots differences: Details
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNONative.m
Outdated
Show resolved
Hide resolved
src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNONative.m
Outdated
Show resolved
Hide resolved
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21957/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21957/wasm-skia-net9/index.html |
|
The build 185987 found UI Test snapshots differences: Details
|
GitHub Issue: closes #21810
PR Type:
What is the current behavior? 🤔
Screen.Recording.2025-11-23.at.17.01.35.mov
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other Info
https://github.com/user-attachments/files/23690767/UnoWeb.zip