How do the two cases behave with contains() and mouse checking on the various artists?
I've investigated this, and amusingly enough, contains() is not fully consistent with either fill rule. The current logic (in this function) is essentially (and possibly unintentionally) consistent with the even-odd rule on any individual subpath (and if the subpath does not self-intersect, the non-zero winding rule is the same). However, if there are multiple subpaths, a point is considered "inside" the combined path if it is inside at least one subpath, even if the combined effect of all subpaths mean that the point should actually be "outside". This means:
- If all subpaths do not self-intersect and do not intersect with each other,
contains() is consistent with both the non-zero winding rule and the even-odd rule (that is, both rules have the same result)
- If there is a single subpath that self-intersects,
contains() is consistent with the even-odd rule
- If there are multiple subpaths that do not self-intersect but do intersect with each other, and all subpaths are the same orientation,
contains() is consistent with the non-zero winding rule
- If none of the above,
contains() gives a "wrong" result: it is not consistent with either rule
My inclination is that fixing contains() should be deferred to a future PR.
Originally posted by @ayshih in #32253 (comment)
I've investigated this, and amusingly enough,
contains()is not fully consistent with either fill rule. The current logic (in this function) is essentially (and possibly unintentionally) consistent with the even-odd rule on any individual subpath (and if the subpath does not self-intersect, the non-zero winding rule is the same). However, if there are multiple subpaths, a point is considered "inside" the combined path if it is inside at least one subpath, even if the combined effect of all subpaths mean that the point should actually be "outside". This means:contains()is consistent with both the non-zero winding rule and the even-odd rule (that is, both rules have the same result)contains()is consistent with the even-odd rulecontains()is consistent with the non-zero winding rulecontains()gives a "wrong" result: it is not consistent with either ruleMy inclination is that fixing
contains()should be deferred to a future PR.Originally posted by @ayshih in #32253 (comment)