Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float distance = 25.0f; // constant distance
- if ( ( point.x < rect.left && point.x > rect.left - distance ) ||
- ( point.x > rect.right && point.x < rect.right + distance ) ||
- ( point.y < rect.bottom && point.y > rect.bottom - distance ) ||
- ( point.y > rect.top && point.y < rect.top + distance ) ) {
- // point is in black area
- }
- else {
- // point is in pink/grey area
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement