Skip to content

Commit 8f16e3c

Browse files
Updated summary for GetClampedAnimationDuration method
1 parent dbe3706 commit 8f16e3c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

maui/src/BottomSheet/SfBottomSheet.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,8 +1283,11 @@ public void Close()
12831283
}
12841284

12851285
/// <summary>
1286-
/// Updates the animation duration with the given value.
1286+
/// Returns the value of <c>AnimationDuration</c>, ensuring it is clamped to a non-negative integer.
1287+
/// This method is useful when passing the duration to animation APIs that require a <c>uint</c> value,
1288+
/// preventing issues caused by negative durations.
12871289
/// </summary>
1290+
/// <returns>A non-negative integer representing the animation duration.</returns>
12881291
int GetClampedAnimationDuration()
12891292
{
12901293
return (int)Math.Max(0, AnimationDuration);
@@ -2169,6 +2172,7 @@ void AnimateOverlay(int animationDuration)
21692172

21702173
var overlayGridAnimation = new Animation(d =>
21712174
{
2175+
// Ensure the opacity is only updated with valid numeric values to avoid rendering issues.
21722176
if (!double.IsNaN(d))
21732177
{
21742178
_overlayGrid.Opacity = d;

maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public void CollapseOnOverlayTap(bool input, bool expected)
480480
[InlineData(500d, 500d)]
481481
[InlineData(0d, 0d)]
482482
[InlineData(-500d, -500d)]
483-
public void AnimationDuration(double input, double expected)
483+
public void AnimationDurationProperty_ReturnsSetValue(double input, double expected)
484484
{
485485
_bottomSheet.AnimationDuration = input;
486486

0 commit comments

Comments
 (0)