diff --git a/Example/SnapshotTests/ReferenceImages/_64/ImpreciseObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/ImpreciseObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png index 9c48962a..c5ac2f7b 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/ImpreciseObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/ImpreciseObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png index 9c48962a..c5ac2f7b 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointAlways_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointDefault_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointDefault_17_2_393x852@3x.png index 9c48962a..7ebe81da 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointDefault_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/ObjectiveCTests/testSimpleViewWithActivationPointDefault_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_16_4_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_16_4_393x852@3x.png index a290d4d5..638c031c 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_16_4_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_16_4_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_17_2_393x852@3x.png index 2ec04e91..638c031c 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testButtonTraits_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_16_4_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_16_4_393x852@3x.png index 0d3f2400..ce406c85 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_16_4_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_16_4_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_17_2_393x852@3x.png index 1a6bae8c..ce406c85 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.AccessibilitySnapshotTests/testTabBars_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_16_4_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_16_4_393x852@3x.png index 3bb75edd..5e153b28 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_16_4_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_16_4_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_17_2_393x852@3x.png index d6acbe25..9de34b0e 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepperAtMin_17_2_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_16_4_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_16_4_393x852@3x.png index ac30640d..6a471c71 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_16_4_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_16_4_393x852@3x.png differ diff --git a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_17_2_393x852@3x.png b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_17_2_393x852@3x.png index cb4a6fc1..d932fe22 100644 Binary files a/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_17_2_393x852@3x.png and b/Example/SnapshotTests/ReferenceImages/_64/SnapshotTests.DefaultControlsTests/testStepper_17_2_393x852@3x.png differ diff --git a/Sources/AccessibilitySnapshot/Core/Swift/Classes/AccessibilityHierarchyParser.swift b/Sources/AccessibilitySnapshot/Core/Swift/Classes/AccessibilityHierarchyParser.swift index 4e19ad36..77826f71 100644 --- a/Sources/AccessibilitySnapshot/Core/Swift/Classes/AccessibilityHierarchyParser.swift +++ b/Sources/AccessibilitySnapshot/Core/Swift/Classes/AccessibilityHierarchyParser.swift @@ -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 ) @@ -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 + } + +}