Back to Website
Show / Hide Table of Contents

Class CanvasRenderer

Package: @aurigma/design-atoms

Constructors

(constructor)(_selection, _dndHandler, handlerConfiguration, _rubberbandHandler, _viewportHandler, _spotlightHandler, _hoverHandler, _snapLinesHandler, _canvasElementHandler, _interactiveZonesHandler)

Constructs a new instance of the CanvasRenderer class

Declaration
constructor(_selection: ISelectionHandler, _dndHandler: IDragNDropHandler, handlerConfiguration: IHandlersConfiguration, _rubberbandHandler: RubberbandHandler, _viewportHandler: IViewportHandler, _spotlightHandler: SpotlightHandler, _hoverHandler: IHoverHandler, _snapLinesHandler: ISnapLinesHandler, _canvasElementHandler: ICanvasElementHandler, _interactiveZonesHandler: IInteractiveZonesHandler);
Parameters
Type Name Description
ISelectionHandler _selection
IDragNDropHandler _dndHandler
IHandlersConfiguration handlerConfiguration
RubberbandHandler _rubberbandHandler
IViewportHandler _viewportHandler
SpotlightHandler _spotlightHandler
IHoverHandler _hoverHandler
ISnapLinesHandler _snapLinesHandler
ICanvasElementHandler _canvasElementHandler
IInteractiveZonesHandler _interactiveZonesHandler

Properties

conf

Declaration
set conf(conf: IHandlersConfiguration);
Property Value
Type Description
IHandlersConfiguration

previewMode

Declaration
previewMode: boolean;
Property Value
Type Description
boolean

style

Declaration
style: CanvasRendererStyle;
Property Value
Type Description
CanvasRendererStyle

textRenderer

Declaration
set textRenderer(value: TextRenderer);
Property Value
Type Description
TextRenderer

Methods

applyContextScale(renderingContext, workspace, offset, clipByWorkspace)

Declaration
applyContextScale(renderingContext: CanvasRenderingContext2D, workspace: IWorkspace, offset: PointF, clipByWorkspace?: boolean): CanvasRenderingContext2D;
Parameters
Type Name Description
CanvasRenderingContext2D renderingContext
IWorkspace workspace
PointF offset
boolean clipByWorkspace
Returns
Type Description
CanvasRenderingContext2D

clearTextCursor(canvas)

Declaration
clearTextCursor(canvas: HTMLCanvasElement): void;
Parameters
Type Name Description
HTMLCanvasElement canvas
Returns
Type Description
void

drawRubberband(context, rubberband, offset)

Declaration
drawRubberband(context: CanvasRenderingContext2D, rubberband: Rubberband, offset: PointF): void;
Parameters
Type Name Description
CanvasRenderingContext2D context
Rubberband rubberband
PointF offset
Returns
Type Description
void

drawTextCursor(canvas, itemHandler, callback, workspace, mul, offset)

Declaration
drawTextCursor(canvas: HTMLCanvasElement, itemHandler: BaseRectangleItemHandler, callback: (context: CanvasRenderingContext2D) => void, workspace: IWorkspace, mul: number, offset: PointF): void;
Parameters
Type Name Description
HTMLCanvasElement canvas
BaseRectangleItemHandler itemHandler
(context: CanvasRenderingContext2D) => void callback
IWorkspace workspace
number mul
PointF offset
Returns
Type Description
void

drawWaitClock(context, center, mul)

Declaration
drawWaitClock(context: CanvasRenderingContext2D, center: PointF, mul: number): void;
Parameters
Type Name Description
CanvasRenderingContext2D context
PointF center
number mul
Returns
Type Description
void

redrawActiveCanvas(layers, activeCanvas, workspace, productHandler, offset)

Declaration
redrawActiveCanvas(layers: Layer[], activeCanvas: HTMLCanvasElement, workspace: IWorkspace, productHandler: IProductHandler, offset: PointF): void;
Parameters
Type Name Description
Layer[] layers
HTMLCanvasElement activeCanvas
IWorkspace workspace
IProductHandler productHandler
PointF offset
Returns
Type Description
void

redrawActiveTextCanvas(context, layers)

Declaration
redrawActiveTextCanvas(context: ITextEditorContext, layers: Layer[]): void;
Parameters
Type Name Description
ITextEditorContext context
Layer[] layers
Returns
Type Description
void

redrawInactiveCanvas(layers, surfaceCanvas, inactiveCanvas, workspace, margins, mul, productHandler, offset, mockupMarginWorkaroundEnabled)

Declaration
redrawInactiveCanvas(layers: Layer[], surfaceCanvas: HTMLCanvasElement, inactiveCanvas: HTMLCanvasElement, workspace: IWorkspace, margins: IMargins, mul: number, productHandler: IProductHandler, offset: PointF, mockupMarginWorkaroundEnabled?: boolean): void;
Parameters
Type Name Description
Layer[] layers
HTMLCanvasElement surfaceCanvas
HTMLCanvasElement inactiveCanvas
IWorkspace workspace
IMargins margins
number mul
IProductHandler productHandler
PointF offset
boolean mockupMarginWorkaroundEnabled
Returns
Type Description
void

redrawSelectionCanvas(designCanvas, workspace, style, textContext, viewer, contentAngle, offset, drawShadow, drawSnapLines)

Declaration
redrawSelectionCanvas(designCanvas: HTMLCanvasElement, workspace: IWorkspace, style: CanvasRendererStyle, textContext: ITextLimitsContext & ITextEditorContext & ITranslationsContext, viewer: IViewportContext & IWorkspaceContext & IRulersContext, contentAngle: number, offset: PointF, drawShadow?: boolean, drawSnapLines?: boolean): void;
Parameters
Type Name Description
HTMLCanvasElement designCanvas
IWorkspace workspace
CanvasRendererStyle style
ITextLimitsContext & ITextEditorContext & ITranslationsContext textContext
IViewportContext & IWorkspaceContext & IRulersContext viewer
number contentAngle
PointF offset
boolean drawShadow
boolean drawSnapLines
Returns
Type Description
void

setLoadingImageUrl(url)

Declaration
setLoadingImageUrl(url: string): void;
Parameters
Type Name Description
string url
Returns
Type Description
void

setTextWhizzModule(textWhizz)

Declaration
setTextWhizzModule(textWhizz: typeof TextWhizz): void;
Parameters
Type Name Description
typeof TextWhizz textWhizz
Returns
Type Description
void
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback