Class: RectangleTool

OSDPaperjsAnnotation.RectangleTool(paperScope)

The RectangleTool class extends the AnnotationUITool and provides functionality for creating and modifying rectangles.

Constructor

new RectangleTool(paperScope)

This tool provides users with the ability to create new rectangles by clicking and dragging on the canvas, as well as modifying existing rectangles by resizing and moving them. It offers options to control the shape and position of the rectangles, making it a versatile tool for annotating and highlighting areas of interest.
Parameters:
Name Type Description
paperScope paper.PaperScope The Paper.js scope for the tool.
Properties:
Name Type Description
mode string The current mode of the RectangleTool.
creating paper.Path.Rectangle | null The currently creating rectangle.
refPoint paper.Point | null The reference point used for resizing rectangles.
ctrlPoint paper.Point | null The control point used for resizing rectangles.
Source:

Extends

  • AnnotationUITool

Classes

RectToolbar

Members

creating :paper.Path.Rectangle|null

The currently creating rectangle during the drawing process.
Type:
  • paper.Path.Rectangle | null
Source:

mode :string

The current mode of the RectangleTool, which can be 'creating', 'corner-drag', 'fill-drag', or 'modifying'.
Type:
  • string
Source: