Class PolygonDrawer

This is an abstract class that Shapes have to extend that to insert or draw their own

Example

editor.board.shapes.circle.insert({
x: 100,
y: 100,
radius: 10,
fill: 'red'
})

Example

editor.board.shapes.circle.draw()

Example

editor.board.shapes.circle.stopDrawing()

Hierarchy (view full)

Constructors

Properties

config: Partial<RegularPolygonConfig>

Reperesents the configuration of the shape that is drawing that

node: RegularPolygon

Demonstrates the polygon node that is being created

startPoint: Point

Reperesents the start point of the drawing shape

Accessors

  • get isDrawing(): boolean
  • Checks wheather the current shape is drawing or not

    Returns boolean

Methods

  • Enables the drawing mode

    Parameters

    • config: Partial<RegularPolygonConfig> = {}

      The initial [[ShapeModel]] config

    Returns void

  • Returns current position of the shape

    Returns {
        x: number;
        y: number;
    }

    the current position of the shape as a [[Point]]

    • x: number
    • y: number
  • Creates a new shape and insert that into the [[Board]]

    Parameters

    • config: RegularPolygonConfig

      The [[ShapeModel]] configuration

    Returns PolygonModel

    The created [[ShapeModel]]