Fix CollectionView LinearLayout move overlapped issue
authorEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 24 Jan 2024 11:51:15 +0000 (20:51 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 1 Feb 2024 03:50:22 +0000 (12:50 +0900)
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs

index b63c6a6..ff0a145 100755 (executable)
@@ -1192,7 +1192,6 @@ namespace Tizen.NUI.Components
             if (source == null) throw new ArgumentNullException(nameof(source));
             if (collectionView == null) return;
 
-            // Will be null if not a group.
             float currentSize = StepCandidate;
             int diff = toPosition - fromPosition;
 
@@ -1217,6 +1216,7 @@ namespace Tizen.NUI.Components
             int startIndex = ( diff > 0 ? fromPosition: toPosition);
             int endIndex = (diff > 0 ? toPosition: fromPosition);
 
+            // all items are within the visual area
             if ((endIndex >= FirstVisible) && (startIndex <= LastVisible))
             {
                 foreach (RecyclerViewItem item in VisibleItems)
@@ -1234,7 +1234,7 @@ namespace Tizen.NUI.Components
                 }
             }
 
-            if (fromPosition > FirstVisible)
+            if (fromPosition < FirstVisible)
             {
                 if (toPosition > LastVisible)
                 {
@@ -1243,7 +1243,7 @@ namespace Tizen.NUI.Components
                 }
                 else if (toPosition > FirstVisible && toPosition <= LastVisible)
                 {
-                    LastVisible--;
+                    FirstVisible--;
                 }
             }
             else if (fromPosition >= FirstVisible && fromPosition <= LastVisible)