From: WoochanLee Date: Wed, 12 Oct 2022 08:46:02 +0000 (+0900) Subject: [NUI] Fix picker, scroller animation gives abnormal position value X-Git-Tag: submit/tizen/20221012.094838~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa19a4656494b85b8366c05f0748c42712d830f9;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix picker, scroller animation gives abnormal position value --- diff --git a/src/Tizen.NUI.Components/Controls/Picker.cs b/src/Tizen.NUI.Components/Controls/Picker.cs index e119baecf..e4d8517de 100755 --- a/src/Tizen.NUI.Components/Controls/Picker.cs +++ b/src/Tizen.NUI.Components/Controls/Picker.cs @@ -541,7 +541,7 @@ namespace Tizen.NUI.Components private void OnScrollAnimationEnded(object sender, ScrollEventArgs e) { //Ignore if the scroll position was not changed. (called it from this function) - if (lastScrollPosion == (int)e.Position.Y) return; + if (lastScrollPosion == (int)e.Position.Y && !onAlignAnimation) return; //Calc offset from closest item. int offset = (int)(e.Position.Y + startScrollOffset) % itemHeight; @@ -876,6 +876,9 @@ namespace Tizen.NUI.Components float realDistance = velocityOfLastPan * ((float)Math.Pow(decelerationRate, realDuration) - 1) / logValueOfDeceleration; float result = Math.Min(realDistance / Math.Abs(panAnimationDelta), 1.0f); + // This is hot-fix for if the velocity has very small value, result is not updated even progress done. + if (progress > 0.99) result = 1.0f; + return result; } } diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index ad2cdbfe7..231880dbe 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -1781,6 +1781,10 @@ namespace Tizen.NUI.Components float realDuration = progress * panAnimationDuration; float realDistance = velocityOfLastPan * ((float)Math.Pow(decelerationRate, realDuration) - 1) / logValueOfDeceleration; float result = Math.Min(realDistance / Math.Abs(panAnimationDelta), 1.0f); + + // This is hot-fix for if the velocity has very small value, result is not updated even progress done. + if (progress > 0.99) result = 1.0f; + return result; } }