mirror of
https://mirror.skon.top/github.com/gkd-kit/gkd
synced 2026-04-20 21:00:12 +08:00
fix: Swipe ActionResult (#1334)
This commit is contained in:
@@ -210,11 +210,17 @@ sealed class ActionPerformer(val action: String) {
|
||||
locationProps: RawSubscription.LocationProps,
|
||||
): ActionResult {
|
||||
val rect = node.casted.boundsInScreen
|
||||
val swipeArg = locationProps.swipeArg ?: return None.perform(node, locationProps)
|
||||
val swipeArg = locationProps.swipeArg ?: return ActionResult(
|
||||
action = action,
|
||||
result = false,
|
||||
)
|
||||
val startP = swipeArg.start.calc(rect)
|
||||
val endP = swipeArg.end?.calc(rect) ?: startP
|
||||
if (startP == null || endP == null) {
|
||||
return None.perform(node, locationProps)
|
||||
return ActionResult(
|
||||
action = action,
|
||||
result = false,
|
||||
)
|
||||
}
|
||||
val startX = startP.first
|
||||
val startY = startP.second
|
||||
|
||||
Reference in New Issue
Block a user