# Class: PolygonControlHandle

## Core.Annotations. PolygonControlHandle

A control handle that manipulates path-based annotations (Core.Annotations.IPathAnnotation) by moving the points in the path. The annotation must implement the getPath() method.

#### new PolygonControlHandle(x, y, width, height, pathIndex)

  Creates a polygon 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

- Core.Annotations.PathControlHandle

### Methods

#### draw(ctx, annotation, selectionBox, zoom)

  Draws the control handle's appearance on the provided canvas context

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ctx` | CanvasRenderingContext2D | the annotation canvas context
  `annotation` | Core.Annotations.Annotation | the annotation to modify
  `selectionBox` | Core.Math.Rect | the selection rect
  `zoom` | number | the current zoom level of the document

  Inherited From:
    - Core.Annotations.ControlHandle#draw

#### testSelection(annotation, selectionBox, zoom, x, y)

  Determines if the provided point is a hit on the control handle. See Core.Annotations.SelectionAlgorithm for usuable selection algorithms.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `annotation` | Core.Annotations.Annotation | the annotation
  `selectionBox` | Core.Math.Rect | the selection rect
  `zoom` | number | the current zoom level of the document
  `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

  Inherited From:
    - Core.Annotations.ControlHandle#testSelection

  ##### Returns:

  true if the provided point is a hit
  Type
    boolean

#### Search results