Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/SwipeActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,12 @@ extension SwipeView {
}()

let opacity: Double = {

/// Adjust the dragged length by subtracting the spacing
let adjustedDragged = draggedLength - options.spacing

/// Subtract the start point from the dragged length, which cancels it out initially.
let offset = max(0, draggedLength - options.actionsVisibleStartPoint)
let offset = max(0, adjustedDragged - options.actionsVisibleStartPoint)

/// Calculate the opacity percent.
let percent = offset / (options.actionsVisibleEndPoint - options.actionsVisibleStartPoint)
Expand Down