listless

A simple list app for Apple platforms
Log | Files | Refs | README | LICENSE

commit 71f650b9e9395bc163cf7020405bdb7a405d41f1
parent e498195b703211c77bd35a27ff133ec57fd4d7b5
Author: Michael Camilleri <[email protected]>
Date:   Fri,  6 Mar 2026 21:58:59 +0900

Use fixed amount for drag scaling effect

Diffstat:
MListlessiOS/Views/TaskListView.swift | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ListlessiOS/Views/TaskListView.swift b/ListlessiOS/Views/TaskListView.swift @@ -198,6 +198,12 @@ struct TaskListView: View, TaskListViewProtocol { iState.isShowingSettings = true } + private func dragScaleEffect(for taskID: UUID) -> CGFloat { + let liftPoints: CGFloat = 20 + guard let width = rowFrames[taskID]?.width, width > 0 else { return 1.05 } + return (width + liftPoints) / width + } + var body: some View { taskScrollView .contentShape(Rectangle()) @@ -293,7 +299,7 @@ struct TaskListView: View, TaskListViewProtocol { endEditing($0, shouldCreateNewTask: $1) } ) - .scaleEffect(draggedTaskID == taskID ? 1.05 : 1.0) + .scaleEffect(draggedTaskID == taskID ? dragScaleEffect(for: taskID) : 1.0) .shadow( color: draggedTaskID == taskID ? .black.opacity(0.3) : .clear, radius: 12, y: 4