Increased the tappable space of the Checkbox.
This commit is contained in:
parent
aaa8e4132e
commit
a7989c589f
@ -351,18 +351,14 @@ import MVMCore
|
|||||||
|
|
||||||
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
|
|
||||||
sendActions(for: touchIsAcceptablyOutside(touches.first) ? .touchUpOutside : .touchUpInside)
|
sendActions(for: .touchUpInside)
|
||||||
}
|
}
|
||||||
|
|
||||||
func touchIsAcceptablyOutside(_ touch: UITouch?) -> Bool {
|
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||||
let endLocation = touch?.location(in: self)
|
|
||||||
let x = endLocation?.x ?? 0.0
|
|
||||||
let y = endLocation?.y ?? 0.0
|
|
||||||
let faultTolerance: CGFloat = 20.0
|
|
||||||
let widthLimit = CGFloat(bounds.size.width + faultTolerance)
|
|
||||||
let heightLimt = CGFloat(bounds.size.height + faultTolerance)
|
|
||||||
|
|
||||||
return x < -faultTolerance || y < -faultTolerance || x > widthLimit || y > heightLimt
|
let faultTolerance: CGFloat = 20.0
|
||||||
|
let area = bounds.insetBy(dx: -faultTolerance, dy: -faultTolerance)
|
||||||
|
return area.contains(point)
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func accessibilityActivate() -> Bool {
|
override open func accessibilityActivate() -> Bool {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user