Namespace: SelectionAlgorithm

Annotations. SelectionAlgorithm

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
annotation Annotations.Annotation
x number the x-coordinate of the point to test, in page coordinates
y number the y-coordinate of the point to test, in page coordinates
zoom number 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
annotation Annotations.Annotation
x number the x-coordinate of the point to test, in page coordinates
y number 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

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
annotation Annotations.TextMarkupAnnotation the text markup annotation
x number the x-coordinate of the point to test, in page coordinates
y number 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