Skip to content

Commit

Permalink
Also sub-pixel differences from default activation point
Browse files Browse the repository at this point in the history
  • Loading branch information
NickEntin committed Jan 26, 2024
1 parent 0d90140 commit d9c02a4
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 1 deletion.
Binary file modified ...ciseObjectiveCTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ..._64/ObjectiveCTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...64/ObjectiveCTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...ges/_64/SnapshotTests.DefaultControlsTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ public final class AccessibilityHierarchyParser {
userInputLabels: userInputLabels,
shape: accessibilityShape(for: element.object, in: root),
activationPoint: root.convert(activationPoint, from: nil),
usesDefaultActivationPoint: (activationPoint == defaultActivationPoint(for: element.object)),
usesDefaultActivationPoint: activationPoint.approximatelyEquals(
defaultActivationPoint(for: element.object),
tolerance: 1 / (root.window?.screen ?? UIScreen.main).scale
),
customActions: element.object.accessibilityCustomActions?.map { $0.name } ?? [],
accessibilityLanguage: element.object.accessibilityLanguage
)
Expand Down Expand Up @@ -702,3 +705,13 @@ extension UIView {
}

}

// MARK: -

private extension CGPoint {

func approximatelyEquals(_ other: CGPoint, tolerance: CGFloat) -> Bool {
return abs(self.x - other.x) < tolerance && abs(self.y - other.y) < tolerance
}

}

0 comments on commit d9c02a4

Please sign in to comment.