home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Coord / c / PtInRect < prev    next >
Encoding:
Text File  |  1993-07-13  |  1.0 KB  |  29 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Coord.PtInRect.c
  12.     Author:  Copyright © 1992 Edouard Poor
  13.     Version: 1.01 (13 Jul 1993)
  14.     Purpose: Check if a point lies within a rectangle
  15. */
  16.  
  17.  
  18. #include "Core.h"
  19. #include "Wimp.h"
  20.  
  21. BOOL Coord_PointInRect(wimp_coord *point, wimp_rect *rectangle)
  22.     {
  23.     if(point->x < rectangle->min.x) return(FALSE);
  24.     if(point->x > rectangle->max.x) return(FALSE);
  25.     if(point->y < rectangle->min.y) return(FALSE);
  26.     if(point->y > rectangle->max.y) return(FALSE);
  27.     return(TRUE);
  28.     }
  29.