diff --git a/samples/ControlCatalog/Pages/ScrollSnapPage.xaml b/samples/ControlCatalog/Pages/ScrollSnapPage.xaml index e7e1060f31..237822041b 100644 --- a/samples/ControlCatalog/Pages/ScrollSnapPage.xaml +++ b/samples/ControlCatalog/Pages/ScrollSnapPage.xaml @@ -8,7 +8,7 @@ x:DataType="pages:ScrollSnapPageViewModel"> Scrollviewer can snap supported content both vertically and horizontally. Snapping occurs from scrolling with touch or pen, or using the pointer wheel. + Classes="h2">Scrollviewer can snap supported content both vertically and horizontally. Snapping occurs from scrolling with touch or pen. Viewport.Height) { double height = isLogical ? scrollable!.ScrollSize.Height : 50; - if(VerticalSnapPointsType == SnapPointsType.MandatorySingle && Content is IScrollSnapPointsInfo) - { - if(_areVerticalSnapPointsRegular) - { - height = _verticalSnapPoint; - } - else if(_verticalSnapPoints != null && _verticalSnapPoints.Count > 0) - { - double yOffset = Offset.Y; - switch (VerticalSnapPointsAlignment) - { - case SnapPointsAlignment.Center: - yOffset += Viewport.Height / 2; - break; - case SnapPointsAlignment.Far: - yOffset += Viewport.Height; - break; - } - - var snapPoint = FindNearestSnapPoint(_verticalSnapPoints, yOffset, out var lowerSnapPoint); - - height = snapPoint - lowerSnapPoint; - } - } y += -delta.Y * height; y = Math.Max(y, 0); y = Math.Min(y, Extent.Height - Viewport.Height); @@ -639,30 +615,6 @@ namespace Avalonia.Controls.Presenters if (Extent.Width > Viewport.Width) { double width = isLogical ? scrollable!.ScrollSize.Width : 50; - if (HorizontalSnapPointsType == SnapPointsType.MandatorySingle && Content is IScrollSnapPointsInfo) - { - if (_areHorizontalSnapPointsRegular) - { - width = _horizontalSnapPoint; - } - else if(_horizontalSnapPoints != null && _horizontalSnapPoints.Count > 0) - { - double xOffset = Offset.X; - switch (VerticalSnapPointsAlignment) - { - case SnapPointsAlignment.Center: - xOffset += Viewport.Width / 2; - break; - case SnapPointsAlignment.Far: - xOffset += Viewport.Width; - break; - } - - var snapPoint = FindNearestSnapPoint(_horizontalSnapPoints, xOffset, out var lowerSnapPoint); - - width = snapPoint - lowerSnapPoint; - } - } x += -delta.X * width; x = Math.Max(x, 0); x = Math.Min(x, Extent.Width - Viewport.Width);