Skip to main content

Math

Namespaces

Interfaces

ISize

Properties

height
height: number;
width
width: number;

Functions

alignRectToRect()

function alignRectToRect(
sourceRect,
targetRect,
horizontalAlignment,
verticalAlignment,
): any;

Parameters

ParameterType
sourceRectRotatedRectangleF
targetRectRotatedRectangleF
horizontalAlignmentHorizontalOriginPointType
verticalAlignmentVerticalOriginPointType

Returns

any


clamp()

function clamp(value, min, max): number;

Clamps a value to a range [min, max].

Parameters

ParameterTypeDescription
valuenumberThe value for clamping.
minnumberThe minimum values. If the input value is less than this value, the output will be this value.
maxnumberThe maximum value. If the input value is more than this value, the output will be this value.

Returns

number


fitRectangleToRectangle()

function fitRectangleToRectangle(
fittingRect,
targetRect,
resizeType?,
originX?,
originY?,
): any;

Parameters

ParameterTypeDefault value
fittingRectRectangleFundefined
targetRectRectangleFundefined
resizeTypeanyResizeRectangleType.Fit
originXHorizontalOriginPointTypeOriginPointType.Center
originYVerticalOriginPointTypeOriginPointType.Center

Returns

any


fitSizeToSize()

function fitSizeToSize(fittingSize, targetSize, resizeType?): ISize;

Parameters

ParameterTypeDefault value
fittingSizeISizeundefined
targetSizeISizeundefined
resizeTypeanyResizeRectangleType.Fit

Returns

ISize


getOriginCoordinate()

function getOriginCoordinate(rect, originX, originY): any;

Parameters

ParameterType
rectRectangleF
originXOriginPointType
originYOriginPointType

Returns

any


getRectPoint()

function getRectPoint(rect, horizontal, vertical): any;

Parameters

ParameterType
rectRotatedRectangleF
horizontalHorizontalOriginPointType
verticalVerticalOriginPointType

Returns

any


getResizedImageAxisDpi()

function getResizedImageAxisDpi(sourceSize, sourceDpi, targetSize): number;

Parameters

ParameterType
sourceSizenumber
sourceDpinumber
targetSizenumber

Returns

number


getResizedImageMinAxisDpi()

function getResizedImageMinAxisDpi(
sourceWidth,
sourceHeight,
sourceDpiX,
sourceDpiY,
targetWidth,
targetHeight,
): number;

Parameters

ParameterType
sourceWidthnumber
sourceHeightnumber
sourceDpiXnumber
sourceDpiYnumber
targetWidthnumber
targetHeightnumber

Returns

number


getRotatedRectangleWithBorder()

function getRotatedRectangleWithBorder(rectangle, border): any;

Parameters

ParameterType
rectangleRotatedRectangleF
borderILtrb

Returns

any


getTranslationTransform()

function getTranslationTransform(source, target): Transform;

Parameters

ParameterType
sourcePointF
targetPointF

Returns

Transform


mapToRange()

function mapToRange(value, oldMin, oldMax, newMin, newMax): number;

Maps the given value from the range [oldMin, oldMax] to the range [newMin, newMax]. Where each min is less than corresponding max.

Parameters

ParameterTypeDescription
valuenumberThe value to map.
oldMinnumberThe minimum value of the old range. Must be less than oldMax.
oldMaxnumberThe maximum value of the old range. Must be greater than oldMin.
newMinnumberThe minimum value of the new range. Must be less than newMax.
newMaxnumberThe maximum value of the new range. Must be greater than newMin.

Returns

number


minByAbs()

function minByAbs(...values): number;

Parameters

ParameterType
...valuesnumber[]

Returns

number


rectangleEquals()

function rectangleEquals(rec1, rec2, tolerance?): any;

Parameters

ParameterType
rec1RectangleF
rec2RectangleF
tolerance?number

Returns

any


snapValueToStep()

function snapValueToStep(oldVal, newVal, step): number;

Parameters

ParameterType
oldValnumber
newValnumber
stepnumber

Returns

number

Was this page helpful?