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


<static> boundingRectTest(annotation, x, y)

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

Returns:

true if the provided point is a hit on the annotation

Type
Boolean

<static> 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

<static> 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