tinymce.geom.Rect
Contains various tools for rect/position calculation.
Summary
Methods
Name | Summary | Defined by |
---|---|---|
Returns a rect clamped within the specified clamp rect. This forces the rect to be inside the clamp rect. |
||
Creates a new rectangle object. |
||
Tests various positions to get the most suitable one. |
||
Creates a new rectangle object form a clientRects object. |
||
Inflates the rect in all directions. |
||
Returns the intersection of the specified rectangles. |
||
Returns the rect positioned based on the relative position name to the target rect. |
Methods
clamp()
clamp(rect: Rect, clampRect: Rect, fixedSize: Boolean): Rect
Returns a rect clamped within the specified clamp rect. This forces the rect to be inside the clamp rect.
create()
create(x: Number, y: Number, w: Number, h: Number): Rect
Creates a new rectangle object.
findBestRelativePosition()
findBestRelativePosition(rect: Rect, targetRect: Rect, constrainRect: Rect, rels: Array)
Tests various positions to get the most suitable one.
fromClientRect()
fromClientRect(clientRect: ClientRect): Rect
Creates a new rectangle object form a clientRects object.
inflate()
inflate(rect: Rect, w: Number, h: Number): Rect
Inflates the rect in all directions.
intersect()
intersect(rect: Rect, cropRect: Rect): Rect
Returns the intersection of the specified rectangles.