Home Manual Reference Source Repository
import {RenderableArea} from 'ug-layout/dom/RenderableArea'
public class | source

RenderableArea

A class that defines an area in pixels.

Constructor Summary

Public Constructor
public

constructor(_x: number, _x2: number, _y: number, _y2: number)

Member Summary

Public Members
public get

The height of the area.

public get

The surface of the area.

public get

The width of the area.

public get

The left x position.

public set

x: *

public set

x2: *

public get

The right x position.

public get

The top y position.

public set

y: *

public get

The bottom y position.

public set

y2: *

Method Summary

Public Methods
public

Clamps a value to the x axis bounds.

public

Clamps a value to the y axis bounds.

Public Constructors

public constructor(_x: number, _x2: number, _y: number, _y2: number) source

Params:

NameTypeAttributeDescription
_x number
  • optional
  • default: 0
_x2 number
  • optional
  • default: 0
_y number
  • optional
  • default: 0
_y2 number
  • optional
  • default: 0

Public Members

public get height: number source

The height of the area.

public get surface: number source

The surface of the area.

public get width: number source

The width of the area.

public get x: number source

The left x position.

public set x: * source

public set x2: * source

public get x2: number source

The right x position.

public get y: number source

The top y position.

public set y: * source

public get y2: number source

The bottom y position.

public set y2: * source

Public Methods

public clampX(x: number): number source

Clamps a value to the x axis bounds. (x, x2)

Params:

NameTypeAttributeDescription
x number

Return:

number

public clampY(y: number): number source

Clamps a value to the y axis bounds. (y, y2)

Params:

NameTypeAttributeDescription
y number

Return:

number