# Rectangle

class Markup.Shapes.Rectangle()

  Represents a rectangle defined by a position and a size.

Constructors

- `constructor()`

Methods

- `getBorderRadius()`

- `getFillColor()`

- `getFillOpacity()`

- `getPosition()`

- `getSize()`

- `getStrokeColor()`

- `getStrokeWidth()`

- `setBorderRadius()`

- `setFillColor()`

- `setFillOpacity()`

- `setPosition()`

- `setSize()`

- `setStrokeColor()`

- `setStrokeWidth()`

## Constructors

Rectangle.constructor([position[, size]])
  Arguments

    - position (`Point2()`) – optional the screen space position of the top left of the rectangle.

    - size (`Point2()`) – optional the point object representing the width and height of the rectangle in pixels.

  Creates a new rectangle markup item

  Return type

    Rectangle

## Methods

### getBorderRadius

Rectangle.getBorderRadius()

  Gets the border radius for this shape

  Returns

    the border radius

  Return type

    number

### getFillColor

Rectangle.getFillColor()

  Gets the fill color for this shape

  Returns

    the fill color

  Return type

    Color

### getFillOpacity

Rectangle.getFillOpacity()

  Gets the fill opacity for this shape

  Returns

    the fill opacity

  Return type

    number

### getPosition

Rectangle.getPosition()

  Gets rectangle position

  Returns

    the rectangle position

  Return type

    Point2

### getSize

Rectangle.getSize()

  Gets rectangle size

  Returns

    the rectangle size

  Return type

    Point2

### getStrokeColor

Rectangle.getStrokeColor()

  Gets the stroke color for this shape

  Returns

    the stroke color

  Return type

    Color

### getStrokeWidth

Rectangle.getStrokeWidth()

  Gets the stroke width for this shape in pixels

  Returns

    the stroke width in pixels

  Return type

    number

### setBorderRadius

Rectangle.setBorderRadius(borderRadius)
  Arguments

    - borderRadius (`number()`) – the border radius in pixels

  Sets the border radius for this shape

  Return type

    void

### setFillColor

Rectangle.setFillColor(color)
  Arguments

    - color (`Color()`) – the fill color

  Sets the fill color for this shape

  Return type

    void

### setFillOpacity

Rectangle.setFillOpacity(fillOpacity)
  Arguments

    - fillOpacity (`number()`) – the fill opacity

  Sets the fill opacity for this shape

  Return type

    void

### setPosition

Rectangle.setPosition(position)
  Arguments

    - position (`Point2()`) – the top left corner of the rectangle

  Sets the rectanlge position

  Return type

    void

### setSize

Rectangle.setSize(size)
  Arguments

    - size (`Point2()`) – indicating the rectangle width and height

  Sets the rectanlge size

  Return type

    void

### setStrokeColor

Rectangle.setStrokeColor(color)
  Arguments

    - color (`Color()`) – the stroke color

  Sets the stroke color for this shape

  Return type

    void

### setStrokeWidth

Rectangle.setStrokeWidth(strokeWidth)
  Arguments

    - strokeWidth (`number()`) – the stroke width in pixels

  Sets the stroke width for this shape in pixels

  Return type

    void