Skip to content
hhh edited this page Jan 4, 2022 · 7 revisions

Bounds

/**
 * The class of node bounds.
 */
class Bounds {

    /**
     * The left most of the bounds.
     */
    left: number;

    /**
     * The top most of the bounds.
     */
    top: number;

    /**
     * The width of the bounds.
     */
    width: number;

    /**
     * The height of the bounds.
     */
    height: number;

    /**
     * Get the right most of the bounds.
     */
    get right(): number;

    /**
     * Set the right most of the bounds.
     */
    set right(right: number);

    /**
     * Get the bottom most of the bounds.
     */
    get bottom(): number;

    /**
     * Set the bottom most of the bounds.
     */
    set bottom(bottom: number);

    /**
     * Returns `true` if the given position is inside the bounds.
     */
    containsPoint(x: number, y: number): boolean;

    /**
     * Returns `true` the given bounds overlaps this one.
     */
    overlaps(bounds: Bounds): boolean;
}

Documentation of canvasom

Clone this wiki locally