Skip to content

Fix some issues with rounded borders#16051

Merged
acoates-ms merged 3 commits intomicrosoft:mainfrom
acoates-ms:borderradiiflip
Apr 25, 2026
Merged

Fix some issues with rounded borders#16051
acoates-ms merged 3 commits intomicrosoft:mainfrom
acoates-ms:borderradiiflip

Conversation

@acoates-ms
Copy link
Copy Markdown
Contributor

@acoates-ms acoates-ms commented Apr 24, 2026

Description

The pixelRoundBorderRadii function was accidentally swapping horizontal and vertical border radius. Then the code in DrawAllBorderLayers flipped the uses of the x and y radii to accommodate the flip from pixelRoundBorderRadii. And GenerateRoundedPathParameters was doing some extra work to keep things in bounds from the incorrect numbers caused by the flip.

All of the above would cause issues when using percent-based corner radii on non-square views. Which should be fixed by this change.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
Microsoft Reviewers: Open in CodeFlow

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Performance Test Results

Branch: borderradiiflip
Commit: a5341d95
Time: 2026-04-25T18:41:25.642Z
Tests: 161/161 passed

✅ Passed

161 scenario(s) across 28 suite(s) — no regressions

SectionList

Scenario Mean Median StdDev Renders vs Baseline
SectionList mount 3.40ms 3.00ms ±1.35ms 1 -40.0%
SectionList unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
SectionList rerender 8.70ms 7.50ms ±2.71ms 2 -28.6%
SectionList with-3-sections-15-items 4.70ms 4.50ms ±1.83ms 1 -18.2%
SectionList with-5-sections-50-items 4.40ms 4.00ms ±0.97ms 1 -33.3%
SectionList with-10-sections-200-items 4.80ms 5.00ms ±1.23ms 1 -9.1%
SectionList with-20-sections-200-items 4.50ms 4.00ms ±1.18ms 1 -20.0%
SectionList with-section-separator 3.60ms 4.00ms ±0.52ms 1 +100.0%
SectionList with-item-separator 5.00ms 5.00ms ±1.89ms 1 +150.0%
SectionList with-header-footer 1.70ms 2.00ms ±0.67ms 1 +0.0%
SectionList with-section-footer 1.80ms 1.00ms ±1.55ms 1 -50.0%
SectionList with-sticky-section-headers 1.30ms 1.00ms ±0.48ms 1 -50.0%
SectionList with-empty-list 0.20ms 0.00ms ±0.42ms 1 -100.0%
SectionList with-50-sections-1000-items 1.60ms 1.00ms ±1.26ms 1 -50.0%

FlatList

Scenario Mean Median StdDev Renders vs Baseline
FlatList mount 3.10ms 3.00ms ±0.32ms 1 -25.0%
FlatList unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
FlatList rerender 7.10ms 6.50ms ±1.60ms 2 -27.8%
FlatList with-10-items 3.20ms 3.00ms ±0.42ms 1 -25.0%
FlatList with-100-items 3.30ms 3.00ms ±0.67ms 1 -40.0%
FlatList with-500-items 3.10ms 3.00ms ±0.74ms 1 -25.0%
FlatList with-1000-items 4.00ms 4.00ms ±0.94ms 1 +0.0%
FlatList horizontal 2.70ms 3.00ms ±0.82ms 1 -40.0%
FlatList with-separator 1.30ms 1.00ms ±0.48ms 1 -50.0%
FlatList with-header-footer 1.00ms 1.00ms ±0.00ms 1 -50.0%
FlatList with-empty-list 0.20ms 0.00ms ±0.42ms 1 -100.0%
FlatList with-get-item-layout 1.00ms 1.00ms ±0.00ms 1 +0.0%
FlatList inverted 1.30ms 1.00ms ±0.48ms 1 -33.3%
FlatList with-num-columns 5.20ms 3.00ms ±7.36ms 1 +0.0%

TouchableOpacity

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity mount 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableOpacity unmount 0.50ms 0.50ms ±0.53ms 0 +Infinity%
TouchableOpacity rerender 1.30ms 1.00ms ±1.42ms 2 +0.0%
TouchableOpacity custom-active-opacity 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity disabled 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity with-all-handlers 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity with-hit-slop 0.60ms 0.50ms ±0.70ms 1 -50.0%
TouchableOpacity with-delay 0.80ms 1.00ms ±0.63ms 1 +0.0%
TouchableOpacity nested 1.30ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity multiple-10 5.80ms 5.00ms ±3.14ms 1 -16.7%
TouchableOpacity multiple-50 20.47ms 20.00ms ±3.62ms 1 -31.0%
TouchableOpacity multiple-100 31.40ms 33.00ms ±6.90ms 1 -34.0%

ScrollView

Scenario Mean Median StdDev Renders vs Baseline
ScrollView mount 0.60ms 0.00ms ±1.26ms 1 +0.0%
ScrollView unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ScrollView rerender 0.50ms 0.50ms ±0.53ms 2 -50.0%
ScrollView children-20 2.20ms 2.00ms ±0.56ms 1 -50.0%
ScrollView children-100 12.47ms 11.00ms ±2.95ms 1 -31.3%
ScrollView horizontal 2.40ms 2.00ms ±0.70ms 1 -50.0%
ScrollView sticky-headers 2.30ms 2.00ms ±0.82ms 1 -33.3%
ScrollView scroll-indicators 1.00ms 1.00ms ±0.00ms 1 +0.0%
ScrollView nested 1.10ms 1.00ms ±0.57ms 1 +0.0%
ScrollView content-container-style 0.70ms 1.00ms ±0.48ms 1 +0.0%
ScrollView children-500 17.07ms 17.00ms ±4.11ms 1 -10.5%

TouchableHighlight

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight mount 0.40ms 0.00ms ±0.52ms 1 -100.0%
TouchableHighlight unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableHighlight rerender 0.20ms 0.00ms ±0.42ms 2 -100.0%
TouchableHighlight custom-underlay-color 0.40ms 0.00ms ±0.52ms 1 +0.0%
TouchableHighlight custom-active-opacity 0.70ms 0.00ms ±1.25ms 1 +0.0%
TouchableHighlight disabled 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight with-all-handlers 0.20ms 0.00ms ±0.42ms 1 +0.0%
TouchableHighlight with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight nested-touchables 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableHighlight multiple-touchables-10 1.80ms 2.00ms ±0.42ms 1 -33.3%
TouchableHighlight multiple-touchables-50 9.20ms 9.00ms ±2.10ms 1 -28.0%
TouchableHighlight multiple-touchables-100 17.50ms 17.50ms ±2.72ms 1 -22.2%

Pressable

Scenario Mean Median StdDev Renders vs Baseline
Pressable mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Pressable rerender 0.30ms 0.00ms ±0.48ms 2 -100.0%
Pressable with-all-handlers 0.50ms 0.50ms ±0.53ms 1 +Infinity%
Pressable with-style-function 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable disabled 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable nested 0.50ms 0.50ms ±0.53ms 1 -50.0%
Pressable multiple-10 2.40ms 2.00ms ±1.12ms 1 -33.3%
Pressable multiple-50 11.33ms 11.00ms ±1.84ms 1 -21.4%
Pressable multiple-100 12.73ms 9.00ms ±8.71ms 1 -25.0%

Modal

Scenario Mean Median StdDev Renders vs Baseline
Modal mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Modal rerender 0.50ms 0.50ms ±0.53ms 2 +Infinity%
Modal slide-animation 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal fade-animation 0.10ms 0.00ms ±0.32ms 1 +0.0%
Modal transparent 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal with-callbacks 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal rich-content 1.10ms 1.00ms ±0.32ms 1 -50.0%
Modal with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%

Image

Scenario Mean Median StdDev Renders vs Baseline
Image mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Image rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
Image with-resize-mode 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-border-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-tint-color 0.00ms 0.00ms ±0.00ms 1 +0.0%
Image with-blur-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image multiple-10 0.60ms 1.00ms ±0.51ms 1 +0.0%
Image multiple-50 2.40ms 2.00ms ±0.51ms 1 -33.3%
Image multiple-100 5.60ms 6.00ms ±0.99ms 1 -25.0%

ActivityIndicator

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ActivityIndicator rerender 0.00ms 0.00ms ±0.00ms 2 +0.0%
ActivityIndicator size-large 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator size-small 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator with-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator not-animating 0.00ms 0.00ms ±0.00ms 1 +0.0%
ActivityIndicator with-accessibility 0.00ms 0.00ms ±0.00ms 1 +0.0%
ActivityIndicator multiple-10 0.60ms 1.00ms ±0.51ms 1 +0.0%
ActivityIndicator multiple-50 2.80ms 3.00ms ±0.77ms 1 -25.0%
ActivityIndicator multiple-100 5.40ms 5.00ms ±0.63ms 1 -28.6%

Switch

Scenario Mean Median StdDev Renders vs Baseline
Switch mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Switch rerender 0.30ms 0.00ms ±0.48ms 2 -100.0%
Switch value-true 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch disabled 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch custom-colors 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch on-value-change 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch multiple-10 1.20ms 1.00ms ±0.77ms 1 -50.0%
Switch multiple-50 6.20ms 5.00ms ±1.90ms 1 -44.4%
Switch multiple-100 13.07ms 11.00ms ±3.01ms 1 -31.3%

Button

Scenario Mean Median StdDev Renders vs Baseline
Button mount 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Button rerender 1.00ms 1.00ms ±0.47ms 2 +0.0%
Button disabled 0.80ms 1.00ms ±0.92ms 1 +0.0%
Button with-color 0.30ms 0.00ms ±0.48ms 1 -100.0%
Button with-accessibility 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button multiple-10 3.87ms 4.00ms ±1.13ms 1 -33.3%
Button multiple-50 14.13ms 16.00ms ±6.19ms 1 -40.7%
Button multiple-100 10.73ms 10.00ms ±1.71ms 1 -47.4%

TextInput

Scenario Mean Median StdDev Renders vs Baseline
TextInput mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TextInput rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
TextInput multiline 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput with-value 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput styled 0.00ms 0.00ms ±0.00ms 1 +0.0%
TextInput multiple-100 5.40ms 5.00ms ±1.18ms 1 -28.6%

View

Scenario Mean Median StdDev Renders vs Baseline
View mount 0.00ms 0.00ms ±0.00ms 1 +0.0%
View unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
View rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
View nested-50 2.40ms 2.00ms ±0.83ms 1 -33.3%
View nested-100 5.33ms 5.00ms ±0.72ms 1 -28.6%
View shadow 0.10ms 0.00ms ±0.32ms 1 +0.0%
View border-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
View nested-500 12.53ms 8.00ms ±8.73ms 1 -20.0%

Text

Scenario Mean Median StdDev Renders vs Baseline
Text mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
Text rerender 0.30ms 0.00ms ±0.48ms 2 +0.0%
Text long-1000 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text nested 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text styled 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text multiple-100 6.07ms 6.00ms ±1.16ms 1 -14.3%

SectionList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
SectionList native mount 3.54ms 3.58ms ±0.34ms 1 -44.9%

FlatList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
FlatList native mount 3.61ms 3.16ms ±1.15ms 1 -65.8%

TouchableHighlight.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight native mount 1.15ms 1.09ms ±0.23ms 1 -47.6%

TouchableOpacity.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity native mount 1.32ms 1.23ms ±0.19ms 1 -60.7%

Pressable.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Pressable native mount 1.16ms 1.13ms ±0.12ms 1 -54.8%

ScrollView.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ScrollView native mount 2.37ms 2.28ms ±0.31ms 1 -43.8%

ActivityIndicator.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator native mount 1.17ms 0.98ms ±0.65ms 1 -60.4%

TextInput.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TextInput native mount 1.52ms 1.52ms ±0.09ms 1 -62.8%

Switch.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Switch native mount 0.96ms 0.94ms ±0.14ms 1 -45.8%

Button.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Button native mount 1.43ms 1.36ms ±0.25ms 1 -47.6%

Modal.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Modal native mount 0.70ms 0.71ms ±0.03ms 1 -42.1%

Image.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Image native mount 1.23ms 1.21ms ±0.13ms 1 -46.5%

View.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
View native mount 0.77ms 0.73ms ±0.10ms 1 -48.7%

Text.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Text native mount 1.07ms 1.03ms ±0.26ms 1 -40.8%

@acoates-ms acoates-ms marked this pull request as ready for review April 25, 2026 18:19
@acoates-ms acoates-ms requested a review from a team as a code owner April 25, 2026 18:19
@acoates-ms acoates-ms merged commit ea0dd89 into microsoft:main Apr 25, 2026
32 checks passed
@acoates-ms acoates-ms deleted the borderradiiflip branch April 25, 2026 22:06
acoates-ms added a commit to acoates-ms/react-native-windows that referenced this pull request Apr 25, 2026
* Some fixes for rounded borders

* Change files

* Image snaphots
acoates-ms added a commit that referenced this pull request Apr 25, 2026
…rformance (#16050)

* Fix ScrollView keyboard scroll drift on long key press (#15988)

* Fix ScrollView keyboard scroll drift on long key press

* Change files

* [0.84] Fix multiline TextInput crash from TxDrawD2D reentrancy (#15990) (#16003)

* Fix multiline TextInput crash from TxDrawD2D reentrancy

* Change files

* Fix touch event handling, improve reliability, and optimize performance (#16048)

* Fix touch event handling, improve reliability, and optimize performance

- Fix touch/pen pointer device type detection and screenPoint coordinates
- Fix touch cancel to include all active touches per W3C spec
- Synthesize touch-cancel for stale pointers and releases outside views
- Fix TextInput pointer message translation (use mouse-style messages for RichEdit)
- Fix ShouldSubmit modifier key checks (altDown, ctrlKey)
- Add null safety to RootComponentView() for island teardown
- Fix Pressability hover timeout and tabIndex focusable mapping
- Cache event path to root to avoid repeated tree walks
- Use unordered_set for pointer capture tracking
- Eliminate O(n²) hit testing by caching visual children
- Skip snap scroll reconfiguration when unchanged
- Improve TextInput reliability: thread-safe loading, null safety, use-after-free fix
- Fix Timing data race and remove duplicate image error allocation
- Use unordered_set for animated node and component registry lookups
- Clean up dead code in ScrollView and simplify Modal event emitter init

* formatting

* Change files

* Update react-native-windows-cd995d7a-4df8-4c73-9b1b-c57b3b886cc6.json

* Touch target

* addressed pr comments

* Crash on invalid index

* revert until rn core pr

* Update react-native-windows-cd995d7a-4df8-4c73-9b1b-c57b3b886cc6.json

* format

* snapshots

---------

Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
Co-authored-by: Gordon MacMaster <gordomacmaster@gmail.com>

* change files

* Fix some issues with rounded borders (#16051)

* Some fixes for rounded borders

* Change files

* Image snaphots

---------

Co-authored-by: Abhijeet Jha <74712637+iamAbhi-916@users.noreply.github.com>
Co-authored-by: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com>
Co-authored-by: Gordon MacMaster <gordomacmaster@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant