This is the first performance optimization for hit test snapshotting, focused on optimizing the Y axis.
Note this optimization introduces a possibility of missing a hit region, specifically in the case where there's a very thin horizontal hit region (for example, a hairline separator view) with the same hit target view on both sides. I think given the huge performance improvement, this is probably acceptable in most cases, but I made it configurable so it's up to consumers to make that trade-off.
Split into three commits:
A pure refactor to make it clearer what the performance optimization does.
This is the first performance optimization for hit test snapshotting, focused on optimizing the Y axis.
Note this optimization introduces a possibility of missing a hit region, specifically in the case where there's a very thin horizontal hit region (for example, a hairline separator view) with the same hit target view on both sides. I think given the huge performance improvement, this is probably acceptable in most cases, but I made it configurable so it's up to consumers to make that trade-off.
Split into three commits: