new PathSelectionModel(annotation, canModify)
Creates a path selection model.
Parameters:
| Name | Type | Description |
|---|---|---|
annotation |
Core.Annotations.Annotation | the annotation |
canModify |
boolean | indicates if the annotation can be modified |
Extends
Methods
-
canModify()
-
Indicates that the associated annotation is able to be modified
- Inherited From:
Returns:
- Type
- boolean
-
drawSelectionOutline(ctx, annotation, zoom)
-
Draws the selection outline of the annotation. By default, a rectangle is drawn based on the annotations x, y, width and height.
Parameters:
Name Type Description ctxCanvasRenderingContext2D annotationCore.Annotations.Annotation zoomnumber - Inherited From:
-
getControlHandles()
-
Returns the ControlHandle objects associated with this selection model.
- Inherited From:
Returns:
An array of ControlHandleObject- Type
- Array.<Core.Annotations.ControlHandle>
-
getDimensions(annotation)
-
Gets the dimensions {x, y, width, height} of the selection bounding box. It may be different from the annotation's bounding box. e.g. The selection bounding box may have a padding.
Parameters:
Name Type Description annotationCore.Annotations.Annotation - Inherited From:
Returns:
- Type
- Core.Math.Rect
-
isSelected()
-
Indicates that the associated annotation is already selected. This can be useful to implement different selection behaviors when an annotation is selected.
- Inherited From:
- Overrides:
Returns:
- Type
- boolean
-
testControlHandles(annotation, zoom, x, y)
-
Hit detection for each control handle.
Parameters:
Name Type Description annotationCore.Annotations.Annotation zoomnumber xnumber ynumber - Inherited From:
Returns:
The control handle that was hit -
testSelection(annotation, x, y, pageMatrix, zoom, rotation)
-
Determines if the provided point is a hit on the selected annotationhandle. * See Core.Annotations.SelectionAlgorithm for usuable selection algorithms.
Parameters:
Name Type Description annotationCore.Annotations.Annotation the annotation xnumber the x-coordinate of the point to test, in page coordinates ynumber the y-coordinate of the point to test, in page coordinates pageMatrixobject the page matrix of the page the annotation is on zoomnumber the zoom level of the page the annotation is on rotationCore.PageRotation the rotation of the page the annotation is on - Inherited From:
Returns:
true if the provided point is a hit- Type
- boolean