tinymce.geom.Rect

Contains various tools for rect/position calculation.

Methods

name summary defined by
clamp() Returns a rect clamped within the specified clamp rect. This forces the rect to be inside the clamp rect. tinymce.geom.Rect
create() Creates a new rectangle object. tinymce.geom.Rect
findBestRelativePosition() Tests various positions to get the most suitable one. tinymce.geom.Rect
fromClientRect() Creates a new rectangle object form a clientRects object. tinymce.geom.Rect
inflate() Inflates the rect in all directions. tinymce.geom.Rect
intersect() Returns the intersection of the specified rectangles. tinymce.geom.Rect
relativePosition() Returns the rect positioned based on the relative position name to the target rect. tinymce.geom.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.

Parameters
Return value

create

create(x:Number, y:Number, w:Number, h:Number):Rect

Creates a new rectangle object.

Parameters
Return value

findBestRelativePosition

findBestRelativePosition(rect:Rect, targetRect:Rect, constrainRect:Rect, rels:Array)

Tests various positions to get the most suitable one.

Parameters

fromClientRect

fromClientRect(clientRect:ClientRect):Rect

Creates a new rectangle object form a clientRects object.

Parameters
Return value

inflate

inflate(rect:Rect, w:Number, h:Number):Rect

Inflates the rect in all directions.

Parameters
Return value

intersect

intersect(rect:Rect, cropRect:Rect):Rect

Returns the intersection of the specified rectangles.

Parameters
Return value

relativePosition

relativePosition(rect:Rect, targetRect:Rect, rel:String)

Returns the rect positioned based on the relative position name to the target rect.

Parameters

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.