From fcfe83572f290a428005d363f0d19ae9a9e05c34 Mon Sep 17 00:00:00 2001 From: True Zhuanjia Date: Mon, 13 Apr 2026 18:16:37 +0800 Subject: [PATCH] autoDock fixes --- VoidLink/Input/OnScreenWidgetView.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/VoidLink/Input/OnScreenWidgetView.swift b/VoidLink/Input/OnScreenWidgetView.swift index 7009f8a7..b1c53f8f 100644 --- a/VoidLink/Input/OnScreenWidgetView.swift +++ b/VoidLink/Input/OnScreenWidgetView.swift @@ -3090,7 +3090,7 @@ import ObjectiveC.runtime // MARK: - Auto Dock private static let autoDockExposedEdgeLength: CGFloat = GenericUtils.isIPhone() ? 90 : 90 - private static let autoDockExposedThickness: CGFloat = 17 + private static let autoDockExposedThickness: CGFloat = 22 private static let autoDockVerticalInset: CGFloat = 12 @objc var autoDockIdleDuration: TimeInterval = 5 private static let autoDockInitialAlpha: CGFloat = 0.8 @@ -3119,7 +3119,7 @@ import ObjectiveC.runtime }() private var autoDockTimer: Timer? - private var autoDockStoredCenter: CGPoint? + // private var autoDockStoredCenter: CGPoint? private var autoDockDockedCenter: CGPoint? private var autoDockDockedToBottomEdge: Bool = false private var autoDockDistance: CGFloat = 3 @@ -3302,7 +3302,7 @@ import ObjectiveC.runtime hostView.layoutIfNeeded() layoutIfNeeded() - autoDockStoredCenter = center + // autoDockStoredCenter = storedCenter let rightDistance = hostView.bounds.width - frame.maxX let bottomDistance = hostView.bounds.height - frame.maxY autoDockDistance = min(rightDistance, bottomDistance) @@ -3342,7 +3342,8 @@ import ObjectiveC.runtime } private func autoDockRestoreWidget(animated: Bool) { - guard autoDockIsDocked, let restoreCenter = autoDockStoredCenter else { return } + guard autoDockIsDocked else { return } + let restoreCenter = storedCenter OnScreenWidgetView.hasRestoredFromAutoDock = true autoDockStopCountdown() autoDockStopSettledAlphaTimer()