home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskSrc / FN / Libraries / Coord / c / PtInRect < prev    next >
Encoding:
Text File  |  1996-05-13  |  1.2 KB  |  31 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 "Desk.Core.h"
  19. #include "Desk.Wimp.h"
  20. #include "Desk.Coord.h"
  21.  
  22.  
  23. Desk_bool Desk_Coord_PointInRect(const Desk_wimp_coord *point, const Desk_wimp_rect *rectangle)
  24.     {
  25.     if(point->x < rectangle->min.x) return(Desk_bool_FALSE);
  26.     if(point->x > rectangle->max.x) return(Desk_bool_FALSE);
  27.     if(point->y < rectangle->min.y) return(Desk_bool_FALSE);
  28.     if(point->y > rectangle->max.y) return(Desk_bool_FALSE);
  29.     return(Desk_bool_TRUE);
  30.     }
  31.