AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.BoundingBox Class Reference

Public Member Functions

 BoundingBox (double l, double t, double r, double b)
 
boolean intersectDestructively (BoundingBox bb)
 
double getLeft ()
 
double getTop ()
 
double getRight ()
 
double getBottom ()
 
String toString ()
 

Detailed Description

Bounding box abstraction, similar to android.graphics.Rect.

Definition at line 13 of file BoundingBox.java.

Constructor & Destructor Documentation

◆ BoundingBox()

com.google.appinventor.components.runtime.util.BoundingBox.BoundingBox ( double  l,
double  t,
double  r,
double  b 
)

Constructor for a bounding box. All coordinates are inclusive.

Parameters
lleftmost x-coordinate
ttopmost y-coordinate
rrightmost x-coordinate
bbottommost y-coordinate

Definition at line 27 of file BoundingBox.java.

Member Function Documentation

◆ getBottom()

double com.google.appinventor.components.runtime.util.BoundingBox.getBottom ( )

Gets the bottommost y-coordinate

Returns
the bottommost y-coordinate

Definition at line 96 of file BoundingBox.java.

◆ getLeft()

double com.google.appinventor.components.runtime.util.BoundingBox.getLeft ( )

Gets the leftmost x-coordinate

Returns
the leftmost x-coordinate

Definition at line 69 of file BoundingBox.java.

◆ getRight()

double com.google.appinventor.components.runtime.util.BoundingBox.getRight ( )

Gets the rightmost x-coordinate

Returns
the rightmost x-coordinate

Definition at line 87 of file BoundingBox.java.

◆ getTop()

double com.google.appinventor.components.runtime.util.BoundingBox.getTop ( )

Gets the uppermost y-coordinate

Returns
the uppermost y-coordinate

Definition at line 78 of file BoundingBox.java.

◆ intersectDestructively()

boolean com.google.appinventor.components.runtime.util.BoundingBox.intersectDestructively ( BoundingBox  bb)

Determines whether this bounding box intersects with the passed bounding box and, if so, mutates the bounding box to be the intersection. This was designed to behave the same as android.graphics.Rect#intersect(android.graphics.Rect).

Parameters
bbbounding box to intersect with this bounding box
Returns
true
if they intersect,
false
otherwise

Definition at line 43 of file BoundingBox.java.

◆ toString()

String com.google.appinventor.components.runtime.util.BoundingBox.toString ( )

Definition at line 100 of file BoundingBox.java.


The documentation for this class was generated from the following file: