@ -607,30 +607,6 @@ namespace Avalonia.Controls.Presenters
if ( Extent . Height > Viewport . Height )
{
double height = isLogical ? scrollable ! . ScrollSize . Height : 5 0 ;
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 : 5 0 ;
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 ) ;