diff --git a/reorderable/src/commonMain/kotlin/org/burnoutcrew/reorderable/ReorderableState.kt b/reorderable/src/commonMain/kotlin/org/burnoutcrew/reorderable/ReorderableState.kt index a6b06f5..13ebfc5 100644 --- a/reorderable/src/commonMain/kotlin/org/burnoutcrew/reorderable/ReorderableState.kt +++ b/reorderable/src/commonMain/kotlin/org/burnoutcrew/reorderable/ReorderableState.kt @@ -64,13 +64,13 @@ abstract class ReorderableState( internal val interactions = Channel() internal val scrollChannel = Channel() val draggingItemLeft: Float - get() = draggingLayoutInfo?.let { item -> + get() = if(draggingItemKey!=null) draggingLayoutInfo?.let { item -> (selected?.left ?: 0) + draggingDelta.x - item.left - } ?: 0f + } ?: 0f else 0f val draggingItemTop: Float - get() = draggingLayoutInfo?.let { item -> + get() = if(draggingItemKey!=null) draggingLayoutInfo?.let { item -> (selected?.top ?: 0) + draggingDelta.y - item.top - } ?: 0f + } ?: 0f else 0f abstract val isVerticalScroll: Boolean private val draggingLayoutInfo: T? get() = visibleItemsInfo