From 1fe4a6182303d8c3f0d5ecb2e954347ef6025d6d Mon Sep 17 00:00:00 2001 From: sebastianwitthus <48671930+sebastianwitthus@users.noreply.github.com> Date: Tue, 28 May 2019 20:53:10 +0200 Subject: [PATCH] fabric: Add freeDrawingBrush to StaticCanvas. (#35778) * Add freeDrawingBrush. Add freedrawingBrush property to StaticCanvas class and accompanying FreeDrawingBrush interface. * Fix whitespace and implicit public. * Remove 'public' modifiers on FreeDrawingBrush * Remove implicit public and whitespace -> tab. --- types/fabric/fabric-impl.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index ff037f74b6..2396d24121 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1070,6 +1070,19 @@ interface IStaticCanvasOptions { */ svgViewportTransformation?: boolean; } + +export interface FreeDrawingBrush { + /** + * Can be any regular color value. + */ + color: string; + + /** + * Brush width measured in pixels. + */ + width: number; +} + export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation { } export class StaticCanvas { /** @@ -1082,6 +1095,8 @@ export class StaticCanvas { _activeObject?: Object | Group; + freeDrawingBrush: FreeDrawingBrush; + /** * Calculates canvas element offset relative to the document * This method is also attached as "resize" event handler of window