ASP.NET MVC Controls | ComponentOne
In This Topic
    Rect Class
    In This Topic
    File
    wijmo.js
    Module
    wijmo

    Class that represents a rectangle (with left, top, width, and height).

    Constructor

    constructor

    constructor(left: number, top: number, width: number, height: number): Rect
    

    Initializes a new instance of the Rect class.

    Parameters
    Returns
    Rect

    Properties

    bottom

    Gets the bottom coordinate of this Rect.

    Type
    number

    height

    Gets or sets the height of this Rect.

    Type
    number

    left

    Gets or sets the left coordinate of this Rect.

    Type
    number

    top

    Gets or sets the top coordinate of this Rect.

    Type
    number

    width

    Gets or sets the width of this Rect.

    Type
    number

    Methods

    clone

    clone(): Rect
    

    Creates a copy of this Rect.

    Returns
    Rect

    contains

    contains(pt: any): boolean
    

    Determines whether the rectangle contains a given point or rectangle.

    Parameters
    Returns
    boolean

    equals

    equals(rc: Rect): boolean
    

    Returns true if a Rect has the same coordinates and dimensions as this Rect.

    Parameters
    Returns
    boolean

    Static fromBoundingRect

    fromBoundingRect(rc: any): Rect
    

    Creates a Rect from ClientRect or SVGRect objects.

    Parameters
    • rc: any

      Rectangle obtained by a call to the DOM's getBoundingClientRect or GetBoundingBox methods.

    Returns
    Rect

    inflate

    inflate(dx: number, dy: number, rectWidth?: number, rectHeight?: number): Rect
    

    Creates a rectangle that results from expanding or shrinking a rectangle by the specified amounts.

    Parameters
    • dx: number

      The amount by which to expand or shrink the left and right sides of the rectangle.

    • dy: number

      The amount by which to expand or shrink the top and bottom sides of the rectangle.

    • rectWidth: number Optional
    • rectHeight: number Optional
    Returns
    Rect

    Static intersection

    intersection(rc1: Rect, rc2: Rect): Rect
    

    Gets a rectangle that represents the intersection of two rectangles.

    Parameters
    • rc1: Rect

      First rectangle.

    • rc2: Rect

      Second rectangle.

    Returns
    Rect

    Static union

    union(rc1: Rect, rc2: Rect): Rect
    

    Gets a rectangle that represents the union of two rectangles.

    Parameters
    • rc1: Rect

      First rectangle.

    • rc2: Rect

      Second rectangle.

    Returns
    Rect