enable track point for onscreen widget edit mode
This commit is contained in:
1 parent
8cd366d2cd
commit
acc89dba39
2 files changed
+38
-25
No files matched your search
@@ -1898,22 +1898,22 @@ import SVGKit
|
||||
OnScreenWidgetView.updateStreamViewGuidelines(for: self)
|
||||
}
|
||||
}
|
||||
|
||||
if self.hasTrackPoint, OnScreenWidgetView.trackPointEnabled {
|
||||
CATransaction.begin()
|
||||
CATransaction.setDisableActions(true)
|
||||
if let touch = touches.first {
|
||||
trackPoint.isHidden = false
|
||||
trackPoint.position = touch.location(in: self)
|
||||
}
|
||||
CATransaction.commit()
|
||||
}
|
||||
}
|
||||
// here is in edit mode:
|
||||
else{
|
||||
self.handleButtonDown()
|
||||
NotificationCenter.default.post(name: Notification.Name("OnScreenWidgetViewSelected"),object: self) // inform layout tool controller to fetch button size factors. self will be passed as the object of the notification
|
||||
}
|
||||
|
||||
if self.hasTrackPoint, OnScreenWidgetView.trackPointEnabled {
|
||||
CATransaction.begin()
|
||||
CATransaction.setDisableActions(true)
|
||||
if let touch = touches.first {
|
||||
trackPoint.isHidden = false
|
||||
trackPoint.position = touch.location(in: self)
|
||||
}
|
||||
CATransaction.commit()
|
||||
}
|
||||
}
|
||||
|
||||
private func moveByTouch(touch: UITouch){
|
||||
@@ -2108,18 +2108,6 @@ import SVGKit
|
||||
self.moveByTouch(touch: touch)
|
||||
}
|
||||
}
|
||||
|
||||
if self.hasTrackPoint, OnScreenWidgetView.trackPointEnabled {
|
||||
if let touch = touches.first {
|
||||
CATransaction.begin()
|
||||
CATransaction.setDisableActions(true)
|
||||
if trackPoint.isHidden {
|
||||
trackPoint.isHidden = false
|
||||
}
|
||||
trackPoint.position = touch.location(in: self)
|
||||
CATransaction.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move the widgetView based on touch movement in relocation mode
|
||||
@@ -2130,6 +2118,18 @@ import SVGKit
|
||||
self.lrudIndicatorBall.removeFromSuperlayer()
|
||||
self.crossMarkLayer.removeFromSuperlayer()
|
||||
}
|
||||
|
||||
if self.hasTrackPoint, OnScreenWidgetView.trackPointEnabled {
|
||||
if let touch = touches.first {
|
||||
CATransaction.begin()
|
||||
CATransaction.setDisableActions(true)
|
||||
if trackPoint.isHidden {
|
||||
trackPoint.isHidden = false
|
||||
}
|
||||
trackPoint.position = touch.location(in: self)
|
||||
CATransaction.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func isAdjacentPoints(_ currentPoint: CGPoint, from originalPoint: CGPoint, tolerance: CGFloat) -> Bool {
|
||||
|
||||
Reference in new issue
Block a user