new RotationUtils()
The namespace for utility functions for annotation rotation.
Methods
-
getRotatedBoundingBoxRectFromRectangularAnnotations(unrotatedDimensions, angle, rotationPoint)
-
Parameters:
Name Type Description unrotatedDimensionsObject An object with the annotation's unrotated dimensions (X, Y, Width and Height). anglenumber The angle (radians) that the annotation in rotated. rotationPointCore.Math.Point The pivot point for which the annotation is rotated on. Returns:
The rect representing the rotated annotation's bounding box.- Type
- Core.Math.Rect
-
getRotatedPointsArray(pointsArray, angle, rotationPoint)
-
Parameters:
Name Type Description pointsArrayArray.<Core.Math.Point> An array containing the points to be rotated. anglenumber The angle to rotate the points. rotationPointCore.Math.Point The pivot point around which the points in the array will be rotated. Returns:
An array containing the rotated points.- Type
- Array.<Core.Math.Point>
-
getRotationAngleInDegreesByRadians(angleInRadians)
-
Parameters:
Name Type Description angleInRadiansnumber The angle in radians. Returns:
The angle in degrees.- Type
- number
-
getRotationAngleInRadiansByDegrees(angleInDegrees)
-
Parameters:
Name Type Description angleInDegreesnumber The angle in degrees. Returns:
The angle in radians.- Type
- number
-
getUnrotatedDimensionsFromRectangularAnnotations(rect, angle)
-
Parameters:
Name Type Description rectCore.Math.Rect The rect representing the rotated annotation's bounding box. anglenumber The angle that the annotation in rotated. Returns:
An object with the annotation's unrotated dimensions (X, Y, Width and Height).- Type
- Object
-
normalizeAngle(angleInRadians)
-
Parameters:
Name Type Description angleInRadiansnumber The angle in radians. Returns:
The normalized angle (between 0 and 2*PI) in radians.- Type
- number
-
PathCustomAnnotationRotationMixin()
-
Adds the following methods to a class:
- rotate: Changes the Rotation property of the annotation, Updates the annotation path and updates the bounding box.
- adjustRect: Adjusts the annotation's bounding box.
- serialize / deserialize: Make sure the annotation gets correctly saved into the PDF when downloading the document and that it will load fine.
- setPath: Updates the annotation's path (Array of points)
- getPath: returns the annotation's path (Array of points)
-
RectangularCustomAnnotationRotationMixin()
-
Adds the following methods to a class:
- rotate: Changes the Rotation property of the annotation and updates the bounding box.
- getUnrotatedDimensions: Calculates the correct dimension for drawing.
- getRotatedAnnotationBoundingBoxRect: Calculates the bounding box dimensions.
- serialize / deserialize: Make sure the annotation gets correctly saved into the PDF when downloading the document and that it will load fine.