Repository navigation
Use contour geometry and fill rules for Path.contains - #593
Conversation
|
Additional reproduction and verification details for The triangle regression distinguishes contour containment from bounding-box containment. The fill-rule regression queries the same path in nonzero, even-odd, then nonzero mode, checking that each query applies the requested rule independently. Separate cases exercise an explicit closing edge and two implicitly closed contours. From the generated Gradle root, the focused Android suite is: gradle :SkipUI:connectedDebugAndroidTest \
'-Pandroid.testInstrumentationRunnerArguments.class=skip.ui.PathContainmentTests'All five cases fail with the original implementation and pass after restoration on API 34 ARM64. They also pass under Robolectric with The current PR CI run passed, including iOS and Android emulator jobs. The CLA check also passes. The description retains the three local font-metric failures that reproduce on unchanged upstream source. |
Path.containscurrently tests only the bounding rectangle. For example, it accepts (80, 80) in a triangle with vertices (0, 0), (100, 0), and (0, 100), and it ignores even-odd cutouts.Use Compose's path hit tester with the requested fill rule. Materialize explicit and implicit closing edges so every contour segment participates, and leave the stored path's drawing state unchanged. SkipFuseUI already delegates containment to this implementation.
Require AndroidX
graphics-path1.1.0 for its host implementation. With the previous transitive 1.0.1 dependency, path iteration fails under Robolectric withUnsatisfiedLinkError. See the AndroidX release notes.Validation
6b6d54b, including Swift/Robolectric, iOS, and Android emulator tests.The broader local run combined the independent drag and path changes on upstream base
5504558. Hostswift test --skip XCSkipTestscompleted 135 tests with 63 platform skips and no failures. The full Android run completed 228 tests: 211 passed, 14 skipped, and 3 failed. The three font-metric failures (testTextSizeHeadline,testTextSizeCaption, andtestTextSizeBody) also reproduce on unchanged upstream source with its original dependencies: actual/expected values 18/19, 12/13, and 18/19 respectively. The focused regressions pass on Android and Robolectric.Checklist
swift testand separate Android/Gradle runs.