StaticCanvasOptions
Defined in: src/canvas/StaticCanvasOptions.ts:126
Extends
Section titled “Extends”CanvasDrawableOptions
.CanvasRenderingOptions
.CanvasExportOptions
Extended by
Section titled “Extended by”Properties
Section titled “Properties”allowTouchScrolling
Section titled “allowTouchScrolling”allowTouchScrolling:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:163
Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas It gives PRIORITY to DOM scrolling, it doesn’t make it always possible. If is true, when using a touch event on the canvas, the canvas will scroll if scroll is possible. If we are in drawing mode or if we are selecting an object the canvas preventDefault and so it won’t scroll
Default
Section titled “Default”
move to Canvas
backgroundColor
Section titled “backgroundColor”backgroundColor:
string
|TFiller
Defined in: src/canvas/StaticCanvasOptions.ts:20
Background color of canvas instance.
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.backgroundColor
backgroundImage?
Section titled “backgroundImage?”
optional
backgroundImage:FabricObject
<Partial
<FabricObjectProps
>,SerializedObjectProps
,ObjectEvents
>
Defined in: src/canvas/StaticCanvasOptions.ts:30
Background image of canvas instance. since 2.4.0 image caching is active, please when putting an image as background, add to the canvas property a reference to the canvas it is on. Otherwise the image cannot detect the zoom vale. As an alternative you can disable image objectCaching
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.backgroundImage
backgroundVpt
Section titled “backgroundVpt”backgroundVpt:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:13
if set to false background image is not affected by viewport transform
1.6.3
we should really find a different way to do this
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.backgroundVpt
clipPath?
Section titled “clipPath?”
optional
clipPath:FabricObject
<Partial
<FabricObjectProps
>,SerializedObjectProps
,ObjectEvents
>
Defined in: src/canvas/StaticCanvasOptions.ts:105
a fabricObject that, without stroke define a clipping area with their shape. filled in black the clipPath object gets used when the canvas has rendered, and the context is placed in the top left corner of the canvas. clipPath will clip away controls, if you do not want this to happen use controlsAboveOverlay = true
Inherited from
Section titled “Inherited from”CanvasRenderingOptions.clipPath
controlsAboveOverlay
Section titled “controlsAboveOverlay”controlsAboveOverlay:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:151
Indicates whether object controls (borders/controls) are rendered above overlay image
Default
Section titled “Default”
move to Canvas
enableRetinaScaling
Section titled “enableRetinaScaling”enableRetinaScaling:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:89
When true, canvas is scaled by devicePixelRatio for better rendering on retina screens
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasRenderingOptions.enableRetinaScaling
height
Section titled “height”height:
number
Defined in: src/canvas/StaticCanvasOptions.ts:142
Height in virtual/logical pixels of the canvas. The canvas can be taller than width if retina scaling is active
imageSmoothingEnabled
Section titled “imageSmoothingEnabled”imageSmoothingEnabled:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:96
Indicates whether this canvas will use image smoothing, this is on by default in browsers
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasRenderingOptions.imageSmoothingEnabled
includeDefaultValues
Section titled “includeDefaultValues”includeDefaultValues:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:115
Indicates whether toObject/toDatalessObject should include default values if set to false, takes precedence over the object value.
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasExportOptions.includeDefaultValues
overlayColor
Section titled “overlayColor”overlayColor:
string
|TFiller
Defined in: src/canvas/StaticCanvasOptions.ts:47
Overlay color of canvas instance.
1.3.9
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.overlayColor
overlayImage?
Section titled “overlayImage?”
optional
overlayImage:FabricObject
<Partial
<FabricObjectProps
>,SerializedObjectProps
,ObjectEvents
>
Defined in: src/canvas/StaticCanvasOptions.ts:57
Overlay image of canvas instance. since 2.4.0 image caching is active, please when putting an image as overlay, add to the canvas property a reference to the canvas it is on. Otherwise the image cannot detect the zoom vale. As an alternative you can disable image objectCaching
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.overlayImage
overlayVpt
Section titled “overlayVpt”overlayVpt:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:39
if set to false overlay image is not affected by viewport transform
1.6.3
we should really find a different way to do this
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasDrawableOptions.overlayVpt
renderOnAddRemove
Section titled “renderOnAddRemove”renderOnAddRemove:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:71
Indicates whether StaticCanvas#add, StaticCanvas#insertAt and StaticCanvas#remove, StaticCanvas#moveTo, StaticCanvas#clear and many more, should also re-render canvas. Disabling this option will not give a performance boost when adding/removing a lot of objects to/from canvas at once since the renders are queued and executed one per frame. Disabling is suggested anyway and managing the renders of the app manually is not a big effort ( canvas.requestRenderAll() ) Left default to true to do not break documentation and old app, fiddles.
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasRenderingOptions.renderOnAddRemove
skipOffscreen
Section titled “skipOffscreen”skipOffscreen:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:82
Based on vptCoords and object.aCoords, skip rendering of objects that are not included in current viewport. May greatly help in applications with crowded canvas and use of zoom/pan If One of the corner of the bounding box of the object is on the canvas the objects get rendered.
Default
Section titled “Default”true
Inherited from
Section titled “Inherited from”CanvasRenderingOptions.skipOffscreen
svgViewportTransformation
Section titled “svgViewportTransformation”svgViewportTransformation:
boolean
Defined in: src/canvas/StaticCanvasOptions.ts:123
When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true, a zoomed canvas will then produce zoomed SVG output.
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”CanvasExportOptions.svgViewportTransformation
viewportTransform
Section titled “viewportTransform”viewportTransform:
TMat2D
Defined in: src/canvas/StaticCanvasOptions.ts:174
The transformation (a Canvas 2D API transform matrix) which focuses the viewport
Examples
Section titled “Examples”canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
Default
Section titled “Default”
width:
number
Defined in: src/canvas/StaticCanvasOptions.ts:135
Width in virtual/logical pixels of the canvas. The canvas can be larger than width if retina scaling is active