# Class: FreeTextSelectionModel

## Annotations. FreeTextSelectionModel

A selection model based on the annotation's bounding box. This is used for free text annotations.

#### new FreeTextSelectionModel(annotation, canModify, isSelected)

  Creates a free text selection model.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `annotation` | Annotations.Annotation | the annotation
  `canModify` | boolean | indicates if the annotation can be modified
  `isSelected` | boolean |

### Extends

- Annotations.BoxSelectionModel

### Members

#### defaultNoPermissionSelectionOutlineColor

  Defines the default color for the annotation selection outline when the user is not permitted to make modifications.

  Inherited From:
    - Annotations.SelectionModel#defaultNoPermissionSelectionOutlineColor

#### defaultSelectionOutlineColor

  Defines the default color for the annotation selection outline.

  Inherited From:
    - Annotations.SelectionModel#defaultSelectionOutlineColor

#### selectionAccuracyPadding

  Defines a padding for selection accuracy. Default is 2. Increase this value to make selection more forgiving.

  Inherited From:
    - Annotations.SelectionModel#selectionAccuracyPadding

#### selectionOutlineDashSize

  Defines the dash size for the selection outline. Default is 4;

  Inherited From:
    - Annotations.SelectionModel#selectionOutlineDashSize

#### selectionOutlineThickness

  Defines thickness of the annotation selection outline. Default is 2.

  Inherited From:
    - Annotations.SelectionModel#selectionOutlineThickness

### Methods

#### canModify()

  Indicates that the associated annotation is able to be modified

  Inherited From:
    - Annotations.SelectionModel#canModify

  ##### 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
  --- | --- | ---
  `ctx` | CanvasRenderingContext2D |
  `annotation` | Annotations.Annotation |
  `zoom` | number |

  Inherited From:
    - Annotations.SelectionModel#drawSelectionOutline

#### getControlHandles()

  Returns the ControlHandle objects associated with this selection model.

  Inherited From:
    - Annotations.SelectionModel#getControlHandles

  ##### Returns:

  an array of ControlHandleObject

  Type
    Array.<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
  --- | --- | ---
  `annotation` | Annotations.Annotation |

  Inherited From:
    - Annotations.SelectionModel#getDimensions

  ##### Returns:

  Type
    Annotations.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:
    - Annotations.SelectionModel#isSelected

  ##### Returns:

  Type
    Boolean

#### testControlHandles(annotation, zoom, x, y)

  Hit detection for each control handle.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `annotation` | Annotations.Annotation |
  `zoom` | number |
  `x` | number |
  `y` | number |

  Inherited From:
    - Annotations.SelectionModel#testControlHandles

  ##### Returns:

  the control handle that was hit

  Type
    Annotations.ControlHandle

#### testSelection(annotation, x, y, pageMatrix, zoom, rotation)

  Determines if the provided point is a hit on the selected annotationhandle.

  - See Annotations.SelectionAlgorithm for usuable selection algorithms.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `annotation` | Annotations.Annotation | the 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
  `pageMatrix` | object | the page matrix of the page the annotation is on
  `zoom` | number | the zoom level of the page the annotation is on
  `rotation` | CoreControls.PageRotation | the rotation of the page the annotation is on

  Inherited From:
    - Annotations.SelectionModel#testSelection

  ##### Returns:

  true if the provided point is a hit

  Type
    boolean

#### Search results