new PathControlHandle(x, y, width, height, pathIndex)
Creates a path control handle.
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | the x coordinate of the point |
y |
number | the y coordinate of the point |
width |
number | the width of the handle |
height |
number | the height of the handle |
pathIndex |
number | the index of the point in the path array |
Extends
Members
-
handleHeight
-
Defines the height of all control handles. Default is 8.
- Inherited From:
-
handleWidth
-
Defines the width of all control handles. Default is 8.
- Inherited From:
-
selectionAccuracyPadding
-
Defines a padding for selection accuracy. Default is 1. Increase this value to make selection more forgiving.
- Inherited From:
Methods
-
draw(ctx, annotation, selectionBox, zoom)
-
Draws the control handle's appearance on the provided canvas context
Parameters:
Name Type Description ctxCanvasRenderingContext2D the annotation canvas context
annotationAnnotations.Annotation the annotation to modify
selectionBoxAnnotations.Rect the selection rect
zoomdouble the current zoom level of the document
- Inherited From:
-
getDimensions(selectionBox)
-
Gets the dimensions of the control handle
Parameters:
Name Type Description selectionBoxAnnotations.Rect the selection rect
- Inherited From:
-
move(annotation, deltaX, deltaY, fromPoint, toPoint)
-
The method invoked when a control handle is moved. Override the method to provide custom behavior to control handles.
Parameters:
Name Type Description annotationAnnotations.Annotation the annotation to modify
deltaXnumber the change in x-coordinate
deltaYnumber the change in y-coordinate
fromPointAnnotations.Point the original page point (on mouse down)
toPointAnnotations.Point the current page point
- Inherited From:
Returns:
return true if a redraw operation is necessary
- Type
- boolean
-
testSelection(annotation, selectionBox, zoom, x, y)
-
Determines if the provided point is a hit on the control handle. See Annotations.SelectionAlgorithm for usuable selection algorithms.
Parameters:
Name Type Description annotationAnnotations.Annotation the annotation
selectionBoxAnnotations.Rect the selection rect
zoomnumber the current zoom level of the document
xnumber the x-coordinate of the point to test, in page coordinates
ynumber the y-coordinate of the point to test, in page coordinates
- Inherited From:
Returns:
true if the provided point is a hit
- Type
- Boolean