CRect:PtInsideInt


The PtInsideInt method tests whether a point is interior to the CRect when the coordinates are all considered to be integers rather than real numbers.

Syntax

bSuccess = CRect:IsInsideInt( x, y )

where

    x, y are the point coordinates.

    CPoint is a CPoint object.

    bSuccess is returned true if the point is inside the rectangle, otherwise false.

  

This method handles the boundary case in which the point lies within the same integer value. For example, if xmin = 200.4, then any point x in the range 200 through 201 is considered to lie on the boundary xmin and is therefore considered inside the rectangle.

Example

The following script tests whether the point (225.2,300.6) is inside the CRect when tested using both PtInside() and PtInsideInt():

R = NewRect(200.5,250,250,500)

-- create a CRect object

x = 200.2 ; y = 300

 

test = R:PtInside(x,y)

-- returns true or false

Printf( "result= %d\n", test)

-- result: Inside = 0

test = R:PtInsideInt(x,y)

-- returns test = true or false

Printf( "result= %d\n", test)

-- result: Inside = 1

Related Topics

PtInside

RectInside

CRect class