Skip to content

Commit f357995

Browse files
author
Nitin Chaudhary
committed
Update change file and fix formatting for snap point implementation
1 parent 2f71a27 commit f357995

5 files changed

+19
-42
lines changed

change/react-native-windows-535a6feb-a06c-4d97-8ad6-ee5dce35c7ad.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

change/react-native-windows-d2576e88-05d8-4466-8174-cde30184796a.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

change/react-native-windows-d6398257-a0a3-43a6-a9df-7d9f9a41727d.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

change/react-native-windows-pagingenabled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "prerelease",
3-
"comment": "Implement pagingEnabled prop support for Fabric ScrollView to enable page-by-page scrolling with viewport-sized snap points",
3+
"comment": "Implement snap point parity for Fabric ScrollView: pagingEnabled (viewport-sized intervals), snapToInterval (custom interval snapping), and snapToAlignment (start/center/end alignment) matching iOS/Android/Paper behavior with priority hierarchy snapToOffsets > snapToInterval > pagingEnabled",
44
"packageName": "react-native-windows",
55
"email": "[email protected]",
66
"dependentChangeType": "patch"

vnext/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -467,30 +467,28 @@ struct ScrollBarComponent {
467467
}
468468

469469
winrt::com_ptr<IDWriteTextFormat> spTextFormat;
470-
winrt::check_hresult(
471-
::Microsoft::ReactNative::DWriteFactory()->CreateTextFormat(
472-
L"Segoe Fluent Icons",
473-
nullptr, // Font collection (nullptr sets it to use the system font collection).
474-
DWRITE_FONT_WEIGHT_REGULAR,
475-
DWRITE_FONT_STYLE_NORMAL,
476-
DWRITE_FONT_STRETCH_NORMAL,
477-
8, // Xaml resource: ScrollBarButtonArrowIconFontSize
478-
L"",
479-
spTextFormat.put()));
470+
winrt::check_hresult(::Microsoft::ReactNative::DWriteFactory()->CreateTextFormat(
471+
L"Segoe Fluent Icons",
472+
nullptr, // Font collection (nullptr sets it to use the system font collection).
473+
DWRITE_FONT_WEIGHT_REGULAR,
474+
DWRITE_FONT_STYLE_NORMAL,
475+
DWRITE_FONT_STRETCH_NORMAL,
476+
8, // Xaml resource: ScrollBarButtonArrowIconFontSize
477+
L"",
478+
spTextFormat.put()));
480479

481480
winrt::check_hresult(spTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
482481

483482
winrt::com_ptr<IDWriteTextLayout> spTextLayout;
484-
winrt::check_hresult(
485-
::Microsoft::ReactNative::DWriteFactory()->CreateTextLayout(
486-
m_vertical ? ((region == ScrollbarHitRegion::ArrowFirst) ? L"\uEDDB" : L"\uEDDC")
487-
: ((region == ScrollbarHitRegion::ArrowFirst) ? L"\uEDD9" : L"\uEDDA"),
488-
1, // The length of the string.
489-
spTextFormat.get(), // The text format to apply to the string (contains font information, etc).
490-
(m_arrowSize / m_scaleFactor), // The width of the layout box.
491-
(m_arrowSize / m_scaleFactor), // The height of the layout box.
492-
spTextLayout.put() // The IDWriteTextLayout interface pointer.
493-
));
483+
winrt::check_hresult(::Microsoft::ReactNative::DWriteFactory()->CreateTextLayout(
484+
m_vertical ? ((region == ScrollbarHitRegion::ArrowFirst) ? L"\uEDDB" : L"\uEDDC")
485+
: ((region == ScrollbarHitRegion::ArrowFirst) ? L"\uEDD9" : L"\uEDDA"),
486+
1, // The length of the string.
487+
spTextFormat.get(), // The text format to apply to the string (contains font information, etc).
488+
(m_arrowSize / m_scaleFactor), // The width of the layout box.
489+
(m_arrowSize / m_scaleFactor), // The height of the layout box.
490+
spTextLayout.put() // The IDWriteTextLayout interface pointer.
491+
));
494492

495493
POINT offset;
496494
{

0 commit comments

Comments
 (0)