Skip to main content

Class: RectGL

Rendering.WebGL.RectGL(x, y, width, height)

Represents rectangle in math coordinate system, used by WebGL

Constructor

new RectGL(x, y, width, height)

Parameters:
NameTypeDescription
xfloatMath coordinate system x
yfloatMath coordinate system y
widthfloatRect width
heightfloatRect height
Properties:
NameTypeDescription
leftfloatx coordinate
xfloatleft alias
bottomfloaty coordinate
yfloatbottom alias
rightfloatx + width
topfloaty + height
widthfloatrect width
heightfloatrect height

Methods

ceil(evenopt) → Rendering.WebGL.RectGL

Floor LeftBottom, Ceil RightTop points

Parameters:
NameTypeAttributesDefaultDescription
evenboolean<optional>falseRect width and height will be multiples of 2
Returns:

ceiling result

Type

Rendering.WebGL.RectGL

floor() → Rendering.WebGL.RectGL

Ceil LeftBottom, Floor RightTop points

Returns:

flooring result

Type

Rendering.WebGL.RectGL

intersect(rect) → Rendering.WebGL.RectGL

Intersects 2 rects

Parameters:
NameTypeDescription
rectRendering.WebGL.RectGLintersect with area
Returns:

intersection result

Type

Rendering.WebGL.RectGL

transform(matrix) → Common.Rect

Transform rect. Result rect is bounds of transformed edges.

Parameters:
NameTypeDescription
matrixCommon.MatrixTransform matrix
Returns:

Transformed rect

Type

Common.Rect

union(rect) → Rendering.WebGL.RectGL

Union 2 rects

Parameters:
NameTypeDescription
rectRendering.WebGL.RectGLunion with area
Returns:

union result

Type

Rendering.WebGL.RectGL

(static) calculateBrushGLSegmentBounds(point, scatteringopt, transform) → Rendering.WebGL.RectGL

Calculates segment bounds

Parameters:
NameTypeAttributesDefaultDescription
pointPathBuilding.PathPoint
scatteringfloat<optional>0
transformCommon.Matrix
Returns:

new instance

Type

Rendering.WebGL.RectGL

(static) ofEdges(left, bottom, right, top) → Rendering.WebGL.RectGL

Creates new instance

Parameters:
NameTypeDescription
leftfloat
bottomfloat
rightfloat
topfloat
Returns:

new instance

Type

Rendering.WebGL.RectGL

Home