Forum Archive

ui path.hit_test

SteveK2216

Don't think this works for the case of a single line segment in a path(move_to, line_to).
Had to write my own hit_test to check against path bounds.

hit_test seems to work for rects and circles in a path.

JonB

Does hit_test actually check against the "bounds" (i.e, for a circle of radius r, the point r,r would be the corner of the bounding rectangle), or does it check if a point is on the interior of an enclosed perimeter? (I haven't actually tried it)

If the latter, then it makes sense that the behavior is undefined -- unless you also account for the linewidth, or finite pixel width. Same for arc segments.

zencuke

Simple example of fail case please. I'm not sure about ui but in other environments hit tests sometimes require a closed path.