From 644687a50c0888f0a42db74f60e91b97c015d1f4 Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Tue, 28 Oct 2025 20:24:48 +0800 Subject: [PATCH] optimize direction pad haptic feedback --- VoidLink/Input/OnScreenWidgetView.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/VoidLink/Input/OnScreenWidgetView.swift b/VoidLink/Input/OnScreenWidgetView.swift index 6193a02e..00e99e1e 100644 --- a/VoidLink/Input/OnScreenWidgetView.swift +++ b/VoidLink/Input/OnScreenWidgetView.swift @@ -914,19 +914,18 @@ import UIKit } private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){ - // Add the border layer below the super layer - indicatorLayer.isHidden = false - // show the indicator based on the touchBeganLocation - // indicatorLayer.position = CGPointMake(CGRectGetMinX(self.frame)+touchBeganLocation.x, CGRectGetMinY(self.frame)+touchBeganLocation.y) indicatorLayer.position = touchBeganLocation - if vibrationOn { - vibrationGenerator.prepare() - vibrationGenerator.impactOccurred() + if indicatorLayer.isHidden { + indicatorLayer.isHidden = false + if vibrationOn { + vibrationGenerator.prepare() + vibrationGenerator.impactOccurred() + } } } - + private func handleLrudTouchMove(){ CATransaction.begin() CATransaction.setDisableActions(true)