Represents static utility functions to determine hit testing for annotations.
Properties:
| Name | Type | Default | Description |
|---|---|---|---|
canvasVisibilityPadding |
number | 5 | Defines a padding for the canvas visibility test algorithm. Increase this value to make selection more forgiving. |
Methods
-
boundingRectTest(annotation, x, y, zoom)
-
Tests if the provided x and y coordinate is within the annotation's bounding rectangle (x, y, width, height).
Parameters:
Name Type Description annotationCore.Annotations.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 zoomnumber the zoom level to use in the calculation if the annotation has a no zoom property Returns:
true if the provided point is a hit on the annotation- Type
- boolean
-
canvasVisibilityTest(annotation, x, y)
-
Tests if the provided x and y coordinate is a visible point on the canvas.
Parameters:
Name Type Description annotationCore.Annotations.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 Returns:
true if the provided point is a hit on the annotation- Type
- boolean
-
insidePolygonTest(annotation, x, y, pageMatrix, zoom)
-
Tests if the provided x and y coordinate is inside of the provided polygon annotation
Parameters:
Name Type Description annotationCore.Annotations.PolygonAnnotation The polygon 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 for the page that the annotation is on. zoomnumber The zoom level to use in the calculation if the annotation has a no zoom property -
textQuadTest(annotation, x, y)
-
Tests if the provided x and y coordinate is within a text Quad of the provided text-based annotation.
Parameters:
Name Type Description annotationCore.Annotations.TextMarkupAnnotation the text markup 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 Returns:
true if the provided point is a hit on the annotation- Type
- boolean