optimize direction pad haptic feedback

This commit is contained in:
TrueZhuanjia committed 2025-10-28 20:24:48 +08:00
1 parent e7132e3371
commit 644687a50c
1 file changed
+3 -4
+3 -4
View File
@@ -914,18 +914,17 @@ import UIKit
} }
private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){ private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){
// Add the border layer below the super layer
indicatorLayer.isHidden = false
// show the indicator based on the touchBeganLocation // show the indicator based on the touchBeganLocation
// indicatorLayer.position = CGPointMake(CGRectGetMinX(self.frame)+touchBeganLocation.x, CGRectGetMinY(self.frame)+touchBeganLocation.y)
indicatorLayer.position = touchBeganLocation indicatorLayer.position = touchBeganLocation
if indicatorLayer.isHidden {
indicatorLayer.isHidden = false
if vibrationOn { if vibrationOn {
vibrationGenerator.prepare() vibrationGenerator.prepare()
vibrationGenerator.impactOccurred() vibrationGenerator.impactOccurred()
} }
} }
}
private func handleLrudTouchMove(){ private func handleLrudTouchMove(){
CATransaction.begin() CATransaction.begin()