MouseEvent covering rect() with rounded edges?

I usually use:

if(mouseX >= rectx && mouseX <= rectx + rectwidth && mouseY >= recty && mouseY <= recty + rectheight)

to use functions when clicked on rectangle areas.

What is the if-condition to cover the area of a rect with rounded edges?

Answers

  • Answer ✓

    I assume you mean rounded corners :)

    There is no simple if statement that you could use for rectangles with rounded corners if you want an accurate test.

    If the rounded corners were visually small then you could simply ignore them.

  • You could additionally to the standard if-clause check color with get

  • edited August 2017

    I think i will simply ignore it then. Was a bit unsecure if someone could see a problem with that using a touch field on a laptop :s

Sign In or Register to comment.