Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. float distance = 25.0f; // constant distance
  2. if ( ( point.x < rect.left && point.x > rect.left - distance ) ||
  3. ( point.x > rect.right && point.x < rect.right + distance ) ||
  4. ( point.y < rect.bottom && point.y > rect.bottom - distance ) ||
  5. ( point.y > rect.top && point.y < rect.top + distance ) ) {
  6. // point is in black area
  7. }
  8. else {
  9. // point is in pink/grey area
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement