Rectangle2D constructor

Rectangle2D(
  1. Point2D origin,
  2. Size2D size
)

Creates a new instance.

  • origin The origin specifies the top-left corner of the rectangle. When this point is used to indicate the coordinates on a view, then (0,0) will mark the top-left corner of the view. The size determines the width and height of the rectangle. The width expands towards the right of the view. The height expands towards the bottom of the view.
  • size The size specifies the width and height of the rectangle.

Implementation

Rectangle2D(this.origin, this.size);