omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    ui path.hit_test

    Pythonista
    3
    3
    1551
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SteveK2216
      SteveK2216 last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • zencuke
          zencuke last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors