Class AbstractRendererAbstract

Abstract base class for renderers.

Hierarchy (view full)

Constructors

Properties

objectLevel: number = 0

Methods

  • Strokes a rectangle. Boundary lines have width [lineWidth] and are filled with [lineFill]. This is equivalent to drawPath(Path.fromRect(...).toRenderable(...)).

    Parameters

    Returns void

  • Notes the end of an object.

    Parameters

    • Optional_loaderData: LoadSaveDataTable

      a map from strings to JSON-ifyable objects and contains properties attached to the object by whatever loader loaded the image. This is used to preserve attributes not supported by js-draw when loading/saving an image. Renderers may ignore this.

    • Optional_objectTags: string[]

      a list of labels (e.g. classNames) to be attached to the object. Renderers may ignore this.

    Returns void

  • Returns the region in canvas space that is visible within the viewport this canvas is rendering to.

    Note that in some cases this might not be the same as the visibleRect given to components in their render method.

    Returns Rect2

  • This should be called whenever a new object is being drawn.

    Parameters

    • _boundingBox: Rect2

      The bounding box of the object to be drawn.

    • Optional_clip: boolean

      Whether content outside _boundingBox should be drawn. Renderers that override this method are not required to support _clip.

    Returns void

OpenSource licenses