-
Objects events
+
+
+
+ Canvas events
+
+ {canvasEvents.map(eventKey =>
+
+ )}
-
-
Other available events
+
+
+ Objects events
+
+ {objectsEvents.map(eventKey =>
+
+ )}
diff --git a/src/content/demo/events-inspector/demoComponents.jsx b/src/content/demo/events-inspector/demoComponents.jsx
new file mode 100644
index 000000000..6ff371879
--- /dev/null
+++ b/src/content/demo/events-inspector/demoComponents.jsx
@@ -0,0 +1,152 @@
+import React, { useCallback, memo, useState } from 'react';
+
+export const canvasEvents = [
+ 'object:modified',
+ 'object:moving',
+ 'object:scaling',
+ 'object:rotating',
+ 'object:skewing',
+ 'object:resizing',
+ 'before:transform',
+ 'before:selection:cleared',
+ 'selection:cleared',
+ 'selection:created',
+ 'selection:updated',
+ 'mouse:up',
+ 'mouse:down',
+ 'mouse:move',
+ 'mouse:up:before',
+ 'mouse:down:before',
+ 'mouse:move:before',
+ 'mouse:dblclick',
+ 'mouse:wheel',
+ 'mouse:over',
+ 'mouse:out',
+ 'drop:before',
+ 'drop',
+ 'drag:over',
+ 'drag:enter',
+ 'drag:leave',
+ 'after:render',
+ 'path:created',
+ 'object:added',
+ 'object:removed',
+ 'text:selection:changed',
+ 'text:changed',
+ 'text:editing:entered',
+ 'text:editing:exited',
+];
+
+export const objectsEvents = [
+ 'modified',
+ 'moving',
+ 'scaling',
+ 'rotating',
+ 'skewing',
+ 'resizing',
+ 'mouseup',
+ 'mousedown',
+ 'mousemove',
+ 'mouseup:before',
+ 'mousedown:before',
+ 'mousemove:before',
+ 'mousedblclick',
+ 'mousewheel',
+ 'mouseover',
+ 'mouseout',
+ 'drop:before',
+ 'drop',
+ 'dragover',
+ 'dragenter',
+ 'dragleave',
+ 'selection:changed',
+ 'changed',
+ 'editing:entered',
+ 'editing:exited',
+ 'selected',
+ 'deselected',
+];
+
+export const eventGroups = [
+ {
+ label: 'All events',
+ id: 'all',
+ enabled: false,
+ events: [...canvasEvents, ...objectsEvents],
+ }, {
+ label: 'Canvas events',
+ enabled: true,
+ id: 'canvas',
+ events: canvasEvents,
+ }, {
+ label: 'High volume events',
+ id: 'move',
+ enabled: false,
+ events: [
+ 'mouse:wheel',
+ 'mousewheel',
+ 'dragover',
+ 'moving',
+ 'scaling',
+ 'rotating',
+ 'skewing',
+ 'resizing',
+ 'mousemove',
+ 'mousemove:before',
+ 'mouse:move',
+ 'mouse:move:before',
+ 'object:moving',
+ 'object:scaling',
+ 'object:rotating',
+ 'object:skewing',
+ 'object:resizing',
+ ],
+ }];
+
+export const EventCheckbox = memo(({ eventName, onChange, checked }) => {
+
+ const labelId = `chk_${eventName}`;
+
+ const onChangeWrapped = useCallback((e) => {
+ const checked = e.target.checked;
+ onChange && onChange(eventName, checked);
+ }, [onChange])
+
+ return (
+
+
+ {eventName}
+
+ );
+});
+
+export const LogEntry = memo(({ logEntry, color }) => {
+ const [open, setOpen] = useState(false);
+ return (
+
+ setOpen(!open)}>{open ? '-' : '+'}
+ {logEntry.eventName}
+ {open && {logEntry.code}}
+ {open && {new Date(logEntry.id).toISOString()} }
+
+ );
+});
+
+export const EventGroupCheckbox = memo(({ groupName, label, onChange, initialChecked }) => {
+ const labelId = `grp_${groupName}`;
+
+ const [checked, setChecked] = useState(initialChecked);
+
+ const onChangeWrapped = useCallback((e) => {
+ const checked = e.target.checked;
+ setChecked(checked);
+ onChange && onChange(groupName, checked);
+ }, [onChange, checked]);
+
+ return (
+
+
+ {label}
+
+ );
+});
\ No newline at end of file
diff --git a/src/content/demo/events-inspector/index.css b/src/content/demo/events-inspector/index.css
index fc93e154a..ac3487704 100644
--- a/src/content/demo/events-inspector/index.css
+++ b/src/content/demo/events-inspector/index.css
@@ -1,19 +1,15 @@
.demo-main {
display: flex;
- flex-direction: row;
+ flex-direction: column;
justify-content: space-between;
}
-.column-main {
- max-width: 600px;
-}
-.column-events {
- font-size: 16px;
-}
+
.column-main,
.column-events {
display: flex;
flex-direction: column;
}
+
.demo-header {
display: flex;
flex-direction: row;
@@ -21,6 +17,7 @@
.demo-body {
display: flex;
flex-direction: row;
+ gap: 12px;
}
.log-entry {
white-space: pre;
@@ -61,20 +58,15 @@ label {
.bold label {
font-weight: bold;
}
-label[for='green'] {
- color: green;
-}
-label[for='red'] {
- color: red;
-}
-label[for='blue'] {
- color: blue;
-}
.log-container {
display: flex;
flex-direction: column;
overflow: auto;
}
-.hidden {
- display: none;
+.events-checkboxes {
+ padding-top: 24px;
+ display: flex;
+ flex-direction: row;
+ gap: 16px;
}
+
diff --git a/src/content/demo/events-inspector/index.mdx b/src/content/demo/events-inspector/index.mdx
index 0081bb873..94122946b 100644
--- a/src/content/demo/events-inspector/index.mdx
+++ b/src/content/demo/events-inspector/index.mdx
@@ -7,5 +7,15 @@ tags: ['events', 'log']
---
import { EventInspectorUI } from './EventInspectorUI';
+import '../../../css/demo-common.css';
+
+This demo is a quick reference of the events you can get out of the objects or the canvas.
+For a better understanding of events refer to this document: [Events](/docs/events).
+
+This UI will let you understand which kind of events are available when working with Fabric.js.
+
+There are 3 checkboxes to filter the events logging since events tied to mouse movements tend to be very noisy.
+Each Log will have a 'plus' icon that will let you expand the data that comes with the event.
+The log is capped at 100 events to avoid the UI to become unresponsive.
diff --git a/src/content/demo/free-drawing/index.mdx b/src/content/demo/free-drawing/index.mdx
index 2abc0eb4e..8cc9a9a52 100644
--- a/src/content/demo/free-drawing/index.mdx
+++ b/src/content/demo/free-drawing/index.mdx
@@ -1,7 +1,7 @@
---
date: '2013-06-22'
title: 'Free drawing'
-description: 'Free drawing in canvas using FabricJS'
+description: 'Free drawing in canvas using Fabric.js'
thumbnail: 'free-drawing.png'
tags: ['drawing', 'brush']
---
diff --git a/src/content/demo/intersection/index.mdx b/src/content/demo/intersection/index.mdx
index 09703bf34..08f23dae5 100644
--- a/src/content/demo/intersection/index.mdx
+++ b/src/content/demo/intersection/index.mdx
@@ -1,7 +1,7 @@
---
date: '2013-05-13'
title: 'Intersection'
-description: 'Intersections in FabricJS'
+description: 'Intersections in Fabric.js'
thumbnail: 'intersection.png'
tags: ['intersection']
---
diff --git a/src/content/demo/lanczos-webgl/code.js b/src/content/demo/lanczos-webgl/code.js
new file mode 100644
index 000000000..d0e98e7e6
--- /dev/null
+++ b/src/content/demo/lanczos-webgl/code.js
@@ -0,0 +1,92 @@
+var canvas1 = document.getElementById('c');
+var canvas2 = document.getElementById('b');
+var ctx = canvas1.getContext('2d');
+var ctx2 = canvas2.getContext('2d');
+ctx.imageSmoothingEnabled = false;
+ctx2.imageSmoothingEnabled = false;
+
+const canvas = new fabric.Canvas(canvasEl);
+// create a rectangle object
+
+var lanczosFilter = new fabric.filters.Resize({
+ scaleX: 1,
+ scaleY: 1,
+ resizeType: 'lanczos',
+ lanczosLobes: 3,
+});
+
+var oImg;
+var p = {
+ x: 0,
+ y: 0,
+};
+
+fabric.FabricImage.fromURL('/assets/dragon.jpg').then((img) => {
+ var r = canvas.getRetinaScaling();
+ oImg = img;
+ oImg.set({ left: 20, top: 20 })
+ oImg.scale(0.2);
+ lanczosFilter.scaleX = lanczosFilter.scaleY = oImg.scaleX * r;
+ oImg.lockScalingFlip = true;
+ oImg.minScaleLimit = 0.025;
+ oImg.filters = [lanczosFilter];
+ oImg.hoverCursor = 'crossHair';
+ oImg.on('scaling', function(opt) {
+ var filters = [];
+ var sX = Math.abs(oImg.scaleX) * r, sY = Math.abs(oImg.scaleY) * r;
+ if (sX > 0.01 && sY > 0.01 && sX < 1 && sY < 1) {
+ if (sX <= 0.2 || sY <= 0.2) {
+ lanczosFilter.lanczosLobes = 2;
+ } else if (sX <= 0.05 || sY <= 0.05) {
+ lanczosFilter.lanczosLobes = 1;
+ } else {
+ lanczosFilter.lanczosLobes = 3;
+ }
+ lanczosFilter.scaleX = sX;
+ lanczosFilter.scaleY = sY;
+ filters.push(lanczosFilter);
+ }
+ this.filters = filters;
+ });
+ oImg.on('mousedown', function({ e, scenePoint }) {
+ if (e.buttons === 2) {
+ p = fabric.util.sendPointToPlane(scenePoint, undefined, oImg.calcTransformMatrix())
+ .add({ x: oImg.width / 2, y: oImg.height / 2 });
+ updateFor()
+ }
+ })
+ canvas.add(oImg);
+ canvas.setActiveObject(oImg);
+ canvas.on('before:render', function() {
+ oImg.applyFilters();
+ updateFor();
+ document.getElementById('log').innerHTML = 'scale: ' + lanczosFilter.scaleX.toFixed(4) + ' lobes: ' + lanczosFilter.lanczosLobes +
+ ', taps: ' + lanczosFilter.taps.length + '\nweights:\n' + lanczosFilter.taps.map(
+ function(tap, i) { return i + ': ' + tap.toFixed(7); }
+ ).join('\n');
+ });
+});
+
+
+function updateFor() {
+ var w = oImg._element.width, h = oImg._element.height,
+ fW = Math.floor(550 * oImg.scaleX),
+ fH = Math.floor(400 * oImg.scaleY),
+ sx = p.x * oImg.scaleX - fW / 2, sy = p.y * oImg.scaleY - fH / 2;
+
+ if (sx < 0) {
+ sx = 0
+ }
+ if (sy < 0) {
+ sy = 0
+ }
+ if (sx + fW > w) {
+ sx = w - fW;
+ }
+ if (sy + fH > h) {
+ sy = h - fH;
+ }
+ ctx.drawImage(oImg._originalElement, sx / oImg.scaleX, sy / oImg.scaleY, 550, 400, 0, 0, 550 * oImg.scaleX , 400 * oImg.scaleY);
+ ctx.drawImage(canvas1, 0, 0, fW, fH, 0, 0, 550, 400);
+ ctx2.drawImage(oImg._element, sx, sy, fW, fH, 0, 0, 550, 400);
+}
\ No newline at end of file
diff --git a/src/content/demo/lanczos-webgl/index.css b/src/content/demo/lanczos-webgl/index.css
new file mode 100644
index 000000000..59515a7be
--- /dev/null
+++ b/src/content/demo/lanczos-webgl/index.css
@@ -0,0 +1,17 @@
+#log {
+ display: inline-block;
+ overflow-y: scroll;
+ max-height: 800px;
+}
+
+.flexH {
+ display: flex;
+ column-gap: 16px;
+}
+
+.flexV {
+ display: flex;
+ flex-direction: column;
+ overflow-y: scroll;
+ row-gap: 16px;
+}
\ No newline at end of file
diff --git a/src/content/demo/lanczos-webgl/index.mdx b/src/content/demo/lanczos-webgl/index.mdx
new file mode 100644
index 000000000..e41b6450f
--- /dev/null
+++ b/src/content/demo/lanczos-webgl/index.mdx
@@ -0,0 +1,35 @@
+---
+date: '2017-10-10'
+title: 'Realtime lanczos'
+description: 'Intersections in Fabric.js'
+thumbnail: 'lanczos-webgl.png'
+tags: ['filters']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import './index.css';
+import '../../../css/demo-common.css';
+
+This demo shows a 1920x1200 large jpeg displayed in a small FabricImage object.
+The image starts with a scaling of 0.2 and you can use the corner to increase or decrease the scale.
+While changing the scale you can observe the lower canvases that offer a detailed view of the image scaling with and without the lanczos filter.
+
+Right click on the image object to change the magnified point in the canvases below.
+
+On the right of the canvases you can see the number and values of the taps used for the filter.
+The more you shrink the image, the more taps, the more performance hit but also the smoother scaling.
+
+This filter affects performace, you may consider it if your application is exporting small png or jpegs but is using large images.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/content/demo/lanczos-webgl/lanczos-webgl.png b/src/content/demo/lanczos-webgl/lanczos-webgl.png
new file mode 100644
index 000000000..e9340c64b
Binary files /dev/null and b/src/content/demo/lanczos-webgl/lanczos-webgl.png differ
diff --git a/src/content/demo/loading-custom-fonts/index.mdx b/src/content/demo/loading-custom-fonts/index.mdx
index 2184d53d9..f058ee011 100644
--- a/src/content/demo/loading-custom-fonts/index.mdx
+++ b/src/content/demo/loading-custom-fonts/index.mdx
@@ -1,7 +1,7 @@
---
date: '2017-10-24'
title: 'Loading custom fonts'
-description: 'Loading custom fonts in FabricJS'
+description: 'Loading custom fonts in Fabric.js'
thumbnail: 'load-custom-fonts.png'
tags: ['fonts', 'typography', 'custom']
---
@@ -14,7 +14,7 @@ This happens because font loading involve network and is async by nature, and so
If for some reason your target browsers do not support that api yet you can pick from a selection of font preloading libraries like [Font Face Observer](https://github.com/bramstein/fontfaceobserver)
In this example we are using the browser native CSS Font loader api to load 2 google fonts from google's cdn.
-We load the font, then we create a textbox and then use the loaded font family. Note that you could create the textbox, add them to canvas and just re-render when the font is loaded, doing so you would have saved in FabricJS cache some values calculated with the font not correctly loaded and likely **have cursor positioning issues** or **wrong bounding boxes issues**. Always assign the font family after the font has correctly loaded.
+We load the font, then we create a textbox and then use the loaded font family. Note that you could create the textbox, add them to canvas and just re-render when the font is loaded, doing so you would have saved in Fabric.js cache some values calculated with the font not correctly loaded and likely **have cursor positioning issues** or **wrong bounding boxes issues**. Always assign the font family after the font has correctly loaded.
When dealing with fonts with multiple weights and styles is easier to assign a different font family to each of them and just use different font families, in the example's code we do show how to load different weights with the same family name, but be aware that one font file has one family, one weight and one style. Loading the font `Lato` doesn't grant you access to all variants of the fonts, but just one. there is one file per variant.
diff --git a/src/content/demo/managing-selection/code.js b/src/content/demo/managing-selection/code.js
new file mode 100644
index 000000000..144463134
--- /dev/null
+++ b/src/content/demo/managing-selection/code.js
@@ -0,0 +1,74 @@
+function add() {
+ const { width, height } = canvas;
+ var red = new fabric.Rect({
+ top: Math.random() * (height - 25),
+ left: Math.random() * (width - 40),
+ width: 80,
+ height: 50,
+ fill: 'red'
+ });
+ var blue = new fabric.Rect({
+ top: Math.random() * (height - 35),
+ left: Math.random() * (width - 25),
+ width: 50,
+ height: 70,
+ fill: 'blue'
+ });
+ var green = new fabric.Rect({
+ top: Math.random() * (height - 30),
+ left: Math.random() * (width - 30),
+ width: 60,
+ height: 60,
+ fill: 'green'
+ });
+ canvas.add(red, blue, green);
+}
+
+const $ = (id) => document.getElementById(id);
+
+const canvas = new fabric.Canvas(canvasEl);
+add();
+fabric.FabricObject.ownDefaults.transparentCorners = false;
+
+$('addmore').onclick = add;
+
+$('multiselect').onclick = function() {
+ canvas.discardActiveObject();
+ var sel = new fabric.ActiveSelection(canvas.getObjects(), {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(sel);
+ canvas.requestRenderAll();
+}
+
+$('group').onclick = function() {
+ if (!canvas.getActiveObject()) {
+ return;
+ }
+ console.log(canvas.getActiveObject().type)
+ if (canvas.getActiveObject().type !== 'activeSelection' && canvas.getActiveObject().type !== 'activeselection') {
+ return;
+ }
+ const group = new fabric.Group(canvas.getActiveObject().removeAll())
+ canvas.add(group);
+ canvas.setActiveObject(group);
+ canvas.requestRenderAll();
+}
+
+$('ungroup').onclick = function() {
+ const group = canvas.getActiveObject();
+ if (!group || group.type !== 'group') {
+ return;
+ }
+ canvas.remove(group);
+ var sel = new fabric.ActiveSelection(group.removeAll(), {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(sel);
+ canvas.requestRenderAll();
+}
+
+$('discard').onclick = function() {
+ canvas.discardActiveObject();
+ canvas.requestRenderAll();
+}
\ No newline at end of file
diff --git a/src/content/demo/managing-selection/index.mdx b/src/content/demo/managing-selection/index.mdx
new file mode 100644
index 000000000..58af9d8fb
--- /dev/null
+++ b/src/content/demo/managing-selection/index.mdx
@@ -0,0 +1,30 @@
+---
+date: '2015-05-04'
+title: 'Manage selection'
+description: 'Manage selection'
+thumbnail: 'manage-selection.png'
+tags: ['selection']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import '../../../css/demo-common.css';
+
+This demo is shows how to handle the selection programmatically.
+In the code editor below you can see some simple functions that let you:
+
+- Select all items in a canvas
+- Convert the selection in a group
+- Convert a group into a selection
+
+
+ Group selected objecs
+ Ungroup selected objects
+ Select all
+ Discard selection
+ Add more shapes
+
+
+
+
+
\ No newline at end of file
diff --git a/public/site_assets/manage-selection.png b/src/content/demo/managing-selection/manage-selection.png
similarity index 100%
rename from public/site_assets/manage-selection.png
rename to src/content/demo/managing-selection/manage-selection.png
diff --git a/src/content/demo/shadows/code.js b/src/content/demo/shadows/code.js
new file mode 100644
index 000000000..4ebbcdcd5
--- /dev/null
+++ b/src/content/demo/shadows/code.js
@@ -0,0 +1,57 @@
+const canvas = new fabric.Canvas(canvasEl);
+fabric.FabricObject.ownDefaults.transparentCorners = false;
+fabric.FabricObject.ownDefaults.objectCaching = false;
+const minScale = 1, maxScale = 2;
+
+fabric.loadSVGFromURL('../assets/112.svg').then(({ objects }) => {
+
+ const obj = fabric.util.groupSVGElements(objects);
+ canvas.add(obj);
+ obj.set({
+ left: 80,
+ top: 90,
+ angle: -30,
+ direction: 1,
+ shadow: { color: 'rgba(0,0,0,0.3)' },
+ objectCaching: false,
+ });
+ // animate angle back and forth (every 2 second)
+ obj.animate({ angle: 30 }, {
+ duration: 2000,
+ easing: fabric.util.ease.easeOutCubic,
+ onChange: () => canvas.renderAndReset(),
+ onComplete: function onComplete() {
+ obj.animate({
+ angle: Math.round(obj.angle) === 30 ? -30 : 30
+ }, {
+ duration: 2000,
+ onComplete: onComplete
+ });
+ }
+ });
+
+ // animate scale and shadow (every second)
+ (function animate(dir) {
+ obj.animate({
+ scaleX: dir ? maxScale : minScale,
+ scaleY: dir ? maxScale : minScale,
+ 'shadow.offsetX': dir ? 20 : 0.00001,
+ 'shadow.offsetY': dir ? 20 : 0.00001,
+ }, {
+ easing: fabric.util.ease.easeOutCubic,
+ duration: 1000
+ });
+
+ obj.animate({
+ 'shadow.blur': dir ? 20 : 0,
+ }, {
+ onChange: () => canvas.renderAndReset(),
+ onComplete: function() {
+ obj.direction = !obj.direction;
+ animate(obj.direction);
+ },
+ easing: fabric.util.ease.easeOutCubic,
+ duration: 1000
+ });
+ })(obj.direction);
+});
\ No newline at end of file
diff --git a/src/content/demo/shadows/index.mdx b/src/content/demo/shadows/index.mdx
new file mode 100644
index 000000000..0929053ec
--- /dev/null
+++ b/src/content/demo/shadows/index.mdx
@@ -0,0 +1,16 @@
+---
+date: '2013-02-05'
+title: 'Shadows'
+thumbnail: 'shadows.png'
+tags: ['shadow', 'animation', 'svg']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import '../../../css/demo-common.css';
+
+This simple example shows some simple shadow animation on objects.
+
+
+
+
\ No newline at end of file
diff --git a/src/content/demo/shadows/shadows.png b/src/content/demo/shadows/shadows.png
new file mode 100644
index 000000000..34741311a
Binary files /dev/null and b/src/content/demo/shadows/shadows.png differ
diff --git a/src/content/demo/super-sub-script/code.js b/src/content/demo/super-sub-script/code.js
new file mode 100644
index 000000000..272199d3a
--- /dev/null
+++ b/src/content/demo/super-sub-script/code.js
@@ -0,0 +1,54 @@
+const $ = (id) => document.getElementById(id);
+
+const getRange = () => {
+ var active = canvas.getActiveObject();
+ if (!active) return [];
+ if (active.selectionStart === active.selectionEnd) {
+ return [active.selectionStart, active.selectionEnd + 1];
+ }
+ return [active.selectionStart, active.selectionEnd];
+}
+
+$('super').onclick = () => {
+ var active = canvas.getActiveObject();
+ if (!active) return;
+ active.setSuperscript(...getRange());
+ canvas.requestRenderAll();
+}
+
+$('sub').onclick = () => {
+ var active = canvas.getActiveObject();
+ if (!active) return;
+ active.setSubscript(...getRange());
+ canvas.requestRenderAll();
+}
+
+$('remove').onclick = () => {
+ var active = canvas.getActiveObject();
+ if (!active) return;
+ active.setSelectionStyles && active.setSelectionStyles({
+ fontSize: undefined,
+ deltaY: undefined,
+ }, ...getRanges());
+ canvas.requestRenderAll();
+}
+
+const canvas = new fabric.Canvas(canvasEl);
+
+var itext = new fabric.IText('This is a IText object', {
+ left: 100,
+ top: 300,
+ fill: '#D81B60',
+ strokeWidth: 2,
+ stroke: "#880E4F",
+});
+
+var textbox = new fabric.Textbox('This is a Textbox object', {
+ left: 20,
+ top: 50,
+ fill: '#880E4F',
+ strokeWidth: 2,
+ stroke: "#D81B60",
+});
+
+canvas.add(itext, textbox);
diff --git a/src/content/demo/super-sub-script/index.mdx b/src/content/demo/super-sub-script/index.mdx
new file mode 100644
index 000000000..891ed443f
--- /dev/null
+++ b/src/content/demo/super-sub-script/index.mdx
@@ -0,0 +1,23 @@
+---
+date: '2018-03-03'
+title: 'Superscript and subscript'
+thumbnail: 'super-sub-script.png'
+tags: ['text', 'text styles']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import '../../../css/demo-common.css';
+
+This simple example will demonstrate superScript and subScript functionality.
+`Text.superScript` and `Text.subScript` are two utility methods that leverage the styles propertie `fontSize` and `deltaY` to offset a portion of text and indeed make it look like is a subscript or a superscript.
+
+
+ Set superscript on selection
+ Set subscript on selection
+ Remove script informations
+
+
+
+
+
\ No newline at end of file
diff --git a/src/content/demo/super-sub-script/super-sub-script.png b/src/content/demo/super-sub-script/super-sub-script.png
new file mode 100644
index 000000000..ed7175fbe
Binary files /dev/null and b/src/content/demo/super-sub-script/super-sub-script.png differ
diff --git a/src/content/demo/svg-caching/code.js b/src/content/demo/svg-caching/code.js
new file mode 100644
index 000000000..149d820e0
--- /dev/null
+++ b/src/content/demo/svg-caching/code.js
@@ -0,0 +1,59 @@
+const canvas = new fabric.Canvas(canvasEl);
+
+fabric.FabricObject.ownDefaults.originX = 'center';
+fabric.FabricObject.ownDefaults.originY = 'center';
+fabric.FabricObject.ownDefaults.transparentCorners = false;
+delete fabric.FabricObject.ownDefaults.objectCaching;
+delete fabric.BaseFabricObject.ownDefaults.objectCaching;
+fabric.BaseFabricObject.prototype.objectCaching = true;
+
+function animate(obj) {
+ obj.animate({ angle: 360 }, {
+ duration: 3000,
+ onComplete: function(){
+ obj.angle = 0;
+ animate(obj)
+ },
+ easing: function(t, b, c, d) { return c*t/d + b }
+ });
+}
+
+fabric.loadSVGFromURL('/site_assets/tiger2.svg').then(({ objects }) => {
+ var obj = fabric.util.groupSVGElements(objects);
+ obj.scale(0.5);
+
+ // load shapes
+ for (var i = 1; i < 4; i++) {
+ for (var j = 1; j < 6; j++) {
+ (function(i, j) {
+ obj.clone().then(clone => {
+ clone.set({
+ left: i * 200 - 100,
+ top: j * 200 - 100
+ });
+ canvas.add(clone);
+ animate(clone);
+ })
+ })(i, j);
+ }
+ }
+});
+
+
+
+
+
+(function render(){
+ canvas.requestRenderAll();
+ fabric.util.requestAnimFrame(render);
+})();
+
+document.getElementById('cache').onclick = () => {
+ fabric.BaseFabricObject.prototype.objectCaching = !fabric.BaseFabricObject.prototype.objectCaching;
+ canvas.forEachObject(function(obj, i) {
+ obj.forEachObject((obj2) => {
+ obj2.set('dirty', true);
+ })
+ obj.set('dirty', true);
+ });
+};
\ No newline at end of file
diff --git a/src/content/demo/svg-caching/index.mdx b/src/content/demo/svg-caching/index.mdx
new file mode 100644
index 000000000..0c733d425
--- /dev/null
+++ b/src/content/demo/svg-caching/index.mdx
@@ -0,0 +1,23 @@
+---
+date: '2013-11-02'
+title: 'Svg caching'
+thumbnail: 'svg-caching.png'
+tags: ['svg', 'caching']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import '../../../css/demo-common.css';
+
+When rendering complex shapes onto canvas — those consisting of thousands of paths — it's usually faster to have them cached so that they get rendered with
ctx.drawImage.
+This essentially replaces thousands of low-level commands (
lineTo,
moveTo,
bezierCurveTo,
arcTo, etc.) with a single
drawImage.
+
+The downside is an higher memory usage since all svgs gets a canvas with a image copy of the svg.
+
+
+ toggle cache
+
+
+
+
+
\ No newline at end of file
diff --git a/src/content/demo/svg-caching/svg-caching.png b/src/content/demo/svg-caching/svg-caching.png
new file mode 100644
index 000000000..3d7d4bed2
Binary files /dev/null and b/src/content/demo/svg-caching/svg-caching.png differ
diff --git a/src/content/demo/text-on-path/TextOnPath.jsx b/src/content/demo/text-on-path/TextOnPath.jsx
index 504a6fb34..eb22698cc 100644
--- a/src/content/demo/text-on-path/TextOnPath.jsx
+++ b/src/content/demo/text-on-path/TextOnPath.jsx
@@ -1,6 +1,5 @@
import { useEffect } from "react";
import * as fabric from 'fabric';
-import './textOnPath.css';
export const TextOnPath = () => {
diff --git a/src/content/demo/text-on-path/index.mdx b/src/content/demo/text-on-path/index.mdx
index 65ca20ace..ae3b7816f 100644
--- a/src/content/demo/text-on-path/index.mdx
+++ b/src/content/demo/text-on-path/index.mdx
@@ -7,8 +7,9 @@ tags: ['text', 'path']
---
import { TextOnPath } from './TextOnPath';
+import '../../../css/demo-common.css';
-This is an unfinished feature in FabricJS
+This is an unfinished feature in Fabric.js
You can specify a fabric.Path property for the text, called path, that will make the text render curved, following the path.
The feature is new, and has a lot of edge cases to be solved and improved.
diff --git a/src/content/demo/text-on-path/textOnPath.css b/src/content/demo/text-on-path/textOnPath.css
deleted file mode 100644
index 55f82dcb8..000000000
--- a/src/content/demo/text-on-path/textOnPath.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.canvas-container {
- border: 1px solid blue;
- margin: 16px;
-}
\ No newline at end of file
diff --git a/src/content/demo/video-element/code.js b/src/content/demo/video-element/code.js
new file mode 100644
index 000000000..e212a4c53
--- /dev/null
+++ b/src/content/demo/video-element/code.js
@@ -0,0 +1,111 @@
+const canvas = new fabric.Canvas(canvasEl);
+const video1El = document.createElement('video');
+const video2El = document.createElement('video');
+
+const video1source = document.createElement('source');
+const video2source = document.createElement('source');
+
+const webcamEl = document.createElement('video');
+
+// FabricImage requires the width and height attributes to be set
+video1El.width = 480;
+video1El.height = 360;
+video1El.id = 'video1'
+video1El.muted = true;
+video1El.appendChild(video1source);
+video1source.src = '/site_assets/dizzy.mp4';
+video1El.onended = () => video1El.play();
+
+video2El.width = 1280;
+video2El.height = 720;
+video2El.id = 'video2'
+video2El.muted = true;
+video2El.appendChild(video2source);
+video2source.src = '/site_assets/big-buck-bunny.mp4';
+video2El.onended = () => video2El.play();
+
+webcamEl.width = 500;
+webcamEl.height = 360;
+webcamEl.id = 'webcam'
+webcamEl.muted = true;
+
+const video1 = new fabric.FabricImage(video1El, {
+ left: 200,
+ top: 300,
+ angle: -15,
+ originX: 'center',
+ originY: 'center',
+ objectCaching: false,
+});
+
+const video2 = new fabric.FabricImage(video2El, {
+ left: 700,
+ top: 200,
+ angle: 15,
+ originX: 'center',
+ originY: 'center',
+ objectCaching: false,
+ scaleX: 0.5,
+ scaleY: 0.5
+});
+
+var webcam = new fabric.FabricImage(webcamEl, {
+ left: 539,
+ top: 328,
+ angle: 94.5,
+ originX: 'center',
+ originY: 'center',
+ objectCaching: false,
+});
+
+canvas.add(video1, video2);
+canvas.add(webcam);
+video1El.play();
+video2El.play();
+
+// Older browsers might not implement mediaDevices at all, so we set an empty object first
+if (navigator.mediaDevices === undefined) {
+ navigator.mediaDevices = {};
+}
+
+if (navigator.mediaDevices.getUserMedia === undefined) {
+ navigator.mediaDevices.getUserMedia = function(constraints) {
+
+ // First get ahold of the legacy getUserMedia, if present
+ var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
+
+ // Some browsers just don't implement it - return a rejected promise with an error
+ // to keep a consistent interface
+ if (!getUserMedia) {
+ return Promise.reject(new Error('getUserMedia is not implemented in this browser'));
+ }
+
+ // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise
+ return new Promise(function(resolve, reject) {
+ getUserMedia.call(navigator, constraints, resolve, reject);
+ });
+ }
+}
+
+
+// adding webcam video element
+if (window.location.protocol === 'https:') {
+ navigator.mediaDevices.getUserMedia({video: true})
+ .then(function getWebcamAllowed(localMediaStream) {
+ webcamEl.srcObject = localMediaStream;
+
+ canvas.add(webcam);
+ webcam.moveTo(0); // move webcam element to back of zIndex stack
+ webcam.getElement().play();
+ }).catch(function getWebcamNotAllowed(e) {
+ // block will be hit if user selects "no" for browser "allow webcam access" prompt
+ console.error(e);
+ console.warn('webcam was not allowed')
+ });
+}
+
+
+fabric.util.requestAnimFrame(function render() {
+ canvas.renderAll();
+ fabric.util.requestAnimFrame(render);
+});
diff --git a/src/content/demo/video-element/index.mdx b/src/content/demo/video-element/index.mdx
new file mode 100644
index 000000000..98a9a17d8
--- /dev/null
+++ b/src/content/demo/video-element/index.mdx
@@ -0,0 +1,19 @@
+---
+date: '2014-10-16'
+title: 'Video element'
+description: 'FabricImage with video drawable'
+thumbnail: 'video-element.png'
+tags: ['video', 'image']
+---
+
+import { CodeEditor } from '../../../components/CodeEditor';
+import code from './code?raw';
+import '../../../css/demo-common.css';
+
+This demo show how you can use video elements ( or any other drawable or stream ) as a source for FabricImage.
+Fabric.js does not support a FabricVideo class per se, nor does it support video export directly.
+Video export is still possible with a smart use of the stream api.
+
+
+
+
\ No newline at end of file
diff --git a/src/content/demo/video-element/video-element.png b/src/content/demo/video-element/video-element.png
new file mode 100644
index 000000000..d94213d95
Binary files /dev/null and b/src/content/demo/video-element/video-element.png differ
diff --git a/src/content/docs/api/classes/ActiveSelection.md b/src/content/docs/api/classes/ActiveSelection.md
index e20ea766f..d9b0ebc50 100644
--- a/src/content/docs/api/classes/ActiveSelection.md
+++ b/src/content/docs/api/classes/ActiveSelection.md
@@ -5,6 +5,8 @@ prev: false
title: "ActiveSelection"
---
+Defined in: [src/shapes/ActiveSelection.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L36)
+
Used by Canvas to manage selection.
## Example
@@ -24,27 +26,29 @@ classRegistry.setClass(MyActiveSelection)
## Constructors
-### new ActiveSelection()
+### Constructor
+
+> **new ActiveSelection**(`objects`, `options`): `ActiveSelection`
-> **new ActiveSelection**(`objects`, `options`): [`ActiveSelection`](/api/classes/activeselection/)
+Defined in: [src/shapes/ActiveSelection.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L60)
#### Parameters
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
+##### objects
-• **options**: `Partial`\<[`ActiveSelectionOptions`](/api/interfaces/activeselectionoptions/)\> = `{}`
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
-#### Returns
+##### options
-[`ActiveSelection`](/api/classes/activeselection/)
+`Partial`\<[`ActiveSelectionOptions`](/api/interfaces/activeselectionoptions/)\> = `{}`
-#### Overrides
+#### Returns
-[`Group`](/api/classes/group/).[`constructor`](/api/classes/group/#constructors)
+`ActiveSelection`
-#### Defined in
+#### Overrides
-[src/shapes/ActiveSelection.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L60)
+[`Group`](/api/classes/group/).[`constructor`](/api/classes/group/#constructor)
## Properties
@@ -52,6 +56,8 @@ classRegistry.setClass(MyActiveSelection)
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -62,16 +68,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values
[`Group`](/api/classes/group/).[`__corner`](/api/classes/group/#__corner)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_controlsVisibility
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -80,16 +84,14 @@ this takes priority over the generic control visibility
[`Group`](/api/classes/group/).[`_controlsVisibility`](/api/classes/group/#_controlsvisibility)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_objects
> **\_objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
+Defined in: [src/Collection.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L21)
+
#### TODO
needs to end up in the constructor too
@@ -98,16 +100,14 @@ needs to end up in the constructor too
[`Group`](/api/classes/group/).[`_objects`](/api/classes/group/#_objects)
-#### Defined in
-
-[src/Collection.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L21)
-
***
### \_scaling?
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -122,37 +122,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
[`Group`](/api/classes/group/).[`_scaling`](/api/classes/group/#_scaling)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/activeselection/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/activeselection/#calcacoords)
-
-#### Inherited from
-
-[`Group`](/api/classes/group/).[`aCoords`](/api/classes/group/#acoords)
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
***
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -170,9 +147,24 @@ false
[`Group`](/api/classes/group/).[`absolutePositioned`](/api/classes/group/#absolutepositioned)
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/activeselection/#setcoords).
+You can calculate them without updating with [()](/api/classes/activeselection/#calcacoords)
+
+#### Inherited from
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+[`Group`](/api/classes/group/).[`aCoords`](/api/classes/group/#acoords)
***
@@ -180,6 +172,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -192,39 +186,29 @@ Angle of rotation of an object (in degrees)
[`Group`](/api/classes/group/).[`angle`](/api/classes/group/#angle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`backgroundColor`](/api/classes/group/#backgroundcolor)
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -237,16 +221,14 @@ rgb(178,204,255)
[`Group`](/api/classes/group/).[`borderColor`](/api/classes/group/#bordercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -257,16 +239,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
[`Group`](/api/classes/group/).[`borderDashArray`](/api/classes/group/#borderdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -279,20 +259,19 @@ Opacity of object's controlling borders when object is active and moving
[`Group`](/api/classes/group/).[`borderOpacityWhenMoving`](/api/classes/group/#borderopacitywhenmoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -304,16 +283,14 @@ since there is no way to change the border itself.
[`Group`](/api/classes/group/).[`borderScaleFactor`](/api/classes/group/#borderscalefactor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -324,26 +301,18 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`centeredRotation`](/api/classes/group/#centeredrotation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -351,26 +320,18 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`centeredScaling`](/api/classes/group/#centeredscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -380,16 +341,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
[`Group`](/api/classes/group/).[`clipPath`](/api/classes/group/#clippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -397,16 +356,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
[`Group`](/api/classes/group/).[`clipPathId`](/api/classes/group/#clippathid)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -414,16 +371,14 @@ controls are added by default_controls.js
[`Group`](/api/classes/group/).[`controls`](/api/classes/group/#controls)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -436,16 +391,14 @@ rgb(178,204,255)
[`Group`](/api/classes/group/).[`cornerColor`](/api/classes/group/#cornercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -462,16 +415,14 @@ null
[`Group`](/api/classes/group/).[`cornerDashArray`](/api/classes/group/#cornerdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -484,16 +435,14 @@ Size of object's controlling corners (in pixels)
[`Group`](/api/classes/group/).[`cornerSize`](/api/classes/group/#cornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -510,20 +459,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
[`Group`](/api/classes/group/).[`cornerStrokeColor`](/api/classes/group/#cornerstrokecolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -534,24 +485,18 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Inherited from
[`Group`](/api/classes/group/).[`cornerStyle`](/api/classes/group/#cornerstyle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -565,64 +510,46 @@ true
[`Group`](/api/classes/group/).[`dirty`](/api/classes/group/#dirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Inherited from
[`Group`](/api/classes/group/).[`evented`](/api/classes/group/#evented)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`excludeFromExport`](/api/classes/group/#excludefromexport)
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -636,16 +563,14 @@ rgb(0,0,0)
[`Group`](/api/classes/group/).[`fill`](/api/classes/group/#fill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -660,16 +585,14 @@ nonzero
[`Group`](/api/classes/group/).[`fillRule`](/api/classes/group/#fillrule)
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -682,16 +605,14 @@ false
[`Group`](/api/classes/group/).[`flipX`](/api/classes/group/#flipx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -704,60 +625,42 @@ false
[`Group`](/api/classes/group/).[`flipY`](/api/classes/group/#flipy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Inherited from
[`Group`](/api/classes/group/).[`globalCompositeOperation`](/api/classes/group/#globalcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Inherited from
[`Group`](/api/classes/group/).[`hasBorders`](/api/classes/group/#hasborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -770,38 +673,28 @@ true
[`Group`](/api/classes/group/).[`hasControls`](/api/classes/group/#hascontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Inherited from
[`Group`](/api/classes/group/).[`height`](/api/classes/group/#height)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -814,38 +707,28 @@ null
[`Group`](/api/classes/group/).[`hoverCursor`](/api/classes/group/#hovercursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Inherited from
[`Group`](/api/classes/group/).[`includeDefaultValues`](/api/classes/group/#includedefaultvalues)
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### ~~interactive~~
> **interactive**: `boolean`
+Defined in: [src/shapes/Group.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L106)
+
Used to allow targeting of object inside groups.
set to true if you want to select an object inside a group.\
**REQUIRES** `subTargetCheck` set to true
@@ -854,12 +737,6 @@ that will take care of enabling subTargetCheck and necessary object events.
There is too much attached to group interactivity to just be evaluated by a
boolean in the code
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -868,16 +745,14 @@ This API is no longer supported and may be removed in a future release.
[`Group`](/api/classes/group/).[`interactive`](/api/classes/group/#interactive)
-#### Defined in
-
-[src/shapes/Group.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L108)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -892,16 +767,14 @@ false
[`Group`](/api/classes/group/).[`inverted`](/api/classes/group/#inverted)
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -909,16 +782,14 @@ part of the move action.
[`Group`](/api/classes/group/).[`isMoving`](/api/classes/group/#ismoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### layoutManager
> **layoutManager**: `ActiveSelectionLayoutManager`
+Defined in: [src/shapes/ActiveSelection.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L49)
+
The ActiveSelection needs to use the ActiveSelectionLayoutManager
or selections on interactive groups may be broken
@@ -926,19 +797,17 @@ or selections on interactive groups may be broken
[`Group`](/api/classes/group/).[`layoutManager`](/api/classes/group/#layoutmanager)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L49)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -950,208 +819,140 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
[`Group`](/api/classes/group/).[`left`](/api/classes/group/#left)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
-When `true`, object horizontal movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
-```
+When `true`, object horizontal movement is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockMovementX`](/api/classes/group/#lockmovementx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
-
***
### lockMovementY
> **lockMovementY**: `boolean`
-When `true`, object vertical movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
-```
+When `true`, object vertical movement is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockMovementY`](/api/classes/group/#lockmovementy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockRotation`](/api/classes/group/#lockrotation)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Inherited from
[`Group`](/api/classes/group/).[`lockScalingFlip`](/api/classes/group/#lockscalingflip)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockScalingX`](/api/classes/group/#lockscalingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockScalingY`](/api/classes/group/#lockscalingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockSkewingX`](/api/classes/group/#lockskewingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Inherited from
[`Group`](/api/classes/group/).[`lockSkewingY`](/api/classes/group/#lockskewingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
[`Group`](/api/classes/group/).[`matrixCache`](/api/classes/group/#matrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
-
***
### minScaleLimit
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1164,16 +965,14 @@ Minimum allowed scale value of an object
[`Group`](/api/classes/group/).[`minScaleLimit`](/api/classes/group/#minscalelimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1186,16 +985,14 @@ null
[`Group`](/api/classes/group/).[`moveCursor`](/api/classes/group/#movecursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### multiSelectionStacking
> **multiSelectionStacking**: [`MultiSelectionStacking`](/api/type-aliases/multiselectionstacking/)
+Defined in: [src/shapes/ActiveSelection.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L58)
+
controls how selected objects are added during a multiselection event
- `canvas-stacking` adds the selected object to the active selection while respecting canvas object stacking order
- `selection-order` adds the selected object to the top of the stack,
@@ -1205,16 +1002,14 @@ meaning that the stack is ordered by the order in which objects were selected
`canvas-stacking`
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L58)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1231,35 +1026,14 @@ true
[`Group`](/api/classes/group/).[`noScaleCache`](/api/classes/group/#noscalecache)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-[`Group`](/api/classes/group/).[`oCoords`](/api/classes/group/#ocoords)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1278,9 +1052,22 @@ true
[`Group`](/api/classes/group/).[`objectCaching`](/api/classes/group/#objectcaching)
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
+
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+[`Group`](/api/classes/group/).[`oCoords`](/api/classes/group/#ocoords)
***
@@ -1288,6 +1075,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1300,16 +1089,14 @@ Opacity of an object
[`Group`](/api/classes/group/).[`opacity`](/api/classes/group/#opacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1318,16 +1105,14 @@ please use 'center' as value in new projects
[`Group`](/api/classes/group/).[`originX`](/api/classes/group/#originx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1336,32 +1121,28 @@ please use 'center' as value in new projects
[`Group`](/api/classes/group/).[`originY`](/api/classes/group/#originy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
[`Group`](/api/classes/group/).[`ownMatrixCache`](/api/classes/group/#ownmatrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1374,38 +1155,28 @@ Padding between object and its controlling borders (in pixels)
[`Group`](/api/classes/group/).[`padding`](/api/classes/group/#padding)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Inherited from
[`Group`](/api/classes/group/).[`paintFirst`](/api/classes/group/#paintfirst)
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1413,38 +1184,28 @@ Used to keep the original parent ref when the object has been added to an Active
[`Group`](/api/classes/group/).[`parent`](/api/classes/group/#parent)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Inherited from
[`Group`](/api/classes/group/).[`perPixelTargetFind`](/api/classes/group/#perpixeltargetfind)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1457,16 +1218,14 @@ Object scale factor (horizontal)
[`Group`](/api/classes/group/).[`scaleX`](/api/classes/group/#scalex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1479,48 +1238,32 @@ Object scale factor (vertical)
[`Group`](/api/classes/group/).[`scaleY`](/api/classes/group/#scaley)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`selectable`](/api/classes/group/#selectable)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1529,16 +1272,14 @@ This API is no longer supported and may be removed in a future release.
[`Group`](/api/classes/group/).[`selectionBackgroundColor`](/api/classes/group/#selectionbackgroundcolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1551,16 +1292,14 @@ null
[`Group`](/api/classes/group/).[`shadow`](/api/classes/group/#shadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1573,16 +1312,14 @@ Angle of skew on x axes of an object (in degrees)
[`Group`](/api/classes/group/).[`skewX`](/api/classes/group/#skewx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1595,32 +1332,28 @@ Angle of skew on y axes of an object (in degrees)
[`Group`](/api/classes/group/).[`skewY`](/api/classes/group/#skewy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Inherited from
[`Group`](/api/classes/group/).[`snapAngle`](/api/classes/group/#snapangle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1628,16 +1361,14 @@ When undefined, the snapThreshold will default to the snapAngle.
[`Group`](/api/classes/group/).[`snapThreshold`](/api/classes/group/#snapthreshold)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -1651,16 +1382,14 @@ null
[`Group`](/api/classes/group/).[`stroke`](/api/classes/group/#stroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -1673,16 +1402,14 @@ null;
[`Group`](/api/classes/group/).[`strokeDashArray`](/api/classes/group/#strokedasharray)
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -1695,16 +1422,14 @@ Line offset of an object's stroke
[`Group`](/api/classes/group/).[`strokeDashOffset`](/api/classes/group/#strokedashoffset)
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -1717,38 +1442,28 @@ butt
[`Group`](/api/classes/group/).[`strokeLineCap`](/api/classes/group/#strokelinecap)
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Inherited from
[`Group`](/api/classes/group/).[`strokeLineJoin`](/api/classes/group/#strokelinejoin)
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -1761,16 +1476,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
[`Group`](/api/classes/group/).[`strokeMiterLimit`](/api/classes/group/#strokemiterlimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -1796,16 +1509,14 @@ false
[`Group`](/api/classes/group/).[`strokeUniform`](/api/classes/group/#strokeuniform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -1818,42 +1529,32 @@ Width of a stroke used to render this object
[`Group`](/api/classes/group/).[`strokeWidth`](/api/classes/group/#strokewidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### subTargetCheck
> **subTargetCheck**: `boolean`
+Defined in: [src/shapes/Group.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L93)
+
Used to optimize performance
set to `false` if you don't need contained objects to be targets of events
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`Group`](/api/classes/group/).[`subTargetCheck`](/api/classes/group/#subtargetcheck)
-#### Defined in
-
-[src/shapes/Group.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L94)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -1865,16 +1566,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
[`Group`](/api/classes/group/).[`top`](/api/classes/group/#top)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -1887,16 +1586,14 @@ Size of object's controlling corners when touch interaction is detected
[`Group`](/api/classes/group/).[`touchCornerSize`](/api/classes/group/#touchcornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -1909,60 +1606,42 @@ true
[`Group`](/api/classes/group/).[`transparentCorners`](/api/classes/group/#transparentcorners)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### visible
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Inherited from
[`Group`](/api/classes/group/).[`visible`](/api/classes/group/#visible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Inherited from
[`Group`](/api/classes/group/).[`width`](/api/classes/group/#width)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
-
***
### cacheProperties
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:234](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L234)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -1972,32 +1651,28 @@ and refreshed at the next render
[`Group`](/api/classes/group/).[`cacheProperties`](/api/classes/group/#cacheproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L237)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
[`Group`](/api/classes/group/).[`colorProperties`](/api/classes/group/#colorproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -2005,30 +1680,26 @@ instance.toObject() gets called
[`Group`](/api/classes/group/).[`customProperties`](/api/classes/group/#customproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
> `static` **ownDefaults**: `Record`\<`string`, `any`\> = `activeSelectionDefaultValues`
+Defined in: [src/shapes/ActiveSelection.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L39)
+
#### Overrides
[`Group`](/api/classes/group/).[`ownDefaults`](/api/classes/group/#owndefaults)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L39)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2037,49 +1708,47 @@ needs its cache regenerated during a .set call
[`Group`](/api/classes/group/).[`stateProperties`](/api/classes/group/#stateproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### ~~type~~
> `static` **type**: `string` = `'ActiveSelection'`
+Defined in: [src/shapes/ActiveSelection.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L37)
+
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
-
-add sustainable warning message
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
-#### Overrides
+#### TODO
-[`Group`](/api/classes/group/).[`type`](/api/classes/group/#type)
+add sustainable warning message
-#### Defined in
+#### Overrides
-[src/shapes/ActiveSelection.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L37)
+[`Group`](/api/classes/group/).[`type`](/api/classes/group/#type)
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2087,23 +1756,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
-`string`
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
-#### Inherited from
+##### Parameters
+
+###### value
+
+`string`
+
+##### Returns
-[`Group`](/api/classes/group/).[`type`](/api/classes/group/#type-1)
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#type-1)
## Methods
@@ -2111,15 +1786,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### clipPath
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **context**: `DrawContext`
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2129,54 +1812,49 @@ Prepare clipPath state and cache and draw it on instance's cache
[`Group`](/api/classes/group/).[`_drawClipPath`](/api/classes/group/#_drawclippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
+##### dims
-#### Returns
-
-`any`
-
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
[`Group`](/api/classes/group/).[`_limitCacheSize`](/api/classes/group/#_limitcachesize)
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_onObjectAdded()
> **\_onObjectAdded**(`object`): `void`
+Defined in: [src/shapes/Group.ts:256](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L256)
+
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
#### Returns
@@ -2186,16 +1864,14 @@ making bargain with performances.
[`Group`](/api/classes/group/).[`_onObjectAdded`](/api/classes/group/#_onobjectadded)
-#### Defined in
-
-[src/shapes/Group.ts:258](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L258)
-
***
### \_onStackOrderChanged()
> **\_onStackOrderChanged**(): `void`
+Defined in: [src/shapes/Group.ts:286](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L286)
+
#### Returns
`void`
@@ -2204,16 +1880,14 @@ making bargain with performances.
[`Group`](/api/classes/group/).[`_onStackOrderChanged`](/api/classes/group/#_onstackorderchanged)
-#### Defined in
-
-[src/shapes/Group.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L288)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2224,29 +1898,33 @@ Remove cacheCanvas and its dimensions from the objects
[`Group`](/api/classes/group/).[`_removeCacheCanvas`](/api/classes/group/#_removecachecanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?, `childrenOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`, `childrenOverride?`): `void`
+
+Defined in: [src/shapes/ActiveSelection.ts:233](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L233)
Renders controls and borders for the object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
+##### styleOverride?
+
+`Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
properties to override the object style
-• **childrenOverride?**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
+##### childrenOverride?
+
+`Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
properties to override the children overrides
@@ -2258,19 +1936,19 @@ properties to override the children overrides
[`Group`](/api/classes/group/).[`_renderControls`](/api/classes/group/#_rendercontrols)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L237)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2280,21 +1958,23 @@ properties to override the children overrides
[`Group`](/api/classes/group/).[`_setClippingProperties`](/api/classes/group/#_setclippingproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **\_\_namedParameters**: `Pick`\<[`ActiveSelection`](/api/classes/activeselection/), `"fill"`\>
+`CanvasRenderingContext2D`
+
+##### \_\_namedParameters
+
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2304,21 +1984,23 @@ properties to override the children overrides
[`Group`](/api/classes/group/).[`_setFillStyles`](/api/classes/group/#_setfillstyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **decl**: `Pick`\<[`ActiveSelection`](/api/classes/activeselection/), `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+##### decl
+
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2328,22 +2010,22 @@ properties to override the children overrides
[`Group`](/api/classes/group/).[`_setStrokeStyles`](/api/classes/group/#_setstrokestyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2355,21 +2037,21 @@ Rendering canvas context
[`Group`](/api/classes/group/).[`_setupCompositeOperation`](/api/classes/group/#_setupcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_toSVG()
-> **\_toSVG**(`reviver`?): `string`[]
+> **\_toSVG**(`reviver?`): `string`[]
+
+Defined in: [src/shapes/Group.ts:635](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L635)
Returns svg representation of an instance
#### Parameters
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -2383,21 +2065,21 @@ svg representation of an instance
[`Group`](/api/classes/group/).[`_toSVG`](/api/classes/group/#_tosvg)
-#### Defined in
-
-[src/shapes/Group.ts:637](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L637)
-
***
### add()
> **add**(...`objects`): `number`
+Defined in: [src/shapes/Group.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L226)
+
Add objects
#### Parameters
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -2407,19 +2089,19 @@ Add objects
[`Group`](/api/classes/group/).[`add`](/api/classes/group/#add)
-#### Defined in
-
-[src/shapes/Group.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L228)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2429,33 +2111,37 @@ Add objects
[`Group`](/api/classes/group/).[`addPaintOrder`](/api/classes/group/#addpaintorder)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2464,23 +2150,21 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
[`Group`](/api/classes/group/).[`animate`](/api/classes/group/#animate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### bringObjectForward()
-> **bringObjectForward**(`object`, `intersecting`?): `boolean`
+> **bringObjectForward**(`object`, `intersecting?`): `boolean`
+
+Defined in: [src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L240)
Moves an object or a selection up in stack of drawn objects
An optional parameter, intersecting allows to move the object in front
@@ -2490,11 +2174,15 @@ stack.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **intersecting?**: `boolean`
+##### intersecting?
+
+`boolean`
If `true`, send object in front of next upper intersecting object
@@ -2508,22 +2196,22 @@ true if change occurred
[`Group`](/api/classes/group/).[`bringObjectForward`](/api/classes/group/#bringobjectforward)
-#### Defined in
-
-[src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L240)
-
***
### bringObjectToFront()
> **bringObjectToFront**(`object`): `boolean`
+Defined in: [src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L194)
+
Moves an object or the objects of a multiple selection
to the top of the stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
@@ -2537,16 +2225,14 @@ true if change occurred
[`Group`](/api/classes/group/).[`bringObjectToFront`](/api/classes/group/#bringobjecttofront)
-#### Defined in
-
-[src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L194)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -2558,16 +2244,14 @@ those never change with zoom or viewport changes.
[`Group`](/api/classes/group/).[`calcACoords`](/api/classes/group/#calcacoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -2581,16 +2265,14 @@ is a public api and should be done just if extremely necessary
[`Group`](/api/classes/group/).[`calcOCoords`](/api/classes/group/#calcocoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -2604,22 +2286,22 @@ transform matrix for the object
[`Group`](/api/classes/group/).[`calcOwnMatrix`](/api/classes/group/#calcownmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -2634,21 +2316,21 @@ transform matrix for the object
[`Group`](/api/classes/group/).[`calcTransformMatrix`](/api/classes/group/#calctransformmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -2660,21 +2342,21 @@ true if the object currently dragged can be dropped on the target
[`Group`](/api/classes/group/).[`canDrop`](/api/classes/group/#candrop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### canEnterGroup()
> **canEnterGroup**(`object`): `boolean`
+Defined in: [src/shapes/ActiveSelection.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L115)
+
block ancestors/descendants of selected objects from being selected to prevent a circular object tree
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
#### Returns
@@ -2684,15 +2366,13 @@ block ancestors/descendants of selected objects from being selected to prevent a
`Group.canEnterGroup`
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L115)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -2701,7 +2381,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -2720,41 +2402,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
[`Group`](/api/classes/group/).[`clearContextTop`](/api/classes/group/#clearcontexttop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`ActiveSelection`](/api/classes/activeselection/)\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`ActiveSelection`\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`ActiveSelection`](/api/classes/activeselection/)\>
+`Promise`\<`ActiveSelection`\>
#### Inherited from
[`Group`](/api/classes/group/).[`clone`](/api/classes/group/#clone)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -2765,13 +2445,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -2783,31 +2465,33 @@ fix the export type, it could not be Image but the type that getClass return for
[`Group`](/api/classes/group/).[`cloneAsImage`](/api/classes/group/#cloneasimage)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### collectObjects()
> **collectObjects**(`bbox`, `options`): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L326)
+
Given a bounding box, return all the objects of the collection that are contained in the bounding box.
If `includeIntersecting` is true, return also the objects that intersect the bounding box as well.
This is meant to work with selection. Is not a generic method.
#### Parameters
-• **bbox**: [`TBBox`](/api/type-aliases/tbbox/)
+##### bbox
+
+[`TBBox`](/api/type-aliases/tbbox/)
a bounding box in scene coordinates
-• **options** = `{}`
+##### options
an object with includeIntersecting
-• **options.includeIntersecting?**: `boolean` = `true`
+###### includeIntersecting?
+
+`boolean` = `true`
#### Returns
@@ -2819,16 +2503,14 @@ array of objects contained in the bounding box, ordered from top to bottom stack
[`Group`](/api/classes/group/).[`collectObjects`](/api/classes/group/#collectobjects)
-#### Defined in
-
-[src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L326)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L165)
+
#### Returns
`number`
@@ -2839,27 +2521,29 @@ complexity
[`Group`](/api/classes/group/).[`complexity`](/api/classes/group/#complexity)
-#### Defined in
-
-[src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L165)
-
***
### contains()
-> **contains**(`object`, `deep`?): `boolean`
+> **contains**(`object`, `deep?`): `boolean`
+
+Defined in: [src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L148)
Returns true if collection contains an object.\
-**Prefer using [FabricObject#isDescendantOf](../../../../api/classes/fabricobject/#isdescendantof) for performance reasons**
+**Prefer using [FabricObject#isDescendantOf](/api/classes/fabricobject/#isdescendantof) for performance reasons**
instead of `a.contains(b)` use `b.isDescendantOf(a)`
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to check against
-• **deep?**: `boolean`
+##### deep?
+
+`boolean`
`true` to check all descendants, `false` to check only `_objects`
@@ -2873,21 +2557,21 @@ Object to check against
[`Group`](/api/classes/group/).[`contains`](/api/classes/group/#contains)
-#### Defined in
-
-[src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L148)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -2901,16 +2585,14 @@ true if point is inside the object
[`Group`](/api/classes/group/).[`containsPoint`](/api/classes/group/#containspoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Group.ts:603](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L603)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -2922,15 +2604,13 @@ override if necessary to dispose artifacts such as `clipPath`
[`Group`](/api/classes/group/).[`dispose`](/api/classes/group/#dispose)
-#### Defined in
-
-[src/shapes/Group.ts:605](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L605)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -2938,15 +2618,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -2958,23 +2644,25 @@ object to override the object style
[`Group`](/api/classes/group/).[`drawBorders`](/api/classes/group/#drawborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
+
+##### ctx
-• **ctx**: `CanvasRenderingContext2D`
+`CanvasRenderingContext2D`
Context to render on
@@ -2986,27 +2674,31 @@ Context to render on
[`Group`](/api/classes/group/).[`drawCacheOnCanvas`](/api/classes/group/#drawcacheoncanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
-• **canvasWithClipPath**: `HTMLCanvasElement`
+[`BaseFabricObject`](/api/classes/basefabricobject/)
+
+##### canvasWithClipPath
+
+`HTMLCanvasElement`
#### Returns
@@ -3016,16 +2708,14 @@ Context to render on
[`Group`](/api/classes/group/).[`drawClipPathOnCache`](/api/classes/group/#drawclippathoncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -3035,11 +2725,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -3051,27 +2745,29 @@ object to override the object style
[`Group`](/api/classes/group/).[`drawControls`](/api/classes/group/#drawcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -3083,27 +2779,31 @@ object size x = width, y = height
[`Group`](/api/classes/group/).[`drawControlsConnectingLines`](/api/classes/group/#drawcontrolsconnectinglines)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Group.ts:494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L494)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
+
+`undefined` | `boolean`
+
+##### context
-• **context**: `DrawContext`
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -3113,16 +2813,14 @@ Context to render on
[`Group`](/api/classes/group/).[`drawObject`](/api/classes/group/#drawobject)
-#### Defined in
-
-[src/shapes/Group.ts:496](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L496)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -3130,7 +2828,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -3148,25 +2848,27 @@ it seemed a good option, now is an edge case
[`Group`](/api/classes/group/).[`drawSelectionBackground`](/api/classes/group/#drawselectionbackground)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`ActiveSelection`](/api/classes/activeselection/)
+##### T
+
+`T` *extends* `ActiveSelection`
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3178,23 +2880,27 @@ an object that represent the ancestry situation.
[`Group`](/api/classes/group/).[`findCommonAncestors`](/api/classes/group/#findcommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### findNewLowerIndex()
-> **findNewLowerIndex**(`object`, `idx`, `intersecting`?): `number`
+> **findNewLowerIndex**(`object`, `idx`, `intersecting?`): `number`
+
+Defined in: [src/Collection.ts:272](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L272)
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
+
+##### idx
+
+`number`
-• **idx**: `number`
+##### intersecting?
-• **intersecting?**: `boolean`
+`boolean`
#### Returns
@@ -3204,23 +2910,27 @@ an object that represent the ancestry situation.
[`Group`](/api/classes/group/).[`findNewLowerIndex`](/api/classes/group/#findnewlowerindex)
-#### Defined in
-
-[src/Collection.ts:272](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L272)
-
***
### findNewUpperIndex()
-> **findNewUpperIndex**(`object`, `idx`, `intersecting`?): `number`
+> **findNewUpperIndex**(`object`, `idx`, `intersecting?`): `number`
+
+Defined in: [src/Collection.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L295)
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
+
+##### idx
+
+`number`
-• **idx**: `number`
+##### intersecting?
-• **intersecting?**: `boolean`
+`boolean`
#### Returns
@@ -3230,29 +2940,33 @@ an object that represent the ancestry situation.
[`Group`](/api/classes/group/).[`findNewUpperIndex`](/api/classes/group/#findnewupperindex)
-#### Defined in
-
-[src/Collection.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L295)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+##### K
+
+`K` *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: [`GroupEvents`](/api/interfaces/groupevents/)\[`K`\]
+##### options?
+
+[`GroupEvents`](/api/interfaces/groupevents/)\[`K`\]
Options object
@@ -3264,22 +2978,22 @@ Options object
[`Group`](/api/classes/group/).[`fire`](/api/classes/group/#fire)
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3291,23 +3005,23 @@ function to iterate over the controls over
[`Group`](/api/classes/group/).[`forEachControl`](/api/classes/group/#foreachcontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### forEachObject()
> **forEachObject**(`callback`): `void`
+Defined in: [src/Collection.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L91)
+
Executes given function for each object in this group
A simple shortcut for getObjects().forEach, before es6 was more complicated,
now is just a shortcut.
#### Parameters
-• **callback**
+##### callback
+
+(`object`, `index`, `array`) => `any`
Callback invoked with current object as first argument,
index - as second and an array of all objects - as third.
@@ -3320,21 +3034,21 @@ Callback invoked with current object as first argument,
[`Group`](/api/classes/group/).[`forEachObject`](/api/classes/group/#foreachobject)
-#### Defined in
-
-[src/Collection.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L91)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3348,34 +3062,30 @@ value of a property
[`Group`](/api/classes/group/).[`get`](/api/classes/group/#get)
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
[`Group`](/api/classes/group/).[`getActiveControl`](/api/classes/group/#getactivecontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3386,16 +3096,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
[`Group`](/api/classes/group/).[`getAncestors`](/api/classes/group/#getancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3409,16 +3117,14 @@ Object with left, top, width, height properties
[`Group`](/api/classes/group/).[`getBoundingRect`](/api/classes/group/#getboundingrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3427,16 +3133,14 @@ Object with left, top, width, height properties
[`Group`](/api/classes/group/).[`getCanvasRetinaScaling`](/api/classes/group/#getcanvasretinascaling)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3447,16 +3151,14 @@ Returns the center coordinates of the object relative to canvas
[`Group`](/api/classes/group/).[`getCenterPoint`](/api/classes/group/#getcenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -3467,16 +3169,14 @@ Returns the center coordinates of the object relative to canvas
[`Group`](/api/classes/group/).[`getCoords`](/api/classes/group/#getcoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -3487,55 +3187,49 @@ Return the object opacity counting also the group property
[`Group`](/api/classes/group/).[`getObjectOpacity`](/api/classes/group/#getobjectopacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
-### getObjectScaling()
+### getObjects()
-> **getObjectScaling**(): [`Point`](/api/classes/point/)
+> **getObjects**(...`types?`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
-Return the object scale factor counting also the group scaling
+Defined in: [src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L108)
-#### Returns
+Returns an array of children objects of this instance
-[`Point`](/api/classes/point/)
+#### Parameters
-#### Inherited from
+##### types?
-[`Group`](/api/classes/group/).[`getObjectScaling`](/api/classes/group/#getobjectscaling)
+...`string`[]
-#### Defined in
+When specified, only objects of these types are returned
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
+#### Returns
-***
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
-### getObjects()
+#### Inherited from
-> **getObjects**(...`types`?): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+[`Group`](/api/classes/group/).[`getObjects`](/api/classes/group/#getobjects)
-Returns an array of children objects of this instance
+***
-#### Parameters
+### getObjectScaling()
-• ...**types?**: `string`[]
+> **getObjectScaling**(): [`Point`](/api/classes/point/)
-When specified, only objects of these types are returned
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
+Return the object scale factor counting also the group scaling
#### Returns
-[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+[`Point`](/api/classes/point/)
#### Inherited from
-[`Group`](/api/classes/group/).[`getObjects`](/api/classes/group/#getobjects)
-
-#### Defined in
-
-[src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L108)
+[`Group`](/api/classes/group/).[`getObjectScaling`](/api/classes/group/#getobjectscaling)
***
@@ -3543,6 +3237,8 @@ When specified, only objects of these types are returned
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -3552,11 +3248,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3568,16 +3268,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`getPointByOrigin`](/api/classes/group/#getpointbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -3588,78 +3286,70 @@ Returns the center coordinates of the object relative to it's parent
[`Group`](/api/classes/group/).[`getRelativeCenterPoint`](/api/classes/group/#getrelativecenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/activeselection/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/activeselection/#getx)
#### Inherited from
[`Group`](/api/classes/group/).[`getRelativeX`](/api/classes/group/#getrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
[`Group`](/api/classes/group/).[`getRelativeXY`](/api/classes/group/#getrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/activeselection/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/activeselection/#gety)
#### Inherited from
[`Group`](/api/classes/group/).[`getRelativeY`](/api/classes/group/#getrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -3676,16 +3366,14 @@ shouldn't this account for group transform and return the actual size in canvas
[`Group`](/api/classes/group/).[`getScaledHeight`](/api/classes/group/#getscaledheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -3702,21 +3390,21 @@ shouldn't this account for group transform and return the actual size in canvas
[`Group`](/api/classes/group/).[`getScaledWidth`](/api/classes/group/#getscaledwidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -3726,21 +3414,21 @@ Returns id attribute for svg output
[`Group`](/api/classes/group/).[`getSvgCommons`](/api/classes/group/#getsvgcommons)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3750,16 +3438,14 @@ Returns filter for svg shadow
[`Group`](/api/classes/group/).[`getSvgFilter`](/api/classes/group/#getsvgfilter)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### getSvgStyles()
> **getSvgStyles**(): `string`
+Defined in: [src/shapes/Group.ts:650](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L650)
+
Returns styles-string for svg-export, specific version for group
#### Returns
@@ -3770,25 +3456,29 @@ Returns styles-string for svg-export, specific version for group
[`Group`](/api/classes/group/).[`getSvgStyles`](/api/classes/group/#getsvgstyles)
-#### Defined in
-
-[src/shapes/Group.ts:652](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L652)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### full?
+
+`boolean`
-• **full?**: `boolean`
+##### additionalTransform?
-• **additionalTransform?**: `string` = `''`
+`string` = `''`
#### Returns
@@ -3798,16 +3488,14 @@ Returns transform-string for svg-export
[`Group`](/api/classes/group/).[`getSvgTransform`](/api/classes/group/#getsvgtransform)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -3818,16 +3506,14 @@ Returns the object angle relative to canvas counting also the group property
[`Group`](/api/classes/group/).[`getTotalAngle`](/api/classes/group/#gettotalangle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -3840,16 +3526,14 @@ object with scaleX and scaleY properties
[`Group`](/api/classes/group/).[`getTotalObjectScaling`](/api/classes/group/#gettotalobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -3860,83 +3544,79 @@ Retrieves viewportTransform from Object's canvas if available
[`Group`](/api/classes/group/).[`getViewportTransform`](/api/classes/group/#getviewporttransform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
[`Group`](/api/classes/group/).[`getX`](/api/classes/group/#getx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
[`Group`](/api/classes/group/).[`getXY`](/api/classes/group/#getxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
[`Group`](/api/classes/group/).[`getY`](/api/classes/group/#gety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`ActiveSelection`](/api/classes/activeselection/)
+##### T
+
+`T` *extends* `ActiveSelection`
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3946,15 +3626,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy
[`Group`](/api/classes/group/).[`hasCommonAncestors`](/api/classes/group/#hascommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3965,7 +3643,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -3977,15 +3655,13 @@ Boolean
[`Group`](/api/classes/group/).[`hasFill`](/api/classes/group/#hasfill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3996,7 +3672,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4008,25 +3684,27 @@ Boolean
[`Group`](/api/classes/group/).[`hasStroke`](/api/classes/group/#hasstroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### insertAt()
> **insertAt**(`index`, ...`objects`): `number`
+Defined in: [src/shapes/Group.ts:238](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L238)
+
Inserts an object into collection at specified index
#### Parameters
-• **index**: `number`
+##### index
+
+`number`
Index to insert object at
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
Object to insert
@@ -4038,21 +3716,21 @@ Object to insert
[`Group`](/api/classes/group/).[`insertAt`](/api/classes/group/#insertat)
-#### Defined in
-
-[src/shapes/Group.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L240)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4066,23 +3744,25 @@ true if object intersects with another object
[`Group`](/api/classes/group/).[`intersectsWithObject`](/api/classes/group/#intersectswithobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -4092,21 +3772,24 @@ Checks if object intersects with the scene rect formed by tl and br
[`Group`](/api/classes/group/).[`intersectsWithRect`](/api/classes/group/#intersectswithrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -4119,21 +3802,21 @@ on parent canvas.
[`Group`](/api/classes/group/).[`isCacheDirty`](/api/classes/group/#iscachedirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4147,23 +3830,25 @@ true if object is fully contained within area of another object
[`Group`](/api/classes/group/).[`isContainedWithinObject`](/api/classes/group/#iscontainedwithinobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
+
+##### br
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -4173,21 +3858,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
[`Group`](/api/classes/group/).[`isContainedWithinRect`](/api/classes/group/#iscontainedwithinrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -4202,22 +3887,22 @@ true if the specified control is visible, false otherwise
[`Group`](/api/classes/group/).[`isControlVisible`](/api/classes/group/#iscontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -4227,16 +3912,14 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
[`Group`](/api/classes/group/).[`isDescendantOf`](/api/classes/group/#isdescendantof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isEmpty()
> **isEmpty**(): `boolean`
+Defined in: [src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L128)
+
Returns true if collection contains no objects
#### Returns
@@ -4249,23 +3932,25 @@ true if collection is empty
[`Group`](/api/classes/group/).[`isEmpty`](/api/classes/group/#isempty)
-#### Defined in
-
-[src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L128)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`ActiveSelection`](/api/classes/activeselection/)
+##### T
+
+`T` *extends* `ActiveSelection`
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -4279,16 +3964,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`Group`](/api/classes/group/).[`isInFrontOf`](/api/classes/group/#isinfrontof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -4297,16 +3982,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`Group`](/api/classes/group/).[`isNotVisible`](/api/classes/group/#isnotvisible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnACache()
> **isOnACache**(): `boolean`
+Defined in: [src/shapes/ActiveSelection.ts:223](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L223)
+
Check if this group or its parent group are caching, recursively up
#### Returns
@@ -4317,16 +4000,14 @@ Check if this group or its parent group are caching, recursively up
[`Group`](/api/classes/group/).[`isOnACache`](/api/classes/group/#isonacache)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:227](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L227)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -4340,23 +4021,25 @@ true if object is fully or partially contained within canvas
[`Group`](/api/classes/group/).[`isOnScreen`](/api/classes/group/#isonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4366,16 +4049,14 @@ true if object is fully or partially contained within canvas
[`Group`](/api/classes/group/).[`isOverlapping`](/api/classes/group/#isoverlapping)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -4388,45 +4069,57 @@ true if object is partially contained within canvas
[`Group`](/api/classes/group/).[`isPartiallyOnScreen`](/api/classes/group/#ispartiallyonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
[`Group`](/api/classes/group/).[`isType`](/api/classes/group/#istype)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### item()
> **item**(`index`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/Collection.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L120)
+
Returns object at specified index
#### Parameters
-• **index**: `number`
+##### index
+
+`number`
#### Returns
@@ -4438,25 +4131,27 @@ object at index
[`Group`](/api/classes/group/).[`item`](/api/classes/group/#item)
-#### Defined in
-
-[src/Collection.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L120)
-
***
### moveObjectTo()
> **moveObjectTo**(`object`, `index`): `boolean`
+Defined in: [src/Collection.ts:262](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L262)
+
Moves an object to specified level in stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **index**: `number`
+##### index
+
+`number`
Position to move to
@@ -4470,21 +4165,21 @@ true if change occurred
[`Group`](/api/classes/group/).[`moveObjectTo`](/api/classes/group/#moveobjectto)
-#### Defined in
-
-[src/Collection.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L262)
-
***
### multiSelectAdd()
> **multiSelectAdd**(...`targets`): `void`
-Adds objects with respect to [multiSelectionStacking](../../../../api/classes/activeselection/#multiselectionstacking)
+Defined in: [src/shapes/ActiveSelection.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L94)
+
+Adds objects with respect to [multiSelectionStacking](/api/classes/activeselection/#multiselectionstacking)
#### Parameters
-• ...**targets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### targets
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
object to add to selection
@@ -4492,17 +4187,15 @@ object to add to selection
`void`
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L94)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -4518,18 +4211,16 @@ Boolean
[`Group`](/api/classes/group/).[`needsItsOwnCache`](/api/classes/group/#needsitsowncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -4540,11 +4231,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+###### K
+
+`K` *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -4556,27 +4251,31 @@ event name (eg. 'after:render')
[`Group`](/api/classes/group/).[`off`](/api/classes/group/#off)
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+###### K
+
+`K` *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -4588,19 +4287,19 @@ event listener to unsubscribe
[`Group`](/api/classes/group/).[`off`](/api/classes/group/#off)
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<[`GroupEvents`](/api/interfaces/groupevents/)\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -4612,14 +4311,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
[`Group`](/api/classes/group/).[`off`](/api/classes/group/#off)
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -4630,33 +4327,39 @@ unsubscribe all event listeners
[`Group`](/api/classes/group/).[`off`](/api/classes/group/#off)
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+###### K
+
+`K` *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+
+###### E
-• **E** *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `object` \| `object` \| `object` \| `TEventWithTarget`\<`DragEvent`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| [`DropEventData`](/api/interfaces/dropeventdata/) \| `SimpleEventHandler`\<`Event`\> \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `object` \| `object` \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/)
+`E` *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| `SimpleEventHandler`\<`Event`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DropEventData`](/api/interfaces/dropeventdata/) \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| \{ `target`: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; \} \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| \{ `target`: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \}
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -4674,171 +4377,191 @@ on
[`Group`](/api/classes/group/).[`on`](/api/classes/group/#on)
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<[`GroupEvents`](/api/interfaces/groupevents/)\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-[`Group`](/api/classes/group/).[`on`](/api/classes/group/#on)
+##### Alias
+
+on
-##### Defined in
+##### Inherited from
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+[`Group`](/api/classes/group/).[`on`](/api/classes/group/#on)
***
-### onDeselect()
+### once()
-> **onDeselect**(): `boolean`
+#### Call Signature
-remove all objects
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-#### Returns
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
-`boolean`
+Observes specified event **once**
-#### Overrides
+##### Type Parameters
-[`Group`](/api/classes/group/).[`onDeselect`](/api/classes/group/#ondeselect)
+###### K
-#### Defined in
+`K` *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
-[src/shapes/ActiveSelection.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L198)
+###### E
-***
+`E` *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| `SimpleEventHandler`\<`Event`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DropEventData`](/api/interfaces/dropeventdata/) \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| \{ `target`: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; \} \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| \{ `target`: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \}
-### onDragStart()
+##### Parameters
-> **onDragStart**(`_e`): `boolean`
+###### eventName
-Override to customize Drag behavior\
-Fired once a drag session has started
+`K`
-#### Parameters
+Event name (eg. 'after:render')
-• **\_e**: `DragEvent`
+###### handler
-#### Returns
+`TEventCallback`\<`E`\>
-`boolean`
+Function that receives a notification when an event of the specified type occurs
-true to handle the drag event
+##### Returns
-#### Inherited from
+`VoidFunction`
-[`Group`](/api/classes/group/).[`onDragStart`](/api/classes/group/#ondragstart)
+disposer
-#### Defined in
+##### Alias
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
+once
-***
+##### Inherited from
-### onSelect()
+[`Group`](/api/classes/group/).[`once`](/api/classes/group/#once)
-> **onSelect**(`_options`?): `boolean`
+#### Call Signature
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to select this object. If the function returns true, the process is cancelled
+> **once**(`handlers`): `VoidFunction`
-#### Parameters
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
-• **\_options?**
+Observes specified event **once**
-options sent from the upper functions
+##### Parameters
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### handlers
-event if the process is generated by an event
+`EventRegistryObject`\<`EventSpec`\>
-#### Returns
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
-`boolean`
+##### Returns
-#### Inherited from
+`VoidFunction`
-[`Group`](/api/classes/group/).[`onSelect`](/api/classes/group/#onselect)
+disposer
+
+##### Alias
-#### Defined in
+once
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
+##### Inherited from
+
+[`Group`](/api/classes/group/).[`once`](/api/classes/group/#once)
***
-### once()
+### onDeselect()
-#### once(eventName, handler)
+> **onDeselect**(): `boolean`
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/shapes/ActiveSelection.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L198)
-Observes specified event **once**
+remove all objects
-##### Type Parameters
+#### Returns
-• **K** *extends* keyof [`GroupEvents`](/api/interfaces/groupevents/)
+`boolean`
-• **E** *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `object` \| `object` \| `object` \| `TEventWithTarget`\<`DragEvent`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| [`DropEventData`](/api/interfaces/dropeventdata/) \| `SimpleEventHandler`\<`Event`\> \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `object` \| `object` \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/)
+#### Overrides
-##### Parameters
+[`Group`](/api/classes/group/).[`onDeselect`](/api/classes/group/#ondeselect)
-• **eventName**: `K`
+***
-Event name (eg. 'after:render')
+### onDragStart()
-• **handler**: `TEventCallback`\<`E`\>
+> **onDragStart**(`_e`): `boolean`
-Function that receives a notification when an event of the specified type occurs
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
-##### Returns
+Override to customize Drag behavior\
+Fired once a drag session has started
-`VoidFunction`
+#### Parameters
-disposer
+##### \_e
-##### Alias
+`DragEvent`
-once
+#### Returns
-##### Inherited from
+`boolean`
-[`Group`](/api/classes/group/).[`once`](/api/classes/group/#once)
+true to handle the drag event
-##### Defined in
+#### Inherited from
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+[`Group`](/api/classes/group/).[`onDragStart`](/api/classes/group/#ondragstart)
-#### once(handlers)
+***
-> **once**(`handlers`): `VoidFunction`
+### onSelect()
-##### Parameters
+> **onSelect**(`_options?`): `boolean`
-• **handlers**: `EventRegistryObject`\<[`GroupEvents`](/api/interfaces/groupevents/)\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
-##### Returns
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to select this object. If the function returns true, the process is cancelled
-`VoidFunction`
+#### Parameters
-##### Inherited from
+##### \_options?
-[`Group`](/api/classes/group/).[`once`](/api/classes/group/#once)
+options sent from the upper functions
+
+###### e?
-##### Defined in
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+event if the process is generated by an event
+
+#### Returns
+
+`boolean`
+
+#### Inherited from
+
+[`Group`](/api/classes/group/).[`onSelect`](/api/classes/group/#onselect)
***
@@ -4846,11 +4569,15 @@ once
> **remove**(...`objects`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/shapes/Group.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L250)
+
Remove objects
#### Parameters
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -4862,16 +4589,14 @@ removed objects
[`Group`](/api/classes/group/).[`remove`](/api/classes/group/#remove)
-#### Defined in
-
-[src/shapes/Group.ts:252](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L252)
-
***
### removeAll()
> **removeAll**(): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/shapes/Group.ts:317](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L317)
+
Remove all objects
#### Returns
@@ -4884,21 +4609,21 @@ removed objects
[`Group`](/api/classes/group/).[`removeAll`](/api/classes/group/#removeall)
-#### Defined in
-
-[src/shapes/Group.ts:319](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L319)
-
***
### render()
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Group.ts:537](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L537)
+
Renders instance on a given context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
context to render instance on
@@ -4910,21 +4635,23 @@ context to render instance on
[`Group`](/api/classes/group/).[`render`](/api/classes/group/#render)
-#### Defined in
-
-[src/shapes/Group.ts:539](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L539)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
+
+##### options?
-• **options?**: `any`
+`any`
#### Returns
@@ -4934,23 +4661,23 @@ context to render instance on
[`Group`](/api/classes/group/).[`renderCache`](/api/classes/group/#rendercache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4960,16 +4687,14 @@ example: render the selection status for the part of text that is being dragged
[`Group`](/api/classes/group/).[`renderDragSourceEffect`](/api/classes/group/#renderdragsourceeffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -4977,7 +4702,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4987,21 +4714,21 @@ object will change when dropping. example: show the cursor where the text is abo
[`Group`](/api/classes/group/).[`renderDropTargetEffect`](/api/classes/group/#renderdroptargeteffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -5013,21 +4740,21 @@ Angle value (in degrees)
[`Group`](/api/classes/group/).[`rotate`](/api/classes/group/#rotate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -5039,21 +4766,21 @@ Scale factor
[`Group`](/api/classes/group/).[`scale`](/api/classes/group/#scale)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -5065,21 +4792,21 @@ New height value
[`Group`](/api/classes/group/).[`scaleToHeight`](/api/classes/group/#scaletoheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -5091,15 +4818,13 @@ New width value
[`Group`](/api/classes/group/).[`scaleToWidth`](/api/classes/group/#scaletowidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### sendObjectBackwards()
-> **sendObjectBackwards**(`object`, `intersecting`?): `boolean`
+> **sendObjectBackwards**(`object`, `intersecting?`): `boolean`
+
+Defined in: [src/Collection.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L214)
Moves an object or a selection down in stack of drawn objects
An optional parameter, `intersecting` allows to move the object in behind
@@ -5109,11 +4834,15 @@ stack.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **intersecting?**: `boolean`
+##### intersecting?
+
+`boolean`
If `true`, send object behind next lower intersecting object
@@ -5127,22 +4856,22 @@ true if change occurred
[`Group`](/api/classes/group/).[`sendObjectBackwards`](/api/classes/group/#sendobjectbackwards)
-#### Defined in
-
-[src/Collection.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L214)
-
***
### sendObjectToBack()
> **sendObjectToBack**(`object`): `boolean`
+Defined in: [src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L178)
+
Moves an object or the objects of a multiple selection
to the bottom of the stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send to back
@@ -5156,102 +4885,102 @@ true if change occurred
[`Group`](/api/classes/group/).[`sendObjectToBack`](/api/classes/group/#sendobjecttoback)
-#### Defined in
-
-[src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L178)
-
***
### set()
-> **set**(`key`, `value`?): [`ActiveSelection`](/api/classes/activeselection/)
+> **set**(`key`, `value?`): `ActiveSelection`
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`ActiveSelection`](/api/classes/activeselection/)
+`ActiveSelection`
#### Inherited from
[`Group`](/api/classes/group/).[`set`](/api/classes/group/#set)
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
-### setControlVisible()
+### setControlsVisibility()
-> **setControlVisible**(`controlKey`, `visible`): `void`
+> **setControlsVisibility**(`options?`): `void`
-Sets the visibility of the specified control.
-please do not use.
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
-#### Parameters
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
-• **controlKey**: `string`
+#### Parameters
-The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
-but since the control api allow for any control name, can be any string.
+##### options?
-• **visible**: `boolean`
+`Record`\<`string`, `boolean`\> = `{}`
-true to set the specified control visible, false otherwise
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
#### Returns
`void`
-#### Todo
+#### Inherited from
-discuss this overlap of priority here with the team. Andrea Bogazzi for details
+[`Group`](/api/classes/group/).[`setControlsVisibility`](/api/classes/group/#setcontrolsvisibility)
-#### Inherited from
+***
-[`Group`](/api/classes/group/).[`setControlVisible`](/api/classes/group/#setcontrolvisible)
+### setControlVisible()
-#### Defined in
+> **setControlVisible**(`controlKey`, `visible`): `void`
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
-***
+Sets the visibility of the specified control.
+please do not use.
-### setControlsVisibility()
+#### Parameters
-> **setControlsVisibility**(`options`?): `void`
+##### controlKey
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+`string`
-#### Parameters
+The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
+but since the control api allow for any control name, can be any string.
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
+##### visible
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+`boolean`
+
+true to set the specified control visible, false otherwise
#### Returns
`void`
-#### Inherited from
+#### Todo
-[`Group`](/api/classes/group/).[`setControlsVisibility`](/api/classes/group/#setcontrolsvisibility)
+discuss this overlap of priority here with the team. Andrea Bogazzi for details
-#### Defined in
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
+[`Group`](/api/classes/group/).[`setControlVisible`](/api/classes/group/#setcontrolvisible)
***
@@ -5259,6 +4988,8 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
> **setCoords**(): `void`
+Defined in: [src/shapes/Group.ts:519](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L519)
+
#### Returns
`void`
@@ -5267,16 +4998,14 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
[`Group`](/api/classes/group/).[`setCoords`](/api/classes/group/#setcoords)
-#### Defined in
-
-[src/shapes/Group.ts:521](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L521)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -5290,29 +5019,33 @@ Travis build error about unused variables.
[`Group`](/api/classes/group/).[`setOnGroup`](/api/classes/group/#setongroup)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5324,22 +5057,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`setPositionByOrigin`](/api/classes/group/#setpositionbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/activeselection/#setx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/activeselection/#setx)
#### Returns
@@ -5349,29 +5082,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
[`Group`](/api/classes/group/).[`setRelativeX`](/api/classes/group/#setrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
-As [setXY](../../../../api/classes/activeselection/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+As [setXY](/api/classes/activeselection/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -5383,22 +5120,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`setRelativeXY`](/api/classes/group/#setrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/activeselection/#sety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/activeselection/#sety)
#### Returns
@@ -5408,21 +5145,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
[`Group`](/api/classes/group/).[`setRelativeY`](/api/classes/group/#setrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+`number`
+
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -5432,15 +5169,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
[`Group`](/api/classes/group/).[`setX`](/api/classes/group/#setx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -5448,15 +5183,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5474,21 +5215,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
[`Group`](/api/classes/group/).[`setXY`](/api/classes/group/#setxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -5498,21 +5239,15 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
[`Group`](/api/classes/group/).[`setY`](/api/classes/group/#sety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
-Decide if the object should cache or not. Create its own cache level
-objectCaching is a global flag, wins over everything
-needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
-Generally you do not cache objects in groups because the group outside is cached.
+Defined in: [src/shapes/ActiveSelection.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L215)
+
+Decide if the object should cache or not. The Active selection never caches
#### Returns
@@ -5522,22 +5257,22 @@ Generally you do not cache objects in groups because the group outside is cached
[`Group`](/api/classes/group/).[`shouldCache`](/api/classes/group/#shouldcache)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L219)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -5549,16 +5284,14 @@ true in order for the window to start a drag session
[`Group`](/api/classes/group/).[`shouldStartDragging`](/api/classes/group/#shouldstartdragging)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### size()
> **size**(): `number`
+Defined in: [src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L136)
+
Returns a size of a collection (i.e: length of an array containing its objects)
#### Returns
@@ -5571,25 +5304,27 @@ Collection size
[`Group`](/api/classes/group/).[`size`](/api/classes/group/#size)
-#### Defined in
-
-[src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L136)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -5601,9 +5336,27 @@ the control box size used
[`Group`](/api/classes/group/).[`strokeBorders`](/api/classes/group/#strokeborders)
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
+
+`toDataURLOptions` = `{}`
+
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
+
+[`Group`](/api/classes/group/).[`toBlob`](/api/classes/group/#toblob)
***
@@ -5611,11 +5364,15 @@ the control box size used
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -5629,21 +5386,21 @@ Returns DOM element
with the FabricObject
[`Group`](/api/classes/group/).[`toCanvasElement`](/api/classes/group/#tocanvaselement)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`reviver`?): `string`
+> **toClipPathSVG**(`reviver?`): `string`
+
+Defined in: [src/shapes/Group.ts:664](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L664)
Returns svg clipPath representation of an instance
#### Parameters
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -5657,9 +5414,33 @@ svg representation of an instance
[`Group`](/api/classes/group/).[`toClipPathSVG`](/api/classes/group/#toclippathsvg)
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
+
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
-[src/shapes/Group.ts:666](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L666)
+[`Group`](/api/classes/group/).[`toDatalessObject`](/api/classes/group/#todatalessobject)
***
@@ -5667,11 +5448,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -5685,37 +5470,31 @@ Returns a data: URL containing a representation of the object in the format spec
[`Group`](/api/classes/group/).[`toDataURL`](/api/classes/group/#todataurl)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `ActiveSelection`
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`ActiveSelection`
#### Inherited from
-[`Group`](/api/classes/group/).[`toDatalessObject`](/api/classes/group/#todatalessobject)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+[`Group`](/api/classes/group/).[`toggle`](/api/classes/group/#toggle)
***
@@ -5723,6 +5502,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -5735,27 +5516,31 @@ JSON
[`Group`](/api/classes/group/).[`toJSON`](/api/classes/group/#tojson)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)
+> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)
+
+Defined in: [src/shapes/Group.ts:574](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L574)
Returns object representation of an instance
#### Type Parameters
-• **T** *extends* `Omit`\<[`GroupProps`](/api/interfaces/groupprops/) & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`ActiveSelection`](/api/classes/activeselection/)\>, keyof [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)\>
+##### T
-• **K** *extends* `string` \| `number` \| `symbol` = `never`
+`T` *extends* `Omit`\<[`GroupProps`](/api/interfaces/groupprops/) & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`ActiveSelection`\>, keyof [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)\>
+
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol` = `never`
#### Parameters
-• **propertiesToInclude?**: `K`[] = `[]`
+##### propertiesToInclude?
+
+`K`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -5769,46 +5554,14 @@ object representation of an instance
[`Group`](/api/classes/group/).[`toObject`](/api/classes/group/#toobject)
-#### Defined in
-
-[src/shapes/Group.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L576)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-[`Group`](/api/classes/group/).[`toSVG`](/api/classes/group/#tosvg)
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/ActiveSelection.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L207)
+
Returns string representation of a group
#### Returns
@@ -5819,35 +5572,37 @@ Returns string representation of a group
[`Group`](/api/classes/group/).[`toString`](/api/classes/group/#tostring)
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L207)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`ActiveSelection`](/api/classes/activeselection/)
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`ActiveSelection`](/api/classes/activeselection/)
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-[`Group`](/api/classes/group/).[`toggle`](/api/classes/group/#toggle)
+#### Returns
-#### Defined in
+`string`
+
+svg representation of an instance
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+#### Inherited from
+
+[`Group`](/api/classes/group/).[`toSVG`](/api/classes/group/#tosvg)
***
@@ -5855,11 +5610,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -5871,19 +5630,19 @@ Context
[`Group`](/api/classes/group/).[`transform`](/api/classes/group/#transform)
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -5893,29 +5652,33 @@ Context
[`Group`](/api/classes/group/).[`transformMatrixKey`](/api/classes/group/#transformmatrixkey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5927,37 +5690,45 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`translateToCenterPoint`](/api/classes/group/#translatetocenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5969,29 +5740,33 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`translateToGivenOrigin`](/api/classes/group/#translatetogivenorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6003,19 +5778,19 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`translateToOriginPoint`](/api/classes/group/#translatetooriginpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### triggerLayout()
> **triggerLayout**(`options`): `void`
+Defined in: [src/shapes/Group.ts:525](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L525)
+
#### Parameters
-• **options**: [`ImperativeLayoutOptions`](/api/type-aliases/imperativelayoutoptions/) = `{}`
+##### options
+
+[`ImperativeLayoutOptions`](/api/type-aliases/imperativelayoutoptions/) = `{}`
#### Returns
@@ -6025,16 +5800,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`Group`](/api/classes/group/).[`triggerLayout`](/api/classes/group/#triggerlayout)
-#### Defined in
-
-[src/shapes/Group.ts:527](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L527)
-
***
### willDrawShadow()
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Group.ts:470](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L470)
+
Check if this object or a child object will cast a shadow
#### Returns
@@ -6045,25 +5818,29 @@ Check if this object or a child object will cast a shadow
[`Group`](/api/classes/group/).[`willDrawShadow`](/api/classes/group/#willdrawshadow)
-#### Defined in
-
-[src/shapes/Group.ts:472](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L472)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
+
+`Record`\<`string`, `unknown`\>
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -6073,16 +5850,14 @@ Check if this object or a child object will cast a shadow
[`Group`](/api/classes/group/).[`_fromObject`](/api/classes/group/#_fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -6099,16 +5874,14 @@ make this function return an empty object and add controls to the ownDefaults
[`Group`](/api/classes/group/).[`createControls`](/api/classes/group/#createcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/ActiveSelection.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L41)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -6116,7 +5889,3 @@ make this function return an empty object and add controls to the ownDefaults
#### Overrides
[`Group`](/api/classes/group/).[`getDefaults`](/api/classes/group/#getdefaults)
-
-#### Defined in
-
-[src/shapes/ActiveSelection.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L41)
diff --git a/src/content/docs/api/classes/BaseBrush.md b/src/content/docs/api/classes/BaseBrush.md
index b98625ce5..09d2a79d7 100644
--- a/src/content/docs/api/classes/BaseBrush.md
+++ b/src/content/docs/api/classes/BaseBrush.md
@@ -5,9 +5,11 @@ prev: false
title: "BaseBrush"
---
+Defined in: [src/brushes/BaseBrush.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L10)
+
## See
-[demo](http://fabricjs.com/freedrawing|Freedrawing)
+[demo](http://fabric5.fabricjs.com/freedrawing|Freedrawing)
## Extended by
@@ -17,21 +19,21 @@ title: "BaseBrush"
## Constructors
-### new BaseBrush()
+### Constructor
-> **new BaseBrush**(`canvas`): [`BaseBrush`](/api/classes/basebrush/)
+> **new BaseBrush**(`canvas`): `BaseBrush`
-#### Parameters
+Defined in: [src/brushes/BaseBrush.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L68)
-• **canvas**: [`Canvas`](/api/classes/canvas/)
+#### Parameters
-#### Returns
+##### canvas
-[`BaseBrush`](/api/classes/basebrush/)
+[`Canvas`](/api/classes/canvas/)
-#### Defined in
+#### Returns
-[src/brushes/BaseBrush.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L75)
+`BaseBrush`
## Properties
@@ -39,31 +41,21 @@ title: "BaseBrush"
> **canvas**: [`Canvas`](/api/classes/canvas/)
+Defined in: [src/brushes/BaseBrush.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L66)
+
#### Todo
add type
-#### Defined in
-
-[src/brushes/BaseBrush.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L73)
-
***
### color
> **color**: `string` = `'rgb(0, 0, 0)'`
-Color of a brush
-
-#### Default
+Defined in: [src/brushes/BaseBrush.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L15)
-```ts
-
-```
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L16)
+Color of a brush
***
@@ -71,6 +63,8 @@ Color of a brush
> **limitedToCanvasSize**: `boolean` = `false`
+Defined in: [src/brushes/BaseBrush.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L61)
+
When `true`, the free drawing is limited to the whiteboard size. Default to false.
#### Default
@@ -79,47 +73,27 @@ When `true`, the free drawing is limited to the whiteboard size. Default to fals
false
```
-#### Defined in
-
-[src/brushes/BaseBrush.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L68)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) = `null`
+Defined in: [src/brushes/BaseBrush.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L29)
+
Shadow object representing shadow of this shape.
Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number),
"shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L32)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[] = `null`
-Stroke Dash Array.
-
-#### Default
+Defined in: [src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L53)
-```ts
-
-```
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L60)
+Stroke Dash Array.
***
@@ -127,17 +101,9 @@ Stroke Dash Array.
> **strokeLineCap**: `CanvasLineCap` = `'round'`
-Line endings style of a brush (one of "butt", "round", "square")
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
+Defined in: [src/brushes/BaseBrush.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L35)
-[src/brushes/BaseBrush.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L39)
+Line endings style of a brush (one of "butt", "round", "square")
***
@@ -145,17 +111,9 @@ Line endings style of a brush (one of "butt", "round", "square")
> **strokeLineJoin**: `CanvasLineJoin` = `'round'`
-Corner style of a brush (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
+Defined in: [src/brushes/BaseBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L41)
-[src/brushes/BaseBrush.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L46)
+Corner style of a brush (one of "bevel", "round", "miter")
***
@@ -163,17 +121,9 @@ Corner style of a brush (one of "bevel", "round", "miter")
> **strokeMiterLimit**: `number` = `10`
-Maximum miter length (used for strokeLineJoin = "miter") of a brush's
+Defined in: [src/brushes/BaseBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L47)
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L53)
+Maximum miter length (used for strokeLineJoin = "miter") of a brush's
***
@@ -181,17 +131,9 @@ Maximum miter length (used for strokeLineJoin = "miter") of a brush's
> **width**: `number` = `1`
-Width of a brush, has to be a Number, no string literals
+Defined in: [src/brushes/BaseBrush.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L21)
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L23)
+Width of a brush, has to be a Number, no string literals
## Methods
@@ -199,33 +141,33 @@ Width of a brush, has to be a Number, no string literals
> `abstract` **\_render**(): `void`
+Defined in: [src/brushes/BaseBrush.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L72)
+
#### Returns
`void`
-#### Defined in
-
-[src/brushes/BaseBrush.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L79)
-
***
### onMouseDown()
> `abstract` **onMouseDown**(`pointer`, `ev`): `void`
+Defined in: [src/brushes/BaseBrush.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L73)
+
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
-• **ev**: [`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
+[`Point`](/api/classes/point/)
-#### Returns
+##### ev
-`void`
+[`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
-#### Defined in
+#### Returns
-[src/brushes/BaseBrush.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L80)
+`void`
***
@@ -233,19 +175,21 @@ Width of a brush, has to be a Number, no string literals
> `abstract` **onMouseMove**(`pointer`, `ev`): `void`
+Defined in: [src/brushes/BaseBrush.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L74)
+
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
-• **ev**: [`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
+[`Point`](/api/classes/point/)
-#### Returns
+##### ev
-`void`
+[`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
-#### Defined in
+#### Returns
-[src/brushes/BaseBrush.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L81)
+`void`
***
@@ -253,16 +197,16 @@ Width of a brush, has to be a Number, no string literals
> `abstract` **onMouseUp**(`ev`): `boolean` \| `void`
+Defined in: [src/brushes/BaseBrush.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L78)
+
#### Parameters
-• **ev**: [`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
+##### ev
+
+[`TBrushEventData`](/api/type-aliases/tbrusheventdata/)
#### Returns
`boolean` \| `void`
true if brush should continue blocking interaction
-
-#### Defined in
-
-[src/brushes/BaseBrush.ts:85](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L85)
diff --git a/src/content/docs/api/classes/BaseFabricObject.md b/src/content/docs/api/classes/BaseFabricObject.md
index 35de27410..7b26a035b 100644
--- a/src/content/docs/api/classes/BaseFabricObject.md
+++ b/src/content/docs/api/classes/BaseFabricObject.md
@@ -5,11 +5,13 @@ prev: false
title: "BaseFabricObject"
---
+Defined in: [src/shapes/Object/Object.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L178)
+
Root object class from which all 2d shape classes inherit from
-## Tutorial
+## See
-[http://fabricjs.com/fabric-intro-part-1#objects](http://fabricjs.com/fabric-intro-part-1#objects)
+[http://fabric5.fabricjs.com/fabric-intro-part-1#objects](http://fabric5.fabricjs.com/fabric-intro-part-1#objects)
## Fires
@@ -97,11 +99,17 @@ drop
## Type Parameters
-• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<`ObjectProps`\> = `Partial`\<`ObjectProps`\>
+### Props
+
+`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<`ObjectProps`\> = `Partial`\<`ObjectProps`\>
+
+### SProps
+
+`SProps` *extends* [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) = [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)
-• **SProps** *extends* [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) = [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)
+### EventSpec
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Implements
@@ -109,57 +117,38 @@ drop
## Constructors
-### new BaseFabricObject()
+### Constructor
-> **new BaseFabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+> **new BaseFabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Object/Object.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L370)
Constructor
#### Parameters
-• **options?**: `Props`
+##### options?
+
+`Props`
Options object
#### Returns
-[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
`ObjectGeometry.constructor`
-#### Defined in
-
-[src/shapes/Object/Object.ts:373](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L373)
-
## Properties
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/basefabricobject/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/basefabricobject/#calcacoords)
-
-#### Inherited from
-
-`ObjectGeometry.aCoords`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
-***
-
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -177,9 +166,24 @@ false
`ObjectProps.absolutePositioned`
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/basefabricobject/#setcoords).
+You can calculate them without updating with [()](/api/classes/basefabricobject/#calcacoords)
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
***
@@ -187,6 +191,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -201,11 +207,7 @@ Angle of rotation of an object (in degrees)
#### Inherited from
-`ObjectGeometry.angle`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
+[`FabricObject`](/api/classes/fabricobject/).[`angle`](/api/classes/fabricobject/#angle)
***
@@ -213,29 +215,23 @@ Angle of rotation of an object (in degrees)
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`ObjectProps.backgroundColor`
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -246,26 +242,18 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`ObjectProps.centeredRotation`
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -273,40 +261,30 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`ObjectProps.centeredScaling`
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
-> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> `optional` **clipPath**: `FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
#### Implementation of
`ObjectProps.clipPath`
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -316,56 +294,44 @@ since 1.7.0
true
```
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`ObjectProps.excludeFromExport`
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
#### Implementation of
`ObjectProps.fill`
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -380,16 +346,14 @@ nonzero
`ObjectProps.fillRule`
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -404,11 +368,7 @@ false
#### Inherited from
-`ObjectGeometry.flipX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
+[`FabricObject`](/api/classes/fabricobject/).[`flipX`](/api/classes/fabricobject/#flipx)
***
@@ -416,6 +376,8 @@ false
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -430,11 +392,7 @@ false
#### Inherited from
-`ObjectGeometry.flipY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
+[`FabricObject`](/api/classes/fabricobject/).[`flipY`](/api/classes/fabricobject/#flipy)
***
@@ -442,35 +400,23 @@ false
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Implementation of
`ObjectProps.globalCompositeOperation`
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Implementation of
@@ -478,11 +424,7 @@ Object height
#### Inherited from
-`ObjectGeometry.height`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
+[`FabricObject`](/api/classes/fabricobject/).[`height`](/api/classes/fabricobject/#height)
***
@@ -490,28 +432,22 @@ Object height
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Implementation of
`ObjectProps.includeDefaultValues`
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -526,19 +462,17 @@ false
`ObjectProps.inverted`
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -552,11 +486,7 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
#### Inherited from
-`ObjectGeometry.left`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
+[`FabricObject`](/api/classes/fabricobject/).[`left`](/api/classes/fabricobject/#left)
***
@@ -564,15 +494,13 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
-`ObjectGeometry.matrixCache`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
+[`FabricObject`](/api/classes/fabricobject/).[`matrixCache`](/api/classes/fabricobject/#matrixcache)
***
@@ -580,6 +508,8 @@ storage cache for object full transform matrix
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -592,16 +522,14 @@ Minimum allowed scale value of an object
`ObjectProps.minScaleLimit`
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -620,16 +548,14 @@ true
`ObjectProps.objectCaching`
-#### Defined in
-
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
-
***
### opacity
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -642,16 +568,14 @@ Opacity of an object
`ObjectProps.opacity`
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -662,11 +586,7 @@ please use 'center' as value in new projects
#### Inherited from
-`ObjectGeometry.originX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
+[`FabricObject`](/api/classes/fabricobject/).[`originX`](/api/classes/fabricobject/#originx)
***
@@ -674,6 +594,8 @@ please use 'center' as value in new projects
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -684,11 +606,7 @@ please use 'center' as value in new projects
#### Inherited from
-`ObjectGeometry.originY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
+[`FabricObject`](/api/classes/fabricobject/).[`originY`](/api/classes/fabricobject/#originy)
***
@@ -696,15 +614,13 @@ please use 'center' as value in new projects
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
-`ObjectGeometry.ownMatrixCache`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
+[`FabricObject`](/api/classes/fabricobject/).[`ownMatrixCache`](/api/classes/fabricobject/#ownmatrixcache)
***
@@ -712,6 +628,8 @@ storage cache for object transform matrix
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -722,11 +640,7 @@ Padding between object and its controlling borders (in pixels)
#### Inherited from
-`ObjectGeometry.padding`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
+[`FabricObject`](/api/classes/fabricobject/).[`padding`](/api/classes/fabricobject/#padding)
***
@@ -734,41 +648,33 @@ Padding between object and its controlling borders (in pixels)
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Implementation of
`ObjectProps.paintFirst`
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -783,11 +689,7 @@ Object scale factor (horizontal)
#### Inherited from
-`ObjectGeometry.scaleX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
+[`FabricObject`](/api/classes/fabricobject/).[`scaleX`](/api/classes/fabricobject/#scalex)
***
@@ -795,6 +697,8 @@ Object scale factor (horizontal)
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -809,11 +713,7 @@ Object scale factor (vertical)
#### Inherited from
-`ObjectGeometry.scaleY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
+[`FabricObject`](/api/classes/fabricobject/).[`scaleY`](/api/classes/fabricobject/#scaley)
***
@@ -821,20 +721,20 @@ Object scale factor (vertical)
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
#### Implementation of
`ObjectProps.shadow`
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -849,11 +749,7 @@ Angle of skew on x axes of an object (in degrees)
#### Inherited from
-`ObjectGeometry.skewX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
+[`FabricObject`](/api/classes/fabricobject/).[`skewX`](/api/classes/fabricobject/#skewx)
***
@@ -861,6 +757,8 @@ Angle of skew on x axes of an object (in degrees)
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -875,11 +773,7 @@ Angle of skew on y axes of an object (in degrees)
#### Inherited from
-`ObjectGeometry.skewY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
+[`FabricObject`](/api/classes/fabricobject/).[`skewY`](/api/classes/fabricobject/#skewy)
***
@@ -887,20 +781,20 @@ Angle of skew on y axes of an object (in degrees)
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
#### Implementation of
`ObjectProps.stroke`
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -913,16 +807,14 @@ null;
`ObjectProps.strokeDashArray`
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -935,16 +827,14 @@ Line offset of an object's stroke
`ObjectProps.strokeDashOffset`
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -957,38 +847,28 @@ butt
`ObjectProps.strokeLineCap`
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Implementation of
`ObjectProps.strokeLineJoin`
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -1001,16 +881,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
`ObjectProps.strokeMiterLimit`
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -1038,11 +916,7 @@ false
#### Inherited from
-`ObjectGeometry.strokeUniform`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
+[`FabricObject`](/api/classes/fabricobject/).[`strokeUniform`](/api/classes/fabricobject/#strokeuniform)
***
@@ -1050,6 +924,8 @@ false
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -1064,11 +940,7 @@ Width of a stroke used to render this object
#### Inherited from
-`ObjectGeometry.strokeWidth`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
+[`FabricObject`](/api/classes/fabricobject/).[`strokeWidth`](/api/classes/fabricobject/#strokewidth)
***
@@ -1076,9 +948,11 @@ Width of a stroke used to render this object
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -1092,11 +966,7 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
#### Inherited from
-`ObjectGeometry.top`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
+[`FabricObject`](/api/classes/fabricobject/).[`top`](/api/classes/fabricobject/#top)
***
@@ -1104,35 +974,23 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Implementation of
`ObjectProps.visible`
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Implementation of
@@ -1140,11 +998,7 @@ Object width
#### Inherited from
-`ObjectGeometry.width`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
+[`FabricObject`](/api/classes/fabricobject/).[`width`](/api/classes/fabricobject/#width)
***
@@ -1152,26 +1006,22 @@ Object width
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:234](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L234)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
and refreshed at the next render
-#### Defined in
-
-[src/shapes/Object/Object.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L237)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
-List of properties to consider for animating colors.
-
-#### Defined in
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
+List of properties to consider for animating colors.
***
@@ -1179,22 +1029,18 @@ List of properties to consider for animating colors.
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
-> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `fabricObjectDefaultValues`
-
-#### Defined in
+> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `fabricObjectDefaultValues`
-[src/shapes/Object/Object.ts:330](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L330)
+Defined in: [src/shapes/Object/Object.ts:327](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L327)
***
@@ -1202,20 +1048,20 @@ instance.toObject() gets called
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'FabricObject'`
+Defined in: [src/shapes/Object/Object.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L343)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -1225,22 +1071,22 @@ Hard to reach on instances and please do not use to drive instance's logic (this
To idenfity a class use instanceof class ( instanceof Rect ).
We do not do that in fabricJS code because we want to try to have code splitting possible.
-#### Defined in
-
-[src/shapes/Object/Object.ts:346](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L346)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -1248,74 +1094,79 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
-`string`
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
-#### Defined in
+##### Parameters
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+###### value
-## Methods
+`string`
+
+##### Returns
+
+`void`
+
+## Methods
### \_drawClipPath()
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`CanvasRenderingContext2D`
-• **context**: `DrawContext`
+##### clipPath
-#### Returns
+`undefined` | `FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-`void`
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
+`void`
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
-
-.width width of canvas
+##### dims
-.height height of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
-
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+#### Returns
-#### Defined in
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
+dims
***
@@ -1323,53 +1174,53 @@ making bargain with performances.
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **\_\_namedParameters**: `Pick`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+`CanvasRenderingContext2D`
-#### Returns
+##### \_\_namedParameters
-`void`
+`Pick`\<`this`, `"fill"`\>
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
+`void`
***
@@ -1377,19 +1228,21 @@ Remove cacheCanvas and its dimensions from the objects
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **decl**: `Pick`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+`CanvasRenderingContext2D`
-#### Returns
+##### decl
-`void`
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
+`void`
***
@@ -1397,12 +1250,16 @@ Remove cacheCanvas and its dimensions from the objects
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -1410,33 +1267,37 @@ Rendering canvas context
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -1445,13 +1306,9 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
-
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+#### See
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
***
@@ -1459,6 +1316,8 @@ object.animate({ left: ..., top: ... }, { duration: ... });
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -1470,16 +1329,14 @@ those never change with zoom or viewport changes.
`ObjectGeometry.calcACoords`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -1493,22 +1350,22 @@ transform matrix for the object
`ObjectGeometry.calcOwnMatrix`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -1523,37 +1380,35 @@ transform matrix for the object
`ObjectGeometry.calcTransformMatrix`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`FabricObject`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>\>
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
+`Promise`\<`FabricObject`\<`Props`, `SProps`, `EventSpec`\>\>
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -1564,13 +1419,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -1578,16 +1435,14 @@ Object cloned as image.
fix the export type, it could not be Image but the type that getClass return for 'image'.
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:1426](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1426)
+
Returns complexity of an instance
#### Returns
@@ -1596,21 +1451,21 @@ Returns complexity of an instance
complexity of this instance (is 1 unless subclassed)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1460](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1460)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -1624,16 +1479,14 @@ true if point is inside the object
`ObjectGeometry.containsPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1494)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -1641,23 +1494,25 @@ override if necessary to dispose artifacts such as `clipPath`
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1528)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -1665,35 +1520,35 @@ Context to render on
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
-• **canvasWithClipPath**: `HTMLCanvasElement`
+`FabricObject`
-#### Returns
+##### canvasWithClipPath
-`void`
+`HTMLCanvasElement`
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
+`void`
***
@@ -1701,19 +1556,27 @@ Context to render on
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -1721,43 +1584,45 @@ additional context for rendering
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`_ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:679](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L679)
+
#### Parameters
-• **\_ctx**: `CanvasRenderingContext2D`
+##### \_ctx
+
+`CanvasRenderingContext2D`
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:728](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L728)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -1765,29 +1630,33 @@ Compare ancestors
an object that represent the ancestry situation.
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -1799,21 +1668,21 @@ Options object
`ObjectGeometry.fire`
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -1827,32 +1696,28 @@ value of a property
`ObjectGeometry.get`
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
ancestors (excluding `ActiveSelection`) from bottom to top
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -1866,16 +1731,14 @@ Object with left, top, width, height properties
`ObjectGeometry.getBoundingRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -1884,16 +1747,14 @@ Object with left, top, width, height properties
`ObjectGeometry.getCanvasRetinaScaling`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -1904,16 +1765,14 @@ Returns the center coordinates of the object relative to canvas
`ObjectGeometry.getCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -1924,48 +1783,42 @@ Returns the center coordinates of the object relative to canvas
`ObjectGeometry.getCoords`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
[`Point`](/api/classes/point/)
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -1975,11 +1828,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -1991,16 +1848,14 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.getPointByOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -2011,78 +1866,70 @@ Returns the center coordinates of the object relative to it's parent
`ObjectGeometry.getRelativeCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/basefabricobject/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/basefabricobject/#getx)
#### Inherited from
`ObjectGeometry.getRelativeX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
`ObjectGeometry.getRelativeXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/basefabricobject/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/basefabricobject/#gety)
#### Inherited from
`ObjectGeometry.getRelativeY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -2099,16 +1946,14 @@ shouldn't this account for group transform and return the actual size in canvas
`ObjectGeometry.getScaledHeight`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -2125,16 +1970,14 @@ shouldn't this account for group transform and return the actual size in canvas
`ObjectGeometry.getScaledWidth`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -2145,16 +1988,14 @@ Returns the object angle relative to canvas counting also the group property
`ObjectGeometry.getTotalAngle`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -2163,16 +2004,14 @@ Return the object scale factor counting also the group scaling, zoom and retina
object with scaleX and scaleY properties
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -2183,97 +2022,91 @@ Retrieves viewportTransform from Object's canvas if available
`ObjectGeometry.getViewportTransform`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
`ObjectGeometry.getX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
`ObjectGeometry.getXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
`ObjectGeometry.getY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
`boolean`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -2284,7 +2117,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -2292,15 +2125,13 @@ Boolean
3.0.0
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -2311,7 +2142,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -2319,21 +2150,21 @@ Boolean
3.0.0
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -2347,23 +2178,25 @@ true if object intersects with another object
`ObjectGeometry.intersectsWithObject`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -2373,21 +2206,24 @@ Checks if object intersects with the scene rect formed by tl and br
`ObjectGeometry.intersectsWithRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -2396,21 +2232,21 @@ on parent canvas.
`boolean`
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -2424,23 +2260,25 @@ true if object is fully contained within area of another object
`ObjectGeometry.isContainedWithinObject`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -2450,44 +2288,46 @@ Checks if object is fully contained within the scene rect formed by tl and br
`ObjectGeometry.isContainedWithinRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
`boolean`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -2497,23 +2337,19 @@ object to compare against
if objects do not share a common ancestor or they are strictly equal it is impossible to determine which is in front of the other; in such cases the function returns `undefined`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
-#### Returns
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
-`boolean`
+return if the object would be visible in rendering
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
+`boolean`
***
@@ -2521,6 +2357,8 @@ if objects do not share a common ancestor or they are strictly equal it is impos
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -2534,23 +2372,25 @@ true if object is fully or partially contained within canvas
`ObjectGeometry.isOnScreen`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -2560,16 +2400,14 @@ true if object is fully or partially contained within canvas
`ObjectGeometry.isOverlapping`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -2582,29 +2420,37 @@ true if object is partially contained within canvas
`ObjectGeometry.isPartiallyOnScreen`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
+`true` if the object's type or class type matches any in the list, otherwise `false`.
***
@@ -2612,7 +2458,9 @@ Returns true if any of the specified types is identical to the type of an instan
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -2624,18 +2472,16 @@ since 1.7.12
Boolean
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -2646,11 +2492,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -2662,27 +2512,31 @@ event name (eg. 'after:render')
`ObjectGeometry.off`
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -2694,19 +2548,19 @@ event listener to unsubscribe
`ObjectGeometry.off`
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -2718,14 +2572,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
`ObjectGeometry.off`
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -2736,33 +2588,39 @@ unsubscribe all event listeners
`ObjectGeometry.off`
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
-• **E**
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -2780,53 +2638,69 @@ on
`ObjectGeometry.on`
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-`ObjectGeometry.on`
+##### Alias
-##### Defined in
+on
+
+##### Inherited from
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+`ObjectGeometry.on`
***
### once()
-#### once(eventName, handler)
+#### Call Signature
> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
+
Observes specified event **once**
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
-• **E**
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -2844,29 +2718,35 @@ once
`ObjectGeometry.once`
-##### Defined in
+#### Call Signature
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+> **once**(`handlers`): `VoidFunction`
-#### once(handlers)
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
-> **once**(`handlers`): `VoidFunction`
+Observes specified event **once**
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-`ObjectGeometry.once`
+##### Alias
+
+once
-##### Defined in
+##### Inherited from
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+`ObjectGeometry.once`
***
@@ -2874,11 +2754,15 @@ once
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:649](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L649)
+
Renders an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -2886,29 +2770,27 @@ Context to render on
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:698](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L698)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **options?**: `any`
+`TCachedFabricObject`
-#### Returns
+##### options?
-`void`
+`any`
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
+`void`
***
@@ -2916,11 +2798,15 @@ Context to render on
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -2928,21 +2814,21 @@ Angle value (in degrees)
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -2954,21 +2840,21 @@ Scale factor
`ObjectGeometry.scale`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -2980,21 +2866,21 @@ New height value
`ObjectGeometry.scaleToHeight`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -3006,49 +2892,49 @@ New width value
`ObjectGeometry.scaleToWidth`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
`ObjectGeometry.set`
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
### setCoords()
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:449](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L449)
+
Sets corner and controls position coordinates based on current angle, width and height, left and top.
aCoords are used to quickly find an object on the canvas.
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabric5.fabricjs.com/fabric-gotchas](http://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -3058,16 +2944,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
`ObjectGeometry.setCoords`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L449)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -3077,29 +2961,33 @@ Travis build error about unused variables.
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3111,22 +2999,22 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.setPositionByOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/basefabricobject/#setx)
+`number`
+
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/basefabricobject/#setx)
#### Returns
@@ -3136,29 +3024,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
`ObjectGeometry.setRelativeX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
-As [setXY](../../../../api/classes/basefabricobject/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
+
+As [setXY](/api/classes/basefabricobject/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -3170,22 +3062,22 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.setRelativeXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/basefabricobject/#sety)
+`number`
+
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/basefabricobject/#sety)
#### Returns
@@ -3195,21 +3087,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
`ObjectGeometry.setRelativeY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -3219,15 +3111,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
`ObjectGeometry.setX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -3235,15 +3125,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3261,21 +3157,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
`ObjectGeometry.setXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -3285,20 +3181,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
`ObjectGeometry.setY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L775)
+
Decide if the object should cache or not. Create its own cache level
objectCaching is a global flag, wins over everything
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
Read as: cache if is needed, or if the feature is enabled but we are not already caching.
@@ -3306,9 +3200,23 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
`boolean`
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
+
+`toDataURLOptions` = `{}`
+
+#### Returns
-[src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L823)
+`Promise`\<`null` \| `Blob`\>
***
@@ -3316,11 +3224,15 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -3330,9 +3242,29 @@ Options object
Returns DOM element with the FabricObject
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
***
@@ -3340,11 +3272,15 @@ Returns DOM element with the FabricObject
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -3354,33 +3290,31 @@ Options object
Returns a data: URL containing a representation of the object in the format specified by options.format
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+`ObjectGeometry.toggle`
***
@@ -3388,6 +3322,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -3396,21 +3332,21 @@ Returns a JSON representation of an instance
JSON
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**(`propertiesToInclude`?): `any`
+> **toObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1757](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1757)
Returns an object representation of an instance
#### Parameters
-• **propertiesToInclude?**: `any`[] = `[]`
+##### propertiesToInclude?
+
+`any`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -3420,63 +3356,35 @@ Any properties that you might want to additionally include in the output
Object representation of an instance
-#### Defined in
-
-[src/shapes/Object/Object.ts:1791](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1791)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Object/Object.ts:1890](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1890)
+
Returns a string representation of an instance
#### Returns
`string`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1924)
-
-***
-
-### toggle()
-
-> **toggle**(`property`): [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
-
-Toggles specified property from `true` to `false` or from `false` to `true`
-
-#### Parameters
-
-• **property**: `string`
-
-Property to toggle
-
-#### Returns
-
-[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Props`, `SProps`, `EventSpec`\>
-
-#### Inherited from
-
-`ObjectGeometry.toggle`
-
-#### Defined in
-
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
-
***
### transform()
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -3484,19 +3392,19 @@ Context
`void`
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -3506,29 +3414,33 @@ Context
`ObjectGeometry.transformMatrixKey`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3540,37 +3452,45 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.translateToCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3582,29 +3502,33 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.translateToGivenOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3616,16 +3540,14 @@ Vertical origin: 'top', 'center' or 'bottom'
`ObjectGeometry.translateToOriginPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -3637,57 +3559,61 @@ This API is no longer supported and may be removed in a future release.
`boolean`
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* `FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+`Record`\<`string`, `unknown`\>
-#### Returns
+##### \_\_namedParameters
-`Promise`\<`S`\>
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
+`Promise`\<`S`\>
***
### fromObject()
-> `static` **fromObject**\<`T`\>(`object`, `options`?): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromObject**\<`T`\>(`object`, `options?`): `Promise`\<`FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1932](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1932)
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
#### Parameters
-• **object**: `T`
+##### object
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
+`T`
-#### Returns
+##### options?
-`Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+[`Abortable`](/api/type-aliases/abortable/)
-#### Defined in
+#### Returns
-[src/shapes/Object/Object.ts:1966](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1966)
+`Promise`\<`FabricObject`\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
***
@@ -3695,10 +3621,8 @@ This API is no longer supported and may be removed in a future release.
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Object/Object.ts:329](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L329)
+
#### Returns
`Record`\<`string`, `any`\>
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:332](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L332)
diff --git a/src/content/docs/api/classes/Canvas.md b/src/content/docs/api/classes/Canvas.md
index 09f916bc4..080dedfd6 100644
--- a/src/content/docs/api/classes/Canvas.md
+++ b/src/content/docs/api/classes/Canvas.md
@@ -5,6 +5,8 @@ prev: false
title: "Canvas"
---
+Defined in: [src/canvas/Canvas.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L72)
+
## Extends
- `SelectableCanvas`
@@ -15,48 +17,50 @@ title: "Canvas"
## Constructors
-### new Canvas()
+### Constructor
+
+> **new Canvas**(`el?`, `options?`): `Canvas`
-> **new Canvas**(`el`?, `options`?): [`Canvas`](/api/classes/canvas/)
+Defined in: [src/canvas/Canvas.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L122)
#### Parameters
-• **el?**: `string` \| `HTMLCanvasElement`
+##### el?
+
+`string` | `HTMLCanvasElement`
+
+##### options?
-• **options?**: `TCanvasOptions` = `{}`
+`TCanvasOptions` = `{}`
#### Returns
-[`Canvas`](/api/classes/canvas/)
+`Canvas`
#### Overrides
`SelectableCanvas.constructor`
-#### Defined in
-
-[src/canvas/Canvas.ts:117](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L117)
-
## Properties
### \_activeObject?
> `optional` **\_activeObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/canvas/SelectableCanvas.ts:325](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L325)
+
#### Inherited from
`SelectableCanvas._activeObject`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:309](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L309)
-
***
### \_objects
> **\_objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/canvas/SelectableCanvas.ts:177](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L177)
+
#### TODO
needs to end up in the constructor too
@@ -65,16 +69,14 @@ needs to end up in the constructor too
`SelectableCanvas._objects`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:153](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L153)
-
***
### \_offset
> **\_offset**: `object`
+Defined in: [src/canvas/StaticCanvas.ts:159](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L159)
+
#### left
> **left**: `number`
@@ -87,16 +89,14 @@ needs to end up in the constructor too
`SelectableCanvas._offset`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:159](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L159)
-
***
### allowTouchScrolling
> **allowTouchScrolling**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L123)
+
#### Todo
move to Canvas
@@ -109,16 +109,14 @@ move to Canvas
`SelectableCanvas.allowTouchScrolling`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L123)
-
***
### altActionKey
> **altActionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/)
+Defined in: [src/canvas/SelectableCanvas.ts:185](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L185)
+
Indicates which key enable alternate action on corner
values: 'altKey', 'shiftKey', 'ctrlKey'.
If `null` or 'none' or any other string that is not a modifier key
@@ -128,12 +126,6 @@ feature is disabled feature disabled.
1.6.2
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`altActionKey`](/api/interfaces/canvasoptions/#altactionkey)
@@ -142,18 +134,18 @@ feature is disabled feature disabled.
`SelectableCanvas.altActionKey`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:161](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L161)
-
***
### altSelectionKey
> **altSelectionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/)
+Defined in: [src/canvas/SelectableCanvas.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L190)
+
Indicates which key enable alternative selection
-in case of target overlapping with active object
+in case of a target overlapping with active object and we don't want to loose the
+active selection, we can press this modifier key and continue selecting the current
+selected object also when is covered by another or many valid targets for selection.
values: 'altKey', 'shiftKey', 'ctrlKey'.
For a series of reason that come from the general expectations on how
things should work, this feature works only for preserveObjectStacking true.
@@ -164,12 +156,6 @@ feature is disabled.
1.6.5
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`altSelectionKey`](/api/interfaces/canvasoptions/#altselectionkey)
@@ -178,23 +164,15 @@ feature is disabled.
`SelectableCanvas.altSelectionKey`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:166](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L166)
-
***
### backgroundColor
> **backgroundColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/)
-Background color of canvas instance.
-
-#### Default
-
-```ts
+Defined in: [src/canvas/StaticCanvas.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L98)
-```
+Background color of canvas instance.
#### Implementation of
@@ -204,27 +182,19 @@ Background color of canvas instance.
`SelectableCanvas.backgroundColor`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L98)
-
***
### backgroundImage?
> `optional` **backgroundImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/canvas/StaticCanvas.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L99)
+
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
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`backgroundImage`](/api/interfaces/canvasoptions/#backgroundimage)
@@ -233,16 +203,14 @@ vale. As an alternative you can disable image objectCaching
`SelectableCanvas.backgroundImage`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L99)
-
***
### backgroundVpt
> **backgroundVpt**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:97](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L97)
+
if set to false background image is not affected by viewport transform
#### Since
@@ -253,12 +221,6 @@ if set to false background image is not affected by viewport transform
we should really find a different way to do this
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`backgroundVpt`](/api/interfaces/canvasoptions/#backgroundvpt)
@@ -267,16 +229,14 @@ we should really find a different way to do this
`SelectableCanvas.backgroundVpt`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L97)
-
***
### centeredKey
> **centeredKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/)
+Defined in: [src/canvas/SelectableCanvas.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L184)
+
Indicates which key enable centered Transform
values: 'altKey', 'shiftKey', 'ctrlKey'.
If `null` or 'none' or any other string that is not a modifier key
@@ -286,12 +246,6 @@ feature is disabled feature disabled.
1.6.2
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`centeredKey`](/api/interfaces/canvasoptions/#centeredkey)
@@ -300,16 +254,14 @@ feature is disabled feature disabled.
`SelectableCanvas.centeredKey`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:160](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L160)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:183](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L183)
+
When true, objects use center point as the origin of rotate transformation.
Backwards incompatibility note: This property replaces "centerTransform" (Boolean).
@@ -317,12 +269,6 @@ When true, objects use center point as the origin of rotate transformation.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`centeredRotation`](/api/interfaces/canvasoptions/#centeredrotation)
@@ -331,16 +277,14 @@ When true, objects use center point as the origin of rotate transformation.
`SelectableCanvas.centeredRotation`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:159](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L159)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L182)
+
When true, objects use center point as the origin of scale transformation.
Backwards incompatibility note: This property replaces "centerTransform" (Boolean).
@@ -348,12 +292,6 @@ When true, objects use center point as the origin of scale transformation.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`centeredScaling`](/api/interfaces/canvasoptions/#centeredscaling)
@@ -362,16 +300,14 @@ When true, objects use center point as the origin of scale transformation.
`SelectableCanvas.centeredScaling`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L158)
-
***
### clipPath?
> `optional` **clipPath**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/canvas/StaticCanvas.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L105)
+
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.
@@ -385,23 +321,15 @@ clipPath will clip away controls, if you do not want this to happen use controls
`SelectableCanvas.clipPath`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L105)
-
***
### ~~containerClass~~
> **containerClass**: `string`
-Default element class that's given to wrapper (div) element of canvas
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L204)
-```
+Default element class that's given to wrapper (div) element of canvas
:::caution[Deprecated]
customize [CanvasDOMManager](/api/classes/canvasdommanager/) instead or access [elements](/api/classes/canvas/#elements) directly
@@ -415,16 +343,14 @@ customize [CanvasDOMManager](/api/classes/canvasdommanager/) instead or access [
`SelectableCanvas.containerClass`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:180](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L180)
-
***
### controlsAboveOverlay
> **controlsAboveOverlay**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L118)
+
#### Todo
move to Canvas
@@ -437,16 +363,14 @@ move to Canvas
`SelectableCanvas.controlsAboveOverlay`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L118)
-
***
### defaultCursor
> **defaultCursor**: `string`
+Defined in: [src/canvas/SelectableCanvas.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L200)
+
Default cursor value used for the entire canvas
#### Default
@@ -463,16 +387,14 @@ default
`SelectableCanvas.defaultCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L176)
-
***
### destroyed?
> `optional` **destroyed**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:150](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L150)
+
If true the Canvas is in the process or has been disposed/destroyed.
No more rendering operation will be executed on this canvas.
@@ -480,16 +402,14 @@ No more rendering operation will be executed on this canvas.
`SelectableCanvas.destroyed`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L150)
-
***
### disposed?
> `optional` **disposed**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:157](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L157)
+
Started the process of disposing but not done yet.
WIll likely complete the render cycle already scheduled but stopping adding more.
@@ -497,59 +417,41 @@ WIll likely complete the render cycle already scheduled but stopping adding more
`SelectableCanvas.disposed`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:157](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L157)
-
***
### elements
> **elements**: [`CanvasDOMManager`](/api/classes/canvasdommanager/)
+Defined in: [src/canvas/SelectableCanvas.ts:310](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L310)
+
#### Inherited from
`SelectableCanvas.elements`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L294)
-
***
### enablePointerEvents
> **enablePointerEvents**: `boolean`
-When the option is enabled, PointerEvent is used instead of TPointerEvent.
-
-#### Default
-
-```ts
+Defined in: [src/canvas/Canvas.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L80)
-```
+When the option is enabled, PointerEvent is used instead of TPointerEvent.
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`enablePointerEvents`](/api/interfaces/canvasoptions/#enablepointerevents)
-#### Defined in
-
-[src/canvas/Canvas.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L81)
-
***
### enableRetinaScaling
> **enableRetinaScaling**: `boolean`
-When true, canvas is scaled by devicePixelRatio for better rendering on retina screens
-
-#### Default
-
-```ts
+Defined in: [src/canvas/StaticCanvas.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L112)
-```
+When true, canvas is scaled by devicePixelRatio for better rendering on retina screens
#### Implementation of
@@ -559,27 +461,28 @@ When true, canvas is scaled by devicePixelRatio for better rendering on retina s
`SelectableCanvas.enableRetinaScaling`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L112)
-
***
-### fireMiddleClick
+### ~~fireMiddleClick~~
> **fireMiddleClick**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L225)
+
Indicates if the canvas can fire middle click events
+The default value changed from false to true in Fabric 7.0
-#### Since
+:::caution[Deprecated]
+since 7.0, Will be removed in Fabric 8.0
+:::
-1.7.8
+#### See
-#### Default
+https://fabricjs.com/docs/upgrading/upgrading-to-fabric-70/
-```ts
+#### Since
-```
+1.7.8
#### Implementation of
@@ -589,27 +492,28 @@ Indicates if the canvas can fire middle click events
`SelectableCanvas.fireMiddleClick`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L202)
-
***
-### fireRightClick
+### ~~fireRightClick~~
> **fireRightClick**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:224](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L224)
+
Indicates if the canvas can fire right click events
+The default value changed from false to true in Fabric 7.0
-#### Since
+:::caution[Deprecated]
+since 7.0, Will be removed in Fabric 8.0
+:::
-1.6.5
+#### See
-#### Default
+https://fabricjs.com/docs/upgrading/upgrading-to-fabric-70/
-```ts
+#### Since
-```
+1.6.5
#### Implementation of
@@ -619,30 +523,26 @@ Indicates if the canvas can fire right click events
`SelectableCanvas.fireRightClick`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L201)
-
***
### freeDrawingBrush?
> `optional` **freeDrawingBrush**: [`BaseBrush`](/api/classes/basebrush/)
+Defined in: [src/canvas/SelectableCanvas.ts:324](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L324)
+
#### Inherited from
`SelectableCanvas.freeDrawingBrush`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:308](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L308)
-
***
### freeDrawingCursor
> **freeDrawingCursor**: `string`
+Defined in: [src/canvas/SelectableCanvas.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L201)
+
Cursor value used during free drawing
#### Default
@@ -659,16 +559,14 @@ crosshair
`SelectableCanvas.freeDrawingCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:177](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L177)
-
***
### height
> **height**: `number`
+Defined in: [src/canvas/StaticCanvas.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L94)
+
Height in virtual/logical pixels of the canvas.
The canvas can be taller than width if retina scaling is active
@@ -680,16 +578,14 @@ The canvas can be taller than width if retina scaling is active
`SelectableCanvas.height`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L94)
-
***
### hoverCursor
> **hoverCursor**: `string`
+Defined in: [src/canvas/SelectableCanvas.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L198)
+
Default cursor value used when hovering over an object on canvas
#### Default
@@ -706,23 +602,15 @@ move
`SelectableCanvas.hoverCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L174)
-
***
### imageSmoothingEnabled
> **imageSmoothingEnabled**: `boolean`
-Indicates whether this canvas will use image smoothing, this is on by default in browsers
-
-#### Default
-
-```ts
+Defined in: [src/canvas/StaticCanvas.ts:113](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L113)
-```
+Indicates whether this canvas will use image smoothing, this is on by default in browsers
#### Implementation of
@@ -732,25 +620,17 @@ Indicates whether this canvas will use image smoothing, this is on by default in
`SelectableCanvas.imageSmoothingEnabled`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:113](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L113)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L107)
+
Indicates whether toObject/toDatalessObject should include default values
if set to false, takes precedence over the object value.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`includeDefaultValues`](/api/interfaces/canvasoptions/#includedefaultvalues)
@@ -759,44 +639,34 @@ if set to false, takes precedence over the object value.
`SelectableCanvas.includeDefaultValues`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L107)
-
***
### isDrawingMode
> **isDrawingMode**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L218)
+
When true, mouse events on canvas (mousedown/mousemove/mouseup) result in free drawing.
After mousedown, mousemove creates a shape,
and then mouseup finalizes it and adds an instance of `fabric.Path` onto canvas.
-#### Tutorial
-
-[http://fabricjs.com/fabric-intro-part-4#free_drawing](http://fabricjs.com/fabric-intro-part-4#free_drawing)
-
-#### Default
-
-```ts
+#### See
-```
+[http://fabric5.fabricjs.com/fabric-intro-part-4#free\_drawing](http://fabric5.fabricjs.com/fabric-intro-part-4#free_drawing)
#### Inherited from
`SelectableCanvas.isDrawingMode`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L195)
-
***
### moveCursor
> **moveCursor**: `string`
+Defined in: [src/canvas/SelectableCanvas.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L199)
+
Default cursor value used when moving an object on canvas
#### Default
@@ -813,16 +683,14 @@ move
`SelectableCanvas.moveCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:175](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L175)
-
***
### notAllowedCursor
> **notAllowedCursor**: `string`
+Defined in: [src/canvas/SelectableCanvas.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L202)
+
Cursor value used for disabled elements ( corners with disabled action )
#### Since
@@ -843,28 +711,20 @@ not-allowed
`SelectableCanvas.notAllowedCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L178)
-
***
### overlayColor
> **overlayColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/canvas/StaticCanvas.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L102)
+
Overlay color of canvas instance.
#### Since
1.3.9
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`overlayColor`](/api/interfaces/canvasoptions/#overlaycolor)
@@ -873,27 +733,19 @@ Overlay color of canvas instance.
`SelectableCanvas.overlayColor`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L102)
-
***
### overlayImage?
> `optional` **overlayImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/canvas/StaticCanvas.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L103)
+
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
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`overlayImage`](/api/interfaces/canvasoptions/#overlayimage)
@@ -902,16 +754,14 @@ vale. As an alternative you can disable image objectCaching
`SelectableCanvas.overlayImage`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L103)
-
***
### overlayVpt
> **overlayVpt**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L101)
+
if set to false overlay image is not affected by viewport transform
#### Since
@@ -922,12 +772,6 @@ if set to false overlay image is not affected by viewport transform
we should really find a different way to do this
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`overlayVpt`](/api/interfaces/canvasoptions/#overlayvpt)
@@ -936,23 +780,15 @@ we should really find a different way to do this
`SelectableCanvas.overlayVpt`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L101)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When true, object detection happens on per-pixel basis rather than on per-bounding-box
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L207)
-```
+When true, object detection happens on per-pixel basis rather than on per-bounding-box
#### Implementation of
@@ -962,23 +798,21 @@ When true, object detection happens on per-pixel basis rather than on per-boundi
`SelectableCanvas.perPixelTargetFind`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:183](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L183)
-
***
### preserveObjectStacking
> **preserveObjectStacking**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:220](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L220)
+
Indicates whether objects should remain in current stack position when selected.
When false objects are brought to top and rendered as part of the selection group
#### Default
```ts
-
+true
```
#### Implementation of
@@ -989,29 +823,21 @@ When false objects are brought to top and rendered as part of the selection grou
`SelectableCanvas.preserveObjectStacking`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L197)
-
***
### renderOnAddRemove
> **renderOnAddRemove**: `boolean`
-Indicates whether [StaticCanvas#add](../../../../api/classes/staticcanvas/#add), [StaticCanvas#insertAt](../../../../api/classes/staticcanvas/#insertat) and StaticCanvas#remove,
-StaticCanvas#moveTo, [StaticCanvas#clear](../../../../api/classes/staticcanvas/#clear) and many more, should also re-render canvas.
+Defined in: [src/canvas/StaticCanvas.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L110)
+
+Indicates whether [StaticCanvas#add](/api/classes/staticcanvas/#add), [StaticCanvas#insertAt](/api/classes/staticcanvas/#insertat) and StaticCanvas#remove,
+StaticCanvas#moveTo, [StaticCanvas#clear](/api/classes/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
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`renderOnAddRemove`](/api/interfaces/canvasoptions/#renderonaddremove)
@@ -1020,23 +846,15 @@ Left default to true to do not break documentation and old app, fiddles.
`SelectableCanvas.renderOnAddRemove`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:110](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L110)
-
-***
+***
### selection
> **selection**: `boolean`
-Indicates whether group selection should be enabled
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L188)
-```
+Indicates whether group selection should be enabled
#### Implementation of
@@ -1046,23 +864,15 @@ Indicates whether group selection should be enabled
`SelectableCanvas.selection`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L164)
-
***
### selectionBorderColor
> **selectionBorderColor**: `string`
-Color of the border of selection (usually slightly darker than color of selection itself)
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L193)
-```
+Color of the border of selection (usually slightly darker than color of selection itself)
#### Implementation of
@@ -1072,23 +882,15 @@ Color of the border of selection (usually slightly darker than color of selectio
`SelectableCanvas.selectionBorderColor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:169](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L169)
-
***
### selectionColor
> **selectionColor**: `string`
-Color of selection
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L191)
-```
+Color of selection
#### Implementation of
@@ -1098,16 +900,14 @@ Color of selection
`SelectableCanvas.selectionColor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L167)
-
***
### selectionDashArray
> **selectionDashArray**: `number`[]
+Defined in: [src/canvas/SelectableCanvas.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L192)
+
Default dash array pattern
If not empty the selection border is dashed
@@ -1119,23 +919,15 @@ If not empty the selection border is dashed
`SelectableCanvas.selectionDashArray`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L168)
-
***
### selectionFullyContained
> **selectionFullyContained**: `boolean`
-Select only shapes that are fully contained in the dragged selection rectangle.
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L195)
-```
+Select only shapes that are fully contained in the dragged selection rectangle.
#### Implementation of
@@ -1145,15 +937,13 @@ Select only shapes that are fully contained in the dragged selection rectangle.
`SelectableCanvas.selectionFullyContained`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:171](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L171)
-
***
### selectionKey
-> **selectionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) \| (`"altKey"` \| `"shiftKey"` \| `"ctrlKey"` \| `"metaKey"`)[]
+> **selectionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) \| (`"altKey"` \| `"ctrlKey"` \| `"metaKey"` \| `"shiftKey"`)[]
+
+Defined in: [src/canvas/SelectableCanvas.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L189)
Indicates which key or keys enable multiple click selection
Pass value as a string or array of strings
@@ -1165,12 +955,6 @@ feature is disabled.
1.6.2
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`selectionKey`](/api/interfaces/canvasoptions/#selectionkey)
@@ -1179,23 +963,15 @@ feature is disabled.
`SelectableCanvas.selectionKey`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L165)
-
***
### selectionLineWidth
> **selectionLineWidth**: `number`
-Width of a line used in object/group selection
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L194)
-```
+Width of a line used in object/group selection
#### Implementation of
@@ -1205,16 +981,14 @@ Width of a line used in object/group selection
`SelectableCanvas.selectionLineWidth`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:170](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L170)
-
***
### skipOffscreen
> **skipOffscreen**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L111)
+
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
@@ -1235,28 +1009,20 @@ true
`SelectableCanvas.skipOffscreen`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L111)
-
***
### skipTargetFind
> **skipTargetFind**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L209)
+
When true, target detection is skipped. Target detection will return always undefined.
click selection won't work anymore, events will fire with no targets.
if something is selected before setting it to true, it will be deselected at the first click.
area selection will still work. check the `selection` property too.
if you deactivate both, you should look into staticCanvas.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`skipTargetFind`](/api/interfaces/canvasoptions/#skiptargetfind)
@@ -1265,27 +1031,28 @@ if you deactivate both, you should look into staticCanvas.
`SelectableCanvas.skipTargetFind`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:185](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L185)
-
***
-### stopContextMenu
+### ~~stopContextMenu~~
> **stopContextMenu**: `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:223](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L223)
+
Indicates if the right click on canvas can output the context menu or not
+The default value changed from false to true in Fabric 7.0
-#### Since
+:::caution[Deprecated]
+since 7.0, Will be removed in Fabric 8.0
+:::
-1.6.5
+#### See
-#### Default
+https://fabricjs.com/docs/upgrading/upgrading-to-fabric-70/
-```ts
+#### Since
-```
+1.6.5
#### Implementation of
@@ -1295,25 +1062,17 @@ Indicates if the right click on canvas can output the context menu or not
`SelectableCanvas.stopContextMenu`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L200)
-
***
### svgViewportTransformation
> **svgViewportTransformation**: `boolean`
+Defined in: [src/canvas/StaticCanvas.ts:900](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L900)
+
When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true,
a zoomed canvas will then produce zoomed SVG output.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`svgViewportTransformation`](/api/interfaces/canvasoptions/#svgviewporttransformation)
@@ -1322,23 +1081,15 @@ a zoomed canvas will then produce zoomed SVG output.
`SelectableCanvas.svgViewportTransformation`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:954](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L954)
-
***
### targetFindTolerance
> **targetFindTolerance**: `number`
-Number of pixels around target pixel to tolerate (consider active) during object detection
-
-#### Default
-
-```ts
+Defined in: [src/canvas/SelectableCanvas.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L208)
-```
+Number of pixels around target pixel to tolerate (consider active) during object detection
#### Implementation of
@@ -1348,35 +1099,36 @@ Number of pixels around target pixel to tolerate (consider active) during object
`SelectableCanvas.targetFindTolerance`
-#### Defined in
+***
-[src/canvas/SelectableCanvas.ts:184](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L184)
+### textEditingManager
-***
+> **textEditingManager**: `TextEditingManager`
-### targets
+Defined in: [src/canvas/Canvas.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L120)
-> **targets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
+***
-Keep track of the subTargets for Mouse Events, ordered bottom up from innermost nested subTarget
+### uniformScaling
-#### Inherited from
+> **uniformScaling**: `boolean`
-`SelectableCanvas.targets`
+Defined in: [src/canvas/SelectableCanvas.ts:180](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L180)
-#### Defined in
+When true, objects can be transformed by one side (unproportionately)
+when dragged on the corners that normally would not do that.
-[src/canvas/SelectableCanvas.ts:208](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L208)
+#### Since
-***
+fabric 4.0 // changed name and default value
-### textEditingManager
+#### Implementation of
-> **textEditingManager**: `TextEditingManager`
+[`CanvasOptions`](/api/interfaces/canvasoptions/).[`uniformScaling`](/api/interfaces/canvasoptions/#uniformscaling)
-#### Defined in
+#### Inherited from
-[src/canvas/Canvas.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L115)
+`SelectableCanvas.uniformScaling`
***
@@ -1384,6 +1136,8 @@ Keep track of the subTargets for Mouse Events, ordered bottom up from innermost
> **uniScaleKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/)
+Defined in: [src/canvas/SelectableCanvas.ts:181](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L181)
+
Indicates which key switches uniform scaling.
values: 'altKey', 'shiftKey', 'ctrlKey'.
If `null` or 'none' or any other string that is not a modifier key
@@ -1396,12 +1150,6 @@ and viceversa.
1.6.2
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`uniScaleKey`](/api/interfaces/canvasoptions/#uniscalekey)
@@ -1410,47 +1158,14 @@ and viceversa.
`SelectableCanvas.uniScaleKey`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:157](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L157)
-
-***
-
-### uniformScaling
-
-> **uniformScaling**: `boolean`
-
-When true, objects can be transformed by one side (unproportionately)
-when dragged on the corners that normally would not do that.
-
-#### Default
-
-```ts
-
-```
-
-#### Since
-
-fabric 4.0 // changed name and default value
-
-#### Implementation of
-
-[`CanvasOptions`](/api/interfaces/canvasoptions/).[`uniformScaling`](/api/interfaces/canvasoptions/#uniformscaling)
-
-#### Inherited from
-
-`SelectableCanvas.uniformScaling`
-
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:156](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L156)
-
***
### viewportTransform
> **viewportTransform**: [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/canvas/StaticCanvas.ts:125](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L125)
+
The transformation (a Canvas 2D API transform matrix) which focuses the viewport
#### Examples
@@ -1463,12 +1178,6 @@ canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
```
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`CanvasOptions`](/api/interfaces/canvasoptions/).[`viewportTransform`](/api/interfaces/canvasoptions/#viewporttransform)
@@ -1477,32 +1186,28 @@ canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
`SelectableCanvas.viewportTransform`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:125](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L125)
-
***
### vptCoords
> **vptCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-The viewport bounding box in scene plane coordinates, see [calcViewportBoundaries](../../../../api/classes/canvas/#calcviewportboundaries)
+Defined in: [src/canvas/StaticCanvas.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L130)
+
+The viewport bounding box in scene plane coordinates, see [calcViewportBoundaries](/api/classes/canvas/#calcviewportboundaries)
#### Inherited from
`SelectableCanvas.vptCoords`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L130)
-
***
### width
> **width**: `number`
+Defined in: [src/canvas/StaticCanvas.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L93)
+
Width in virtual/logical pixels of the canvas.
The canvas can be larger than width if retina scaling is active
@@ -1514,31 +1219,29 @@ The canvas can be larger than width if retina scaling is active
`SelectableCanvas.width`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L93)
-
***
### ownDefaults
> `static` **ownDefaults**: [`TOptions`](/api/type-aliases/toptions/)\<[`CanvasOptions`](/api/interfaces/canvasoptions/)\> = `canvasDefaults`
+Defined in: [src/canvas/SelectableCanvas.ts:304](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L304)
+
#### Inherited from
`SelectableCanvas.ownDefaults`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L288)
-
## Accessors
### contextContainer
-> `get` **contextContainer**(): `CanvasRenderingContext2D`
+#### Get Signature
-#### Returns
+> **get** **contextContainer**(): `CanvasRenderingContext2D`
+
+Defined in: [src/canvas/StaticCanvas.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L141)
+
+##### Returns
`CanvasRenderingContext2D`
@@ -1546,17 +1249,17 @@ The canvas can be larger than width if retina scaling is active
`SelectableCanvas.contextContainer`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:141](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L141)
-
***
### contextTop
-> `get` **contextTop**(): `CanvasRenderingContext2D`
+#### Get Signature
-#### Returns
+> **get** **contextTop**(): `CanvasRenderingContext2D`
+
+Defined in: [src/canvas/SelectableCanvas.ts:314](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L314)
+
+##### Returns
`CanvasRenderingContext2D`
@@ -1564,20 +1267,20 @@ The canvas can be larger than width if retina scaling is active
`SelectableCanvas.contextTop`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:298](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L298)
-
***
### lowerCanvasEl
-> `get` **lowerCanvasEl**(): `HTMLCanvasElement`
+#### Get Signature
+
+> **get** **lowerCanvasEl**(): `HTMLCanvasElement`
+
+Defined in: [src/canvas/StaticCanvas.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L137)
A reference to the canvas actual HTMLCanvasElement.
Can be use to read the raw pixels, but never write or manipulate
-#### Returns
+##### Returns
`HTMLCanvasElement`
@@ -1585,17 +1288,17 @@ Can be use to read the raw pixels, but never write or manipulate
`SelectableCanvas.lowerCanvasEl`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L137)
-
***
### upperCanvasEl
-> `get` **upperCanvasEl**(): `HTMLCanvasElement`
+#### Get Signature
-#### Returns
+> **get** **upperCanvasEl**(): `HTMLCanvasElement`
+
+Defined in: [src/canvas/SelectableCanvas.ts:311](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L311)
+
+##### Returns
`HTMLCanvasElement`
@@ -1603,17 +1306,17 @@ Can be use to read the raw pixels, but never write or manipulate
`SelectableCanvas.upperCanvasEl`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L295)
-
***
### wrapperEl
-> `get` **wrapperEl**(): `HTMLDivElement`
+#### Get Signature
-#### Returns
+> **get** **wrapperEl**(): `HTMLDivElement`
+
+Defined in: [src/canvas/SelectableCanvas.ts:317](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L317)
+
+##### Returns
`HTMLDivElement`
@@ -1621,55 +1324,69 @@ Can be use to read the raw pixels, but never write or manipulate
`SelectableCanvas.wrapperEl`
-#### Defined in
+## Methods
-[src/canvas/SelectableCanvas.ts:301](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L301)
+### \_basicEventHandler()
-## Methods
+> **\_basicEventHandler**\<`T`\>(`eventType`, `options`): [`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
-### \_\_onMouseWheel()
+Defined in: [src/canvas/Canvas.ts:898](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L898)
-> **\_\_onMouseWheel**(`e`): `void`
+#### Type Parameters
+
+##### T
-Method that defines actions when an Event Mouse Wheel
+`T` *extends* `"contextmenu"` \| `"drag"` \| `"dragend"` \| `"dragenter"` \| `"dragleave"` \| `"dragover"` \| `"dragstart"` \| `"drop"` \| `"erasing:end"` \| `"drop:before"` \| `"drop:after"` \| `"contextmenu:before"`
#### Parameters
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventType
-Event object fired on mouseup
+`T`
-#### Returns
+##### options
-`void`
+[`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
-#### Defined in
+#### Returns
-[src/canvas/Canvas.ts:1286](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L1286)
+[`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
***
-### \_basicEventHandler()
+### \_discardActiveObject()
-> **\_basicEventHandler**\<`T`\>(`eventType`, `options`): [`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
+> **\_discardActiveObject**(`e?`, `object?`): `this is { _activeObject: undefined }`
-#### Type Parameters
+Defined in: [src/canvas/SelectableCanvas.ts:1250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1250)
-• **T** *extends* `"erasing:end"` \| `"dragstart"` \| `"drag"` \| `"dragover"` \| `"dragenter"` \| `"dragleave"` \| `"dragend"` \| `"drop:before"` \| `"drop"` \| `"drop:after"` \| `"contextmenu:before"` \| `"contextmenu"`
+This is supposed to be equivalent to discardActiveObject but without firing
+any selection events ( can still fire object transformation events ). There is commitment to have this stay this way.
+This is the functional part of discardActiveObject.
#### Parameters
-• **eventType**: `T`
+##### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+Event (passed along when firing "object:deselected")
+
+##### object?
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **options**: [`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
+the next object to set as active, reason why we are discarding this
#### Returns
-[`CanvasEvents`](/api/interfaces/canvasevents/) & [`ObjectEvents`](/api/interfaces/objectevents/)\[`T`\]
+`this is { _activeObject: undefined }`
+
+true if the active object has been discarded
-#### Defined in
+#### Inherited from
-[src/canvas/Canvas.ts:892](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L892)
+`SelectableCanvas._discardActiveObject`
***
@@ -1677,6 +1394,8 @@ Event object fired on mouseup
> **\_chooseObjectsToRender**(): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/canvas/SelectableCanvas.ts:376](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L376)
+
Divides objects in two groups, one to render immediately
and one to render as activeGroup.
@@ -1690,73 +1409,39 @@ objects to render immediately and pushes the other in the activeGroup.
`SelectableCanvas._chooseObjectsToRender`
-#### Defined in
+***
-[src/canvas/SelectableCanvas.ts:360](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L360)
+### \_onStackOrderChanged()
-***
+> **\_onStackOrderChanged**(): `void`
-### \_discardActiveObject()
+Defined in: [src/canvas/SelectableCanvas.ts:366](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L366)
-> **\_discardActiveObject**(`e`?, `object`?): `this is Object`
+#### Returns
-This is supposed to be equivalent to discardActiveObject but without firing
-any selection events ( can still fire object transformation events ). There is commitment to have this stay this way.
-This is the functional part of discardActiveObject.
+`void`
-#### Parameters
+#### Inherited from
-• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+`SelectableCanvas._onStackOrderChanged`
-Event (passed along when firing "object:deselected")
+***
-• **object?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+### \_set()
-the next object to set as active, reason why we are discarding this
+> **\_set**(`key`, `value`): `void`
-#### Returns
+Defined in: [src/CommonMethods.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L38)
-`this is Object`
+#### Parameters
-true if the active object has been discarded
+##### key
-#### Inherited from
-
-`SelectableCanvas._discardActiveObject`
-
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1179](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1179)
-
-***
-
-### \_onStackOrderChanged()
-
-> **\_onStackOrderChanged**(): `void`
-
-#### Returns
-
-`void`
-
-#### Inherited from
-
-`SelectableCanvas._onStackOrderChanged`
-
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:350](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L350)
-
-***
-
-### \_set()
-
-> **\_set**(`key`, `value`): `void`
-
-#### Parameters
+`string`
-• **key**: `string`
+##### value
-• **value**: `any`
+`any`
#### Returns
@@ -1766,15 +1451,13 @@ true if the active object has been discarded
`SelectableCanvas._set`
-#### Defined in
-
-[src/CommonMethods.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L38)
-
***
### \_setActiveObject()
-> **\_setActiveObject**(`object`, `e`?): `boolean`
+> **\_setActiveObject**(`object`, `e?`): `boolean`
+
+Defined in: [src/canvas/SelectableCanvas.ts:1218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1218)
This is supposed to be equivalent to setActiveObject but without firing
any event. There is commitment to have this stay this way.
@@ -1782,11 +1465,15 @@ This is the functional part of setActiveObject.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
to set as active
-• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
Event (passed along when firing "object:selected")
@@ -1800,26 +1487,28 @@ true if the object has been selected
`SelectableCanvas._setActiveObject`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1147](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1147)
-
***
### \_setCursorFromEvent()
-> **\_setCursorFromEvent**(`e`, `target`?): `void`
+> **\_setCursorFromEvent**(`e`, `target?`): `void`
+
+Defined in: [src/canvas/Canvas.ts:1350](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L1350)
Sets the cursor depending on where the canvas is being hovered.
Note: very buggy in Opera
#### Parameters
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
Event object
-• **target?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### target?
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
Object that the mouse is hovering, if so.
@@ -1827,21 +1516,21 @@ Object that the mouse is hovering, if so.
`void`
-#### Defined in
-
-[src/canvas/Canvas.ts:1344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L1344)
-
***
### absolutePan()
> **absolutePan**(`point`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:391](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L391)
+
Pan viewport so as to place point at top left corner of canvas
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
to move to
@@ -1853,22 +1542,22 @@ to move to
`SelectableCanvas.absolutePan`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:431](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L431)
-
***
### add()
> **add**(...`objects`): `number`
+Defined in: [src/canvas/StaticCanvas.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L210)
+
Adds objects to collection
Objects should be instances of (or inherit from) FabricObject
#### Parameters
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
to add
@@ -1882,35 +1571,35 @@ new array length
`SelectableCanvas.add`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:210](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L210)
-
***
### addOrRemove()
> **addOrRemove**(`functor`, `_eventjsFunctor`): `void`
+Defined in: [src/canvas/Canvas.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L167)
+
#### Parameters
-• **functor**: `any`
+##### functor
-• **\_eventjsFunctor**: `"add"` \| `"remove"`
+`any`
-#### Returns
+##### \_eventjsFunctor
-`void`
+`"add"` | `"remove"`
-#### Defined in
+#### Returns
-[src/canvas/Canvas.ts:162](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L162)
+`void`
***
### bringObjectForward()
-> **bringObjectForward**(`object`, `intersecting`?): `boolean`
+> **bringObjectForward**(`object`, `intersecting?`): `boolean`
+
+Defined in: [src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L240)
Moves an object or a selection up in stack of drawn objects
An optional parameter, intersecting allows to move the object in front
@@ -1920,11 +1609,15 @@ stack.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **intersecting?**: `boolean`
+##### intersecting?
+
+`boolean`
If `true`, send object in front of next upper intersecting object
@@ -1938,22 +1631,22 @@ true if change occurred
`SelectableCanvas.bringObjectForward`
-#### Defined in
-
-[src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L240)
-
***
### bringObjectToFront()
> **bringObjectToFront**(`object`): `boolean`
+Defined in: [src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L194)
+
Moves an object or the objects of a multiple selection
to the top of the stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
@@ -1967,16 +1660,14 @@ true if change occurred
`SelectableCanvas.bringObjectToFront`
-#### Defined in
-
-[src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L194)
-
***
### calcOffset()
> **calcOffset**(): `object`
+Defined in: [src/canvas/StaticCanvas.ts:266](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L266)
+
Calculates canvas element offset relative to the document
This method is also attached as "resize" event handler of window
@@ -1996,16 +1687,14 @@ This method is also attached as "resize" event handler of window
`SelectableCanvas.calcOffset`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:266](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L266)
-
***
### calcViewportBoundaries()
> **calcViewportBoundaries**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/canvas/StaticCanvas.ts:488](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L488)
+
Calculate the position of the 4 corner of canvas with current viewportTransform.
helps to determinate when an object is in the current rendering viewport
@@ -2017,16 +1706,14 @@ helps to determinate when an object is in the current rendering viewport
`SelectableCanvas.calcViewportBoundaries`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L528)
-
***
### cancelRequestedRender()
> **cancelRequestedRender**(): `void`
+Defined in: [src/canvas/StaticCanvas.ts:506](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L506)
+
#### Returns
`void`
@@ -2035,21 +1722,21 @@ helps to determinate when an object is in the current rendering viewport
`SelectableCanvas.cancelRequestedRender`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:546](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L546)
-
***
### centerObject()
> **centerObject**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:703](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L703)
+
Centers object vertically and horizontally in the canvas
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to center vertically and horizontally
@@ -2061,21 +1748,21 @@ Object to center vertically and horizontally
`SelectableCanvas.centerObject`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L756)
-
***
### centerObjectH()
> **centerObjectH**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:681](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L681)
+
Centers object horizontally in the canvas
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
#### Returns
@@ -2085,21 +1772,21 @@ Centers object horizontally in the canvas
`SelectableCanvas.centerObjectH`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:734](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L734)
-
***
### centerObjectV()
> **centerObjectV**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:692](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L692)
+
Centers object vertically in the canvas
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to center vertically
@@ -2111,17 +1798,15 @@ Object to center vertically
`SelectableCanvas.centerObjectV`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:745](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L745)
-
***
### clear()
> **clear**(): `void`
-clear [textEditingManager](../../../../api/classes/canvas/#texteditingmanager)
+Defined in: [src/canvas/Canvas.ts:1552](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L1552)
+
+clear [textEditingManager](/api/classes/canvas/#texteditingmanager)
#### Returns
@@ -2131,21 +1816,21 @@ clear [textEditingManager](../../../../api/classes/canvas/#texteditingmanager)
`SelectableCanvas.clear`
-#### Defined in
-
-[src/canvas/Canvas.ts:1535](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L1535)
-
***
### clearContext()
> **clearContext**(`ctx`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:423](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L423)
+
Clears specified context of canvas element
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to clear
@@ -2157,78 +1842,78 @@ Context to clear
`SelectableCanvas.clearContext`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:463](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L463)
-
***
### clone()
-> **clone**(`properties`?): `Promise`\<[`Canvas`](/api/classes/canvas/)\>
+> **clone**(`properties?`): `Promise`\<`Canvas`\>
+
+Defined in: [src/canvas/StaticCanvas.ts:1267](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1267)
Clones canvas instance
#### Parameters
-• **properties?**: `string`[]
+##### properties?
+
+`string`[]
Array of properties to include in the cloned canvas and children
#### Returns
-`Promise`\<[`Canvas`](/api/classes/canvas/)\>
+`Promise`\<`Canvas`\>
#### Inherited from
`SelectableCanvas.clone`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1327](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1327)
-
***
### cloneWithoutData()
-> **cloneWithoutData**(): [`Canvas`](/api/classes/canvas/)
+> **cloneWithoutData**(): `Canvas`
+
+Defined in: [src/canvas/StaticCanvas.ts:1277](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1277)
Clones canvas instance without cloning existing data.
This essentially copies canvas dimensions since loadFromJSON does not affect canvas size.
#### Returns
-[`Canvas`](/api/classes/canvas/)
+`Canvas`
#### Inherited from
`SelectableCanvas.cloneWithoutData`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1337](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1337)
-
***
### collectObjects()
> **collectObjects**(`bbox`, `options`): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L326)
+
Given a bounding box, return all the objects of the collection that are contained in the bounding box.
If `includeIntersecting` is true, return also the objects that intersect the bounding box as well.
This is meant to work with selection. Is not a generic method.
#### Parameters
-• **bbox**: [`TBBox`](/api/type-aliases/tbbox/)
+##### bbox
+
+[`TBBox`](/api/type-aliases/tbbox/)
a bounding box in scene coordinates
-• **options** = `{}`
+##### options
an object with includeIntersecting
-• **options.includeIntersecting?**: `boolean` = `true`
+###### includeIntersecting?
+
+`boolean` = `true`
#### Returns
@@ -2240,16 +1925,14 @@ array of objects contained in the bounding box, ordered from top to bottom stack
`SelectableCanvas.collectObjects`
-#### Defined in
-
-[src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L326)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L165)
+
Returns number representation of a collection complexity
#### Returns
@@ -2262,27 +1945,29 @@ complexity
`SelectableCanvas.complexity`
-#### Defined in
-
-[src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L165)
-
***
### contains()
-> **contains**(`object`, `deep`?): `boolean`
+> **contains**(`object`, `deep?`): `boolean`
+
+Defined in: [src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L148)
Returns true if collection contains an object.\
-**Prefer using [FabricObject#isDescendantOf](../../../../api/classes/fabricobject/#isdescendantof) for performance reasons**
+**Prefer using [FabricObject#isDescendantOf](/api/classes/fabricobject/#isdescendantof) for performance reasons**
instead of `a.contains(b)` use `b.isDescendantOf(a)`
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to check against
-• **deep?**: `boolean`
+##### deep?
+
+`boolean`
`true` to check all descendants, `false` to check only `_objects`
@@ -2296,19 +1981,19 @@ Object to check against
`SelectableCanvas.contains`
-#### Defined in
-
-[src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L148)
-
***
### createSVGClipPathMarkup()
> **createSVGClipPathMarkup**(`options`): `string`
+Defined in: [src/canvas/StaticCanvas.ts:1025](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1025)
+
#### Parameters
-• **options**: [`TSVGExportOptions`](/api/type-aliases/tsvgexportoptions/)
+##### options
+
+[`TSVGExportOptions`](/api/type-aliases/tsvgexportoptions/)
#### Returns
@@ -2318,16 +2003,14 @@ Object to check against
`SelectableCanvas.createSVGClipPathMarkup`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1080](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1080)
-
***
### createSVGFontFacesMarkup()
> **createSVGFontFacesMarkup**(): `string`
+Defined in: [src/canvas/StaticCanvas.ts:1068](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1068)
+
Creates markup containing SVG font faces,
font URLs for font faces must be collected by developers
and are not extracted from the DOM by fabricjs
@@ -2340,16 +2023,14 @@ and are not extracted from the DOM by fabricjs
`SelectableCanvas.createSVGFontFacesMarkup`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1123)
-
***
### createSVGRefElementsMarkup()
> **createSVGRefElementsMarkup**(): `string`
+Defined in: [src/canvas/StaticCanvas.ts:1040](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1040)
+
Creates markup containing SVG referenced elements like patterns, gradients etc.
#### Returns
@@ -2360,17 +2041,15 @@ Creates markup containing SVG referenced elements like patterns, gradients etc.
`SelectableCanvas.createSVGRefElementsMarkup`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1095](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1095)
-
***
### destroy()
> **destroy**(): `void`
-clear [textEditingManager](../../../../api/classes/canvas/#texteditingmanager)
+Defined in: [src/canvas/Canvas.ts:1560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L1560)
+
+clear [textEditingManager](/api/classes/canvas/#texteditingmanager)
#### Returns
@@ -2380,15 +2059,13 @@ clear [textEditingManager](../../../../api/classes/canvas/#texteditingmanager)
`SelectableCanvas.destroy`
-#### Defined in
-
-[src/canvas/Canvas.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L1543)
-
***
### discardActiveObject()
-> **discardActiveObject**(`e`?): `this is Object`
+> **discardActiveObject**(`e?`): `this is { _activeObject: undefined }`
+
+Defined in: [src/canvas/SelectableCanvas.ts:1280](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1280)
Discards currently active object and fire events. If the function is called by fabric
as a consequence of a mouse event, the event is passed as a parameter and
@@ -2397,11 +2074,13 @@ e param does not have any application.
#### Parameters
-• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
-`this is Object`
+`this is { _activeObject: undefined }`
true if the active object has been discarded
@@ -2409,16 +2088,14 @@ true if the active object has been discarded
`SelectableCanvas.discardActiveObject`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1209)
-
***
### dispose()
> **dispose**(): `Promise`\<`boolean`\>
+Defined in: [src/canvas/StaticCanvas.ts:1411](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1411)
+
Waits until rendering has settled to destroy the canvas
#### Returns
@@ -2435,25 +2112,27 @@ if aborted by a consequent call
`SelectableCanvas.dispose`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1455](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1455)
-
***
### drawClipPathOnCanvas()
> **drawClipPathOnCanvas**(`ctx`, `clipPath`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L570)
+
Paint the cached clipPath on the lowerCanvasEl
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: `TCachedFabricObject`
+##### clipPath
+
+`TCachedFabricObject`
#### Returns
@@ -2463,21 +2142,21 @@ Context to render on
`SelectableCanvas.drawClipPathOnCanvas`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:610](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L610)
-
***
### drawControls()
> **drawControls**(`ctx`): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:1388](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1388)
+
Draws objects' controls (borders/controls)
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render controls on
@@ -2489,15 +2168,13 @@ Context to render controls on
`SelectableCanvas.drawControls`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1317](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1317)
-
***
### endCurrentTransform()
-> **endCurrentTransform**(`e`?): `void`
+> **endCurrentTransform**(`e?`): `void`
+
+Defined in: [src/canvas/SelectableCanvas.ts:1300](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1300)
End the current transform.
You don't usually need to call this method unless you are interrupting a user initiated transform
@@ -2505,7 +2182,9 @@ because of some other event ( a press of key combination, or something that bloc
#### Parameters
-• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
send the mouse event that generate the finalize down, so it can be used in the event
@@ -2517,23 +2196,27 @@ send the mouse event that generate the finalize down, so it can be used in the e
`SelectableCanvas.endCurrentTransform`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1229](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1229)
-
***
### findNewLowerIndex()
-> **findNewLowerIndex**(`object`, `idx`, `intersecting`?): `number`
+> **findNewLowerIndex**(`object`, `idx`, `intersecting?`): `number`
+
+Defined in: [src/Collection.ts:272](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L272)
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
-• **idx**: `number`
+##### idx
-• **intersecting?**: `boolean`
+`number`
+
+##### intersecting?
+
+`boolean`
#### Returns
@@ -2543,23 +2226,27 @@ send the mouse event that generate the finalize down, so it can be used in the e
`SelectableCanvas.findNewLowerIndex`
-#### Defined in
-
-[src/Collection.ts:272](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L272)
-
***
### findNewUpperIndex()
-> **findNewUpperIndex**(`object`, `idx`, `intersecting`?): `number`
+> **findNewUpperIndex**(`object`, `idx`, `intersecting?`): `number`
+
+Defined in: [src/Collection.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L295)
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
-• **idx**: `number`
+##### idx
-• **intersecting?**: `boolean`
+`number`
+
+##### intersecting?
+
+`boolean`
#### Returns
@@ -2569,29 +2256,31 @@ send the mouse event that generate the finalize down, so it can be used in the e
`SelectableCanvas.findNewUpperIndex`
-#### Defined in
-
-[src/Collection.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L295)
-
***
### findTarget()
-> **findTarget**(`e`): `undefined` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **findTarget**(`e`): `FullTargetsInfoWithContainer`
-Method that determines what object we are clicking on
+Defined in: [src/canvas/SelectableCanvas.ts:730](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L730)
+
+This function is in charge of deciding which is the object that is the current target of an interaction event.
+For interaction event we mean a pointer related action on the canvas.
+Which is the
11/09/2018 TODO: would be cool if findTarget could discern between being a full target
or the outside part of the corner.
#### Parameters
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
mouse event
#### Returns
-`undefined` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`FullTargetsInfoWithContainer`
the target found
@@ -2599,29 +2288,33 @@ the target found
`SelectableCanvas.findTarget`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L712)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+##### K
+
+`K` *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: [`CanvasEvents`](/api/interfaces/canvasevents/)\[`K`\]
+##### options?
+
+[`CanvasEvents`](/api/interfaces/canvasevents/)\[`K`\]
Options object
@@ -2633,23 +2326,23 @@ Options object
`SelectableCanvas.fire`
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachObject()
> **forEachObject**(`callback`): `void`
+Defined in: [src/Collection.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L91)
+
Executes given function for each object in this group
A simple shortcut for getObjects().forEach, before es6 was more complicated,
now is just a shortcut.
#### Parameters
-• **callback**
+##### callback
+
+(`object`, `index`, `array`) => `any`
Callback invoked with current object as first argument,
index - as second and an array of all objects - as third.
@@ -2662,21 +2355,21 @@ Callback invoked with current object as first argument,
`SelectableCanvas.forEachObject`
-#### Defined in
-
-[src/Collection.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L91)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -2690,16 +2383,14 @@ value of a property
`SelectableCanvas.get`
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveObject()
> **getActiveObject**(): `undefined` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/canvas/SelectableCanvas.ts:1120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1120)
+
Returns currently active object
#### Returns
@@ -2712,16 +2403,14 @@ active object
`SelectableCanvas.getActiveObject`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1049](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1049)
-
***
### getActiveObjects()
> **getActiveObjects**(): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/canvas/SelectableCanvas.ts:1128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1128)
+
Returns an array with the current selected objects
#### Returns
@@ -2734,51 +2423,14 @@ active objects array
`SelectableCanvas.getActiveObjects`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1057](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1057)
-
-***
-
-### ~~getCenter()~~
-
-> **getCenter**(): `object`
-
-Returns coordinates of a center of canvas.
-Returned value is an object with top and left properties
-
-:::caution[Deprecated]
-migrate to `getCenterPoint`
-:::
-
-#### Returns
-
-`object`
-
-object with "top" and "left" number values
-
-##### ~~left~~
-
-> **left**: `number`
-
-##### ~~top~~
-
-> **top**: `number`
-
-#### Inherited from
-
-`SelectableCanvas.getCenter`
-
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:716](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L716)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/canvas/StaticCanvas.ts:674](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L674)
+
Returns coordinates of a center of canvas.
#### Returns
@@ -2789,16 +2441,14 @@ Returns coordinates of a center of canvas.
`SelectableCanvas.getCenterPoint`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:727](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L727)
-
***
### getContext()
> **getContext**(): `CanvasRenderingContext2D`
+Defined in: [src/canvas/StaticCanvas.ts:431](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L431)
+
Returns context of canvas where objects are drawn
#### Returns
@@ -2809,16 +2459,14 @@ Returns context of canvas where objects are drawn
`SelectableCanvas.getContext`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:471](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L471)
-
***
### getElement()
> **getElement**(): `HTMLCanvasElement`
+Defined in: [src/canvas/StaticCanvas.ts:415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L415)
+
Returns <canvas> element corresponding to this instance
#### Returns
@@ -2829,16 +2477,14 @@ Returns <canvas> element corresponding to this instance
`SelectableCanvas.getElement`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:455](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L455)
-
***
### getHeight()
> **getHeight**(): `number`
+Defined in: [src/canvas/StaticCanvas.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L282)
+
Returns canvas height (in px)
#### Returns
@@ -2849,21 +2495,21 @@ Returns canvas height (in px)
`SelectableCanvas.getHeight`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L282)
-
***
### getObjects()
-> **getObjects**(...`types`?): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+> **getObjects**(...`types?`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+
+Defined in: [src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L108)
Returns an array of children objects of this instance
#### Parameters
-• ...**types?**: `string`[]
+##### types?
+
+...`string`[]
When specified, only objects of these types are returned
@@ -2875,77 +2521,40 @@ When specified, only objects of these types are returned
`SelectableCanvas.getObjects`
-#### Defined in
-
-[src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L108)
-
***
-### ~~getPointer()~~
-
-> **getPointer**(`e`, `fromViewport`?): [`Point`](/api/classes/point/)
+### getScenePoint()
-Returns pointer relative to canvas.
+> **getScenePoint**(`e`): [`Point`](/api/classes/point/)
-:::caution[Deprecated]
-This method is deprecated since v6 to protect you from misuse.
-Use [getViewportPoint](/api/classes/canvas/#getviewportpoint) or [getScenePoint](/api/classes/canvas/#getscenepoint) instead.
-:::
+Defined in: [src/canvas/SelectableCanvas.ts:1009](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1009)
#### Parameters
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e
-• **fromViewport?**: `boolean` = `false`
-
-whether to return the point from the viewport or in the scene
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
[`Point`](/api/classes/point/)
-#### Inherited from
+point existing in the scene (the same plane as the plane [FabricObject#getCenterPoint](/api/classes/fabricobject/#getcenterpoint) exists in).
+This means that changes to the [viewportTransform](/api/classes/staticcanvas/#viewporttransform) do not change the values of the point,
+however, from the viewer's perspective, the point is changed.
+
+#### Example
-`SelectableCanvas.getPointer`
+```ts
+const viewportPoint = sendPointToPlane(
+ this.getScenePoint(e),
+ canvas.viewportTransform
+);
+```
-#### Defined in
+#### Inherited from
-[src/canvas/SelectableCanvas.ts:954](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L954)
-
-***
-
-### getScenePoint()
-
-> **getScenePoint**(`e`): [`Point`](/api/classes/point/)
-
-#### Parameters
-
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
-
-#### Returns
-
-[`Point`](/api/classes/point/)
-
-point existing in the scene (the same plane as the plane [FabricObject#getCenterPoint](/api/api/classes/fabricobject/getcenterpoint/#getcenterpoint) exists in).
-This means that changes to the [viewportTransform](/api/api/classes/staticcanvas/viewporttransform/#viewporttransform) do not change the values of the point,
-however, from the viewer's perspective, the point is changed.
-
-#### Example
-
-```ts
-const viewportPoint = sendPointToPlane(
- this.getScenePoint(e),
- canvas.viewportTransform
-);
-```
-
-#### Inherited from
-
-`SelectableCanvas.getScenePoint`
-
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L937)
+`SelectableCanvas.getScenePoint`
***
@@ -2953,6 +2562,8 @@ const viewportPoint = sendPointToPlane(
> **getSelectionContext**(): `CanvasRenderingContext2D`
+Defined in: [src/canvas/SelectableCanvas.ts:1104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1104)
+
Returns context of canvas where object selection is drawn
#### Returns
@@ -2965,16 +2576,14 @@ Returns context of canvas where object selection is drawn
`SelectableCanvas.getSelectionContext`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1033](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1033)
-
***
### getSelectionElement()
> **getSelectionElement**(): `HTMLCanvasElement`
+Defined in: [src/canvas/SelectableCanvas.ts:1112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1112)
+
Returns <canvas> element on which object selection is drawn
#### Returns
@@ -2985,16 +2594,14 @@ Returns <canvas> element on which object selection is drawn
`SelectableCanvas.getSelectionElement`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1041](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1041)
-
***
### getTopContext()
> **getTopContext**(): `CanvasRenderingContext2D`
+Defined in: [src/canvas/SelectableCanvas.ts:1095](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1095)
+
Returns context of top canvas where interactions are drawn
#### Returns
@@ -3005,19 +2612,19 @@ Returns context of top canvas where interactions are drawn
`SelectableCanvas.getTopContext`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1024](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1024)
-
***
### getViewportPoint()
> **getViewportPoint**(`e`): [`Point`](/api/classes/point/)
+Defined in: [src/canvas/SelectableCanvas.ts:990](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L990)
+
#### Parameters
-• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -3025,7 +2632,7 @@ Returns context of top canvas where interactions are drawn
point existing in the same plane as the HTMLCanvasElement,
`(0, 0)` being the top left corner of the HTMLCanvasElement.
-This means that changes to the [viewportTransform](/api/api/classes/staticcanvas/viewporttransform/#viewporttransform) do not change the values of the point
+This means that changes to the [viewportTransform](/api/classes/staticcanvas/#viewporttransform) do not change the values of the point
and it remains unchanged from the viewer's perspective.
#### Example
@@ -3042,16 +2649,14 @@ const scenePoint = sendPointToPlane(
`SelectableCanvas.getViewportPoint`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:918](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L918)
-
***
### getVpCenter()
> **getVpCenter**(): [`Point`](/api/classes/point/)
+Defined in: [src/canvas/StaticCanvas.ts:741](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L741)
+
Calculate the point in canvas that correspond to the center of actual viewport.
#### Returns
@@ -3064,16 +2669,14 @@ vpCenter, viewport center
`SelectableCanvas.getVpCenter`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:794](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L794)
-
***
### getWidth()
> **getWidth**(): `number`
+Defined in: [src/canvas/StaticCanvas.ts:274](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L274)
+
Returns canvas width (in px)
#### Returns
@@ -3084,16 +2687,14 @@ Returns canvas width (in px)
`SelectableCanvas.getWidth`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L274)
-
***
### getZoom()
> **getZoom**(): `number`
+Defined in: [src/canvas/StaticCanvas.ts:344](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L344)
+
Returns canvas zoom level
#### Returns
@@ -3104,25 +2705,27 @@ Returns canvas zoom level
`SelectableCanvas.getZoom`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:384](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L384)
-
***
### insertAt()
> **insertAt**(`index`, ...`objects`): `number`
+Defined in: [src/canvas/StaticCanvas.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L216)
+
Inserts an object into collection at specified index
#### Parameters
-• **index**: `number`
+##### index
+
+`number`
Index to insert object at
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
Object(s) to insert
@@ -3136,16 +2739,14 @@ new array length
`SelectableCanvas.insertAt`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L216)
-
***
### isEmpty()
> **isEmpty**(): `boolean`
+Defined in: [src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L128)
+
Returns true if collection contains no objects
#### Returns
@@ -3158,30 +2759,34 @@ true if collection is empty
`SelectableCanvas.isEmpty`
-#### Defined in
-
-[src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L128)
-
***
### isTargetTransparent()
> **isTargetTransparent**(`target`, `x`, `y`): `boolean`
+Defined in: [src/canvas/SelectableCanvas.ts:460](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L460)
+
Returns true if object is transparent at a certain location
Clarification: this is `is target transparent at location X or are controls there`
#### Parameters
-• **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### target
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to check
-• **x**: `number`
+##### x
+
+`number`
Left coordinate in viewport space
-• **y**: `number`
+##### y
+
+`number`
Top coordinate in viewport space
@@ -3198,21 +2803,21 @@ programmatically without painting them, the cache canvas optimization is always
`SelectableCanvas.isTargetTransparent`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:444](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L444)
-
***
### item()
> **item**(`index`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/Collection.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L120)
+
Returns object at specified index
#### Parameters
-• **index**: `number`
+##### index
+
+`number`
#### Returns
@@ -3224,15 +2829,13 @@ object at index
`SelectableCanvas.item`
-#### Defined in
-
-[src/Collection.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L120)
-
***
### loadFromJSON()
-> **loadFromJSON**(`json`, `reviver`?, `options`?): `Promise`\<[`Canvas`](/api/classes/canvas/)\>
+> **loadFromJSON**(`json`, `reviver?`, `options?`): `Promise`\<`Canvas`\>
+
+Defined in: [src/canvas/StaticCanvas.ts:1221](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1221)
Populates canvas with data from the specified JSON.
JSON format must conform to the one of fabric.Canvas#toJSON
@@ -3241,31 +2844,34 @@ JSON format must conform to the one of fabric.Canvas#toJSON
#### Parameters
-• **json**: `string` \| `Record`\<`string`, `any`\>
+##### json
JSON string or object
-• **reviver?**
+`string` | `Record`\<`string`, `any`\>
+
+##### reviver?
+
+\<`T`\>(`serializedObj`, `instance`) => `void`
Method for further parsing of JSON elements, called after each fabric object created.
-• **options?**: [`Abortable`](/api/type-aliases/abortable/) = `{}`
+##### options?
+
+[`Abortable`](/api/type-aliases/abortable/) = `{}`
options
#### Returns
-`Promise`\<[`Canvas`](/api/classes/canvas/)\>
+`Promise`\<`Canvas`\>
instance
-#### Tutorial
-
-[http://fabricjs.com/fabric-intro-part-3#deserialization](http://fabricjs.com/fabric-intro-part-3#deserialization)
-
#### See
-[demo](http://jsfiddle.net/fabricjs/fmgXt/|jsFiddle)
+ - [http://fabric5.fabricjs.com/fabric-intro-part-3#deserialization](http://fabric5.fabricjs.com/fabric-intro-part-3#deserialization)
+ - [demo](http://jsfiddle.net/fabricjs/fmgXt/|jsFiddle)
#### Examples
@@ -3287,25 +2893,27 @@ canvas.loadFromJSON(json, function(o, object) {
`SelectableCanvas.loadFromJSON`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1276](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1276)
-
***
### moveObjectTo()
> **moveObjectTo**(`object`, `index`): `boolean`
+Defined in: [src/Collection.ts:262](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L262)
+
Moves an object to specified level in stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **index**: `number`
+##### index
+
+`number`
Position to move to
@@ -3319,18 +2927,16 @@ true if change occurred
`SelectableCanvas.moveObjectTo`
-#### Defined in
-
-[src/Collection.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L262)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -3341,11 +2947,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+###### K
+
+`K` *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -3357,27 +2967,31 @@ event name (eg. 'after:render')
`SelectableCanvas.off`
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+###### K
+
+`K` *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -3389,19 +3003,19 @@ event listener to unsubscribe
`SelectableCanvas.off`
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<[`CanvasEvents`](/api/interfaces/canvasevents/)\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -3413,14 +3027,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
`SelectableCanvas.off`
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -3431,33 +3043,39 @@ unsubscribe all event listeners
`SelectableCanvas.off`
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+###### K
+
+`K` *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
-• **E** *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| [`DropEventData`](/api/interfaces/dropeventdata/) \| `SimpleEventHandler`\<`Event`\> \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> \| `object` \| `object` \| `object` \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` \| [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object`
+###### E
+
+`E` *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| `SimpleEventHandler`\<`Event`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DropEventData`](/api/interfaces/dropeventdata/) \| \{ `drawables`: \{ `backgroundImage?`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>; `overlayImage?`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>; \}; `path`: [`FabricObject`](/api/classes/fabricobject/); `subTargets`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]; `targets`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]; \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`IText`](/api/classes/itext/); \} \| \{ `target`: [`IText`](/api/classes/itext/); \} \| `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> \| \{ `target`: [`IText`](/api/classes/itext/); \} \| \{ `ctx`: `CanvasRenderingContext2D`; \} \| \{ `ctx`: `CanvasRenderingContext2D`; \} \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -3475,53 +3093,69 @@ on
`SelectableCanvas.on`
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<[`CanvasEvents`](/api/interfaces/canvasevents/)\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-`SelectableCanvas.on`
+##### Alias
-##### Defined in
+on
+
+##### Inherited from
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+`SelectableCanvas.on`
***
### once()
-#### once(eventName, handler)
+#### Call Signature
> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
+
Observes specified event **once**
##### Type Parameters
-• **K** *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+###### K
+
+`K` *extends* keyof [`CanvasEvents`](/api/interfaces/canvasevents/)
+
+###### E
-• **E** *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| [`DropEventData`](/api/interfaces/dropeventdata/) \| `SimpleEventHandler`\<`Event`\> \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` \| `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> \| `object` \| `object` \| `object` \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` \| [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object`
+`E` *extends* [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<`WheelEvent`\> \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `InEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `OutEvent` \| [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| `SimpleEventHandler`\<`Event`\> \| [`DragEventData`](/api/interfaces/drageventdata/) \| [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` \| [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` \| `TEventWithTarget`\<`DragEvent`\> \| [`DropEventData`](/api/interfaces/dropeventdata/) \| \{ `drawables`: \{ `backgroundImage?`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>; `overlayImage?`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>; \}; `path`: [`FabricObject`](/api/classes/fabricobject/); `subTargets`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]; `targets`: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]; \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`IText`](/api/classes/itext/); \} \| \{ `target`: [`IText`](/api/classes/itext/); \} \| `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> \| \{ `target`: [`IText`](/api/classes/itext/); \} \| \{ `ctx`: `CanvasRenderingContext2D`; \} \| \{ `ctx`: `CanvasRenderingContext2D`; \} \| [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` \| [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| \{ `target`: [`FabricObject`](/api/classes/fabricobject/); \} \| [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` \| [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) \| [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` \| `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -3539,29 +3173,35 @@ once
`SelectableCanvas.once`
-##### Defined in
+#### Call Signature
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+> **once**(`handlers`): `VoidFunction`
-#### once(handlers)
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
-> **once**(`handlers`): `VoidFunction`
+Observes specified event **once**
##### Parameters
-• **handlers**: `EventRegistryObject`\<[`CanvasEvents`](/api/interfaces/canvasevents/)\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-`SelectableCanvas.once`
+##### Alias
+
+once
-##### Defined in
+##### Inherited from
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+`SelectableCanvas.once`
***
@@ -3569,11 +3209,15 @@ once
> **relativePan**(`point`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:402](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L402)
+
Pans viewpoint relatively
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
(position vector) to move by
@@ -3585,32 +3229,28 @@ Pans viewpoint relatively
`SelectableCanvas.relativePan`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:442](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L442)
-
***
### removeListeners()
> **removeListeners**(): `void`
+Defined in: [src/canvas/Canvas.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/Canvas.ts#L210)
+
Removes all event listeners, used when disposing the instance
#### Returns
`void`
-#### Defined in
-
-[src/canvas/Canvas.ts:203](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/Canvas.ts#L203)
-
***
### renderAll()
> **renderAll**(): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:388](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L388)
+
Renders both the top canvas and the secondary container canvas.
#### Returns
@@ -3621,23 +3261,25 @@ Renders both the top canvas and the secondary container canvas.
`SelectableCanvas.renderAll`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:372](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L372)
-
***
### renderCanvas()
> **renderCanvas**(`ctx`, `objects`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:522](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L522)
+
Renders background, objects, overlay and controls.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### objects
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
to render
@@ -3649,16 +3291,14 @@ to render
`SelectableCanvas.renderCanvas`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:562](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L562)
-
***
### renderTop()
> **renderTop**(): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:428](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L428)
+
Method to render only the top canvas.
Also used to render the group selection box.
Does not render text selection.
@@ -3671,21 +3311,21 @@ Does not render text selection.
`SelectableCanvas.renderTop`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:412](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L412)
-
***
### renderTopLayer()
> **renderTopLayer**(`ctx`): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:409](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L409)
+
text selection is rendered by the active text instance during the rendering cycle
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -3695,16 +3335,14 @@ text selection is rendered by the active text instance during the rendering cycl
`SelectableCanvas.renderTopLayer`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L393)
-
***
### requestRenderAll()
> **requestRenderAll**(): `void`
+Defined in: [src/canvas/StaticCanvas.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L478)
+
Append a renderAll request to next animation frame.
unless one is already in progress, in that case nothing is done
a boolean flag will avoid appending more.
@@ -3717,51 +3355,48 @@ a boolean flag will avoid appending more.
`SelectableCanvas.requestRenderAll`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L518)
-
***
### searchPossibleTargets()
-> **searchPossibleTargets**(`objects`?, `pointer`?): `undefined` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **searchPossibleTargets**(`objects`, `pointer`): `TargetsInfoWithContainer`
-Function used to search inside objects an object that contains pointer in bounding box or that contains pointerOnCanvas when painted
+Defined in: [src/canvas/SelectableCanvas.ts:936](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L936)
+
+Search inside an objects array the fiurst object that contains pointer
+Collect subTargets of that object inside the subTargets array passed as parameter
#### Parameters
-• **objects?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
objects array to look into
-• **pointer?**: [`Point`](/api/classes/point/)
+##### pointer
+
+[`Point`](/api/classes/point/)
coordinates from viewport to check.
#### Returns
-`undefined` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`TargetsInfoWithContainer`
**top most object on screen** that contains pointer
-#### See
-
-_searchPossibleTargets
-
#### Inherited from
`SelectableCanvas.searchPossibleTargets`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L872)
-
***
### sendObjectBackwards()
-> **sendObjectBackwards**(`object`, `intersecting`?): `boolean`
+> **sendObjectBackwards**(`object`, `intersecting?`): `boolean`
+
+Defined in: [src/Collection.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L214)
Moves an object or a selection down in stack of drawn objects
An optional parameter, `intersecting` allows to move the object in behind
@@ -3771,11 +3406,15 @@ stack.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **intersecting?**: `boolean`
+##### intersecting?
+
+`boolean`
If `true`, send object behind next lower intersecting object
@@ -3789,22 +3428,22 @@ true if change occurred
`SelectableCanvas.sendObjectBackwards`
-#### Defined in
-
-[src/Collection.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L214)
-
***
### sendObjectToBack()
> **sendObjectToBack**(`object`): `boolean`
+Defined in: [src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L178)
+
Moves an object or the objects of a multiple selection
to the bottom of the stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send to back
@@ -3818,55 +3457,59 @@ true if change occurred
`SelectableCanvas.sendObjectToBack`
-#### Defined in
-
-[src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L178)
-
***
### set()
-> **set**(`key`, `value`?): [`Canvas`](/api/classes/canvas/)
+> **set**(`key`, `value?`): `Canvas`
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`Canvas`](/api/classes/canvas/)
+`Canvas`
#### Inherited from
`SelectableCanvas.set`
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
### setActiveObject()
-> **setActiveObject**(`object`, `e`?): `boolean`
+> **setActiveObject**(`object`, `e?`): `boolean`
+
+Defined in: [src/canvas/SelectableCanvas.ts:1202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1202)
Sets given object as the only active object on canvas
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to set as an active one
-• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
Event (passed along when firing "object:selected")
@@ -3880,21 +3523,21 @@ true if the object has been selected
`SelectableCanvas.setActiveObject`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1131)
-
***
### setCursor()
> **setCursor**(`value`): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:676](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L676)
+
Set the cursor type of the canvas element
#### Parameters
-• **value**: `string`
+##### value
+
+`string`
Cursor type of the canvas element.
@@ -3910,35 +3553,39 @@ http://www.w3.org/TR/css3-ui/#cursor
`SelectableCanvas.setCursor`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:660](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L660)
-
***
### setDimensions()
-#### setDimensions(dimensions, options)
+#### Call Signature
-> **setDimensions**(`dimensions`, `options`?): `void`
+> **setDimensions**(`dimensions`, `options?`): `void`
+
+Defined in: [src/canvas/StaticCanvas.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L321)
Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em)
##### Parameters
-• **dimensions**: `Partial`\<`CSSDimensions`\>
+###### dimensions
+
+`Partial`\<`CSSDimensions`\>
Object with width/height properties
-• **options?**
+###### options?
Options object
-• **options.backstoreOnly?**: `false`
+###### backstoreOnly?
+
+`false`
Set the given dimensions only as canvas backstore dimensions
-• **options.cssOnly?**: `true`
+###### cssOnly?
+
+`true`
Set the given dimensions only as css dimensions
@@ -3950,45 +3597,37 @@ Set the given dimensions only as css dimensions
`SelectableCanvas.setDimensions`
-##### Defined in
+#### Call Signature
-[src/canvas/StaticCanvas.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L361)
+> **setDimensions**(`dimensions`, `options?`): `void`
-#### setDimensions(dimensions, options)
+Defined in: [src/canvas/StaticCanvas.ts:325](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L325)
-> **setDimensions**(`dimensions`, `options`?): `void`
+Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em)
##### Parameters
-• **dimensions**: `Partial`\<[`TSize`](/api/type-aliases/tsize/)\>
-
-• **options?**
+###### dimensions
-• **options.backstoreOnly?**: `true`
+`Partial`\<[`TSize`](/api/type-aliases/tsize/)\>
-• **options.cssOnly?**: `false`
-
-##### Returns
-
-`void`
-
-##### Inherited from
+Object with width/height properties
-`SelectableCanvas.setDimensions`
+###### options?
-##### Defined in
+Options object
-[src/canvas/StaticCanvas.ts:365](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L365)
+###### backstoreOnly?
-#### setDimensions(dimensions, options)
+`true`
-> **setDimensions**(`dimensions`, `options`?): `void`
+Set the given dimensions only as canvas backstore dimensions
-##### Parameters
+###### cssOnly?
-• **dimensions**: `Partial`\<[`TSize`](/api/type-aliases/tsize/)\>
+`false`
-• **options?**: `undefined`
+Set the given dimensions only as css dimensions
##### Returns
@@ -3998,68 +3637,27 @@ Set the given dimensions only as css dimensions
`SelectableCanvas.setDimensions`
-##### Defined in
-
-[src/canvas/StaticCanvas.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L369)
-
-***
-
-### setHeight()
-
-#### setHeight(value, options)
+#### Call Signature
-> **setHeight**(`value`, `options`?): `void`
+> **setDimensions**(`dimensions`, `options?`): `void`
-s
-Sets height of this canvas instance
+Defined in: [src/canvas/StaticCanvas.ts:329](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L329)
-:::caution[Deprecated]
-will be removed in 7.0
-:::
+Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em)
##### Parameters
-• **value**: `number`
-
-Value to set height to
-
-• **options?**
-
-Options object
-
-• **options.backstoreOnly?**: `true`
-
-Set the given dimensions only as canvas backstore dimensions
-
-• **options.cssOnly?**: `false`
-
-Set the given dimensions only as css dimensions
-
-##### Returns
-
-`void`
-
-##### Inherited from
-
-`SelectableCanvas.setHeight`
-
-##### Defined in
+###### dimensions
-[src/canvas/StaticCanvas.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L314)
+`Partial`\<[`TSize`](/api/type-aliases/tsize/)\>
-#### setHeight(value, options)
-
-> **setHeight**(`value`, `options`?): `void`
-
-##### Parameters
-
-• **value**: `string` \| `number`
+Object with width/height properties
-• **options?**
+###### options?
-• **options.backstoreOnly?**: `false`
+`undefined`
-• **options.cssOnly?**: `true`
+Options object
##### Returns
@@ -4067,11 +3665,7 @@ Set the given dimensions only as css dimensions
##### Inherited from
-`SelectableCanvas.setHeight`
-
-##### Defined in
-
-[src/canvas/StaticCanvas.ts:318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L318)
+`SelectableCanvas.setDimensions`
***
@@ -4079,11 +3673,15 @@ Set the given dimensions only as css dimensions
> **setViewportTransform**(`vpt`): `void`
+Defined in: [src/canvas/SelectableCanvas.ts:1340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L1340)
+
Sets viewport transformation of this canvas instance
#### Parameters
-• **vpt**: [`TMat2D`](/api/type-aliases/tmat2d/)
+##### vpt
+
+[`TMat2D`](/api/type-aliases/tmat2d/)
a Canvas 2D API transform matrix
@@ -4095,173 +3693,181 @@ a Canvas 2D API transform matrix
`SelectableCanvas.setViewportTransform`
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:1269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L1269)
-
***
-### setWidth()
+### setZoom()
-#### setWidth(value, options)
+> **setZoom**(`value`): `void`
-> **setWidth**(`value`, `options`?): `void`
+Defined in: [src/canvas/StaticCanvas.ts:383](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L383)
-Sets width of this canvas instance
+Sets zoom level of this canvas instance
-:::caution[Deprecated]
-will be removed in 7.0
-:::
+#### Parameters
-##### Parameters
+##### value
-• **value**: `number`
+`number`
-Value to set width to
+to set zoom to, less than 1 zooms out
-• **options?**
+#### Returns
-Options object
+`void`
-• **options.backstoreOnly?**: `true`
+#### Inherited from
-Set the given dimensions only as canvas backstore dimensions
+`SelectableCanvas.setZoom`
-• **options.cssOnly?**: `false`
+***
-Set the given dimensions only as css dimensions
+### size()
-##### Returns
+> **size**(): `number`
-`void`
+Defined in: [src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L136)
-##### Inherited from
+Returns a size of a collection (i.e: length of an array containing its objects)
-`SelectableCanvas.setWidth`
+#### Returns
-##### Defined in
+`number`
-[src/canvas/StaticCanvas.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L294)
+Collection size
-#### setWidth(value, options)
+#### Inherited from
-> **setWidth**(`value`, `options`?): `void`
+`SelectableCanvas.size`
-##### Parameters
+***
-• **value**: `string` \| `number`
+### toBlob()
-• **options?**
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
-• **options.backstoreOnly?**: `false`
+Defined in: [src/canvas/StaticCanvas.ts:1336](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1336)
-• **options.cssOnly?**: `true`
+#### Parameters
-##### Returns
+##### options
-`void`
+[`TDataUrlOptions`](/api/type-aliases/tdataurloptions/) = `...`
-##### Inherited from
+#### Returns
-`SelectableCanvas.setWidth`
+`Promise`\<`null` \| `Blob`\>
-##### Defined in
+#### Inherited from
-[src/canvas/StaticCanvas.ts:298](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L298)
+`SelectableCanvas.toBlob`
***
-### setZoom()
+### toCanvasElement()
-> **setZoom**(`value`): `void`
+> **toCanvasElement**(`multiplier?`, `options?`): `HTMLCanvasElement`
-Sets zoom level of this canvas instance
+Defined in: [src/canvas/StaticCanvas.ts:1367](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1367)
+
+Create a new HTMLCanvas element painted with the current canvas content.
+No need to resize the actual one or repaint it.
+Will transfer object ownership to a new canvas, paint it, and set everything back.
+This is an intermediary step used to get to a dataUrl but also it is useful to
+create quick image copies of a canvas without passing for the dataUrl string
#### Parameters
-• **value**: `number`
+##### multiplier?
-to set zoom to, less than 1 zooms out
+`number` = `1`
+
+a zoom factor.
+
+##### options?
+
+[`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/) = `...`
+
+Cropping informations
#### Returns
-`void`
+`HTMLCanvasElement`
#### Inherited from
-`SelectableCanvas.setZoom`
+`SelectableCanvas.toCanvasElement`
-#### Defined in
+***
-[src/canvas/StaticCanvas.ts:423](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L423)
+### toDatalessJSON()
-***
+> **toDatalessJSON**(`propertiesToInclude?`): `any`
-### size()
+Defined in: [src/canvas/StaticCanvas.ts:764](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L764)
-> **size**(): `number`
+Returns dataless JSON representation of canvas
-Returns a size of a collection (i.e: length of an array containing its objects)
+#### Parameters
-#### Returns
+##### propertiesToInclude?
-`number`
+`string`[]
-Collection size
+Any properties that you might want to additionally include in the output
-#### Inherited from
+#### Returns
-`SelectableCanvas.size`
+`any`
+
+json string
-#### Defined in
+#### Inherited from
-[src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L136)
+`SelectableCanvas.toDatalessJSON`
***
-### toCanvasElement()
+### toDatalessObject()
-> **toCanvasElement**(`multiplier`?, `options`?): `HTMLCanvasElement`
+> **toDatalessObject**(`propertiesToInclude?`): `any`
-Create a new HTMLCanvas element painted with the current canvas content.
-No need to resize the actual one or repaint it.
-Will transfer object ownership to a new canvas, paint it, and set everything back.
-This is an intermediary step used to get to a dataUrl but also it is useful to
-create quick image copies of a canvas without passing for the dataUrl string
+Defined in: [src/canvas/StaticCanvas.ts:800](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L800)
-#### Parameters
+Returns dataless object representation of canvas
-• **multiplier?**: `number` = `1`
+#### Parameters
-a zoom factor.
+##### propertiesToInclude?
-• **options?**: [`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/) = `...`
+`string`[]
-Cropping informations
+Any properties that you might want to additionally include in the output
#### Returns
-`HTMLCanvasElement`
-
-#### Inherited from
+`any`
-`SelectableCanvas.toCanvasElement`
+object representation of an instance
-#### Defined in
+#### Inherited from
-[src/canvas/StaticCanvas.ts:1411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1411)
+`SelectableCanvas.toDatalessObject`
***
### toDataURL()
-> **toDataURL**(`options`?): `string`
+> **toDataURL**(`options?`): `string`
+
+Defined in: [src/canvas/StaticCanvas.ts:1320](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1320)
Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately
#### Parameters
-• **options?**: [`TDataUrlOptions`](/api/type-aliases/tdataurloptions/) = `...`
+##### options?
+
+[`TDataUrlOptions`](/api/type-aliases/tdataurloptions/) = `...`
Options object
@@ -4312,65 +3918,31 @@ var dataURL = canvas.toDataURL({
`SelectableCanvas.toDataURL`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1380](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1380)
-
***
-### toDatalessJSON()
-
-> **toDatalessJSON**(`propertiesToInclude`?): `any`
-
-Returns dataless JSON representation of canvas
-
-#### Parameters
-
-• **propertiesToInclude?**: `string`[]
-
-Any properties that you might want to additionally include in the output
-
-#### Returns
-
-`any`
-
-json string
-
-#### Inherited from
-
-`SelectableCanvas.toDatalessJSON`
-
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:817](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L817)
-
-***
+### toggle()
-### toDatalessObject()
+> **toggle**(`property`): `Canvas`
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
-Returns dataless object representation of canvas
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-object representation of an instance
+`Canvas`
#### Inherited from
-`SelectableCanvas.toDatalessObject`
-
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:854](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L854)
+`SelectableCanvas.toggle`
***
@@ -4378,10 +3950,13 @@ object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/canvas/StaticCanvas.ts:791](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L791)
+
Returns Object representation of canvas
this alias is provided because if you call JSON.stringify on an instance,
the toJSON object will be invoked if it exists.
Having a toJSON method means you can do JSON.stringify(myCanvas)
+JSON does not support additional properties because toJSON has its own signature
#### Returns
@@ -4389,47 +3964,40 @@ Having a toJSON method means you can do JSON.stringify(myCanvas)
JSON compatible object
-#### Tutorial
-
-[http://fabricjs.com/fabric-intro-part-3#serialization](http://fabricjs.com/fabric-intro-part-3#serialization)
-
#### See
-[demo](http://jsfiddle.net/fabricjs/pec86/|jsFiddle)
+ - [http://fabric5.fabricjs.com/fabric-intro-part-3#serialization](http://fabric5.fabricjs.com/fabric-intro-part-3#serialization)
+ - [demo](http://jsfiddle.net/fabricjs/pec86/|jsFiddle)
#### Examples
```ts
-var json = canvas.toJSON();
+const json = canvas.toJSON();
```
```ts
-var json = canvas.toJSON(['lockMovementX', 'lockMovementY', 'lockRotation', 'lockScalingX', 'lockScalingY']);
-```
-
-```ts
-var json = canvas.toJSON();
+const json = JSON.stringify(canvas);
```
#### Inherited from
`SelectableCanvas.toJSON`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:845](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L845)
-
***
### toObject()
-> **toObject**(`propertiesToInclude`?): `any`
+> **toObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/canvas/StaticCanvas.ts:773](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L773)
Returns object representation of canvas
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
@@ -4443,25 +4011,47 @@ object representation of an instance
`SelectableCanvas.toObject`
-#### Defined in
+***
+
+### toString()
+
+> **toString**(): `string`
+
+Defined in: [src/canvas/StaticCanvas.ts:1470](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L1470)
+
+Returns a string representation of an instance
+
+#### Returns
-[src/canvas/StaticCanvas.ts:826](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L826)
+`string`
+
+string representation of an instance
+
+#### Inherited from
+
+`SelectableCanvas.toString`
***
### toSVG()
-> **toSVG**(`options`?, `reviver`?): `string`
+> **toSVG**(`options?`, `reviver?`): `string`
+
+Defined in: [src/canvas/StaticCanvas.ts:938](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L938)
Returns SVG representation of canvas
#### Parameters
-• **options?**: [`TSVGExportOptions`](/api/type-aliases/tsvgexportoptions/) = `{}`
+##### options?
+
+[`TSVGExportOptions`](/api/type-aliases/tsvgexportoptions/) = `{}`
Options object for SVG output
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg elements, called after each fabric object converted into svg representation.
@@ -4471,15 +4061,10 @@ Method for further parsing of svg elements, called after each fabric object conv
SVG string
-#### Function
-
-#### Tutorial
-
-[http://fabricjs.com/fabric-intro-part-3#serialization](http://fabricjs.com/fabric-intro-part-3#serialization)
-
#### See
-[demo](http://jsfiddle.net/fabricjs/jQ3ZZ/|jsFiddle)
+ - [http://fabric5.fabricjs.com/fabric-intro-part-3#serialization](http://fabric5.fabricjs.com/fabric-intro-part-3#serialization)
+ - [demo](http://jsfiddle.net/fabricjs/jQ3ZZ/|jsFiddle)
#### Examples
@@ -4516,69 +4101,21 @@ var svg = canvas.toSVG(null, function(svg) {
`SelectableCanvas.toSVG`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:993](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L993)
-
-***
-
-### toString()
-
-> **toString**(): `string`
-
-Returns a string representation of an instance
-
-#### Returns
-
-`string`
-
-string representation of an instance
-
-#### Inherited from
-
-`SelectableCanvas.toString`
-
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:1514](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1514)
-
-***
-
-### toggle()
-
-> **toggle**(`property`): [`Canvas`](/api/classes/canvas/)
-
-Toggles specified property from `true` to `false` or from `false` to `true`
-
-#### Parameters
-
-• **property**: `string`
-
-Property to toggle
-
-#### Returns
-
-[`Canvas`](/api/classes/canvas/)
-
-#### Inherited from
-
-`SelectableCanvas.toggle`
-
-#### Defined in
-
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
-
***
### viewportCenterObject()
> **viewportCenterObject**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L711)
+
Centers object vertically and horizontally in the viewport
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to center vertically and horizontally
@@ -4590,21 +4127,21 @@ Object to center vertically and horizontally
`SelectableCanvas.viewportCenterObject`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:764](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L764)
-
***
### viewportCenterObjectH()
> **viewportCenterObjectH**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:719](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L719)
+
Centers object horizontally in the viewport, object.top is unchanged
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to center vertically and horizontally
@@ -4616,21 +4153,21 @@ Object to center vertically and horizontally
`SelectableCanvas.viewportCenterObjectH`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:772](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L772)
-
***
### viewportCenterObjectV()
> **viewportCenterObjectV**(`object`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:730](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L730)
+
Centers object Vertically in the viewport, object.top is unchanged
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to center vertically and horizontally
@@ -4642,16 +4179,14 @@ Object to center vertically and horizontally
`SelectableCanvas.viewportCenterObjectV`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:783](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L783)
-
***
### zoomToPoint()
> **zoomToPoint**(`point`, `value`): `void`
+Defined in: [src/canvas/StaticCanvas.ts:366](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L366)
+
Sets zoom level of this canvas instance, the zoom centered around point
meaning that following zoom to point with the same point will have the visual
effect of the zoom originating from that point. The point won't move.
@@ -4659,11 +4194,15 @@ It has nothing to do with canvas center or visual center of the viewport.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
to zoom with respect to
-• **value**: `number`
+##### value
+
+`number`
to set zoom to, less than 1 zooms out
@@ -4675,16 +4214,14 @@ to set zoom to, less than 1 zooms out
`SelectableCanvas.zoomToPoint`
-#### Defined in
-
-[src/canvas/StaticCanvas.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L406)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/canvas/SelectableCanvas.ts:306](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/SelectableCanvas.ts#L306)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -4692,7 +4229,3 @@ to set zoom to, less than 1 zooms out
#### Inherited from
`SelectableCanvas.getDefaults`
-
-#### Defined in
-
-[src/canvas/SelectableCanvas.ts:290](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/SelectableCanvas.ts#L290)
diff --git a/src/content/docs/api/classes/Canvas2dFilterBackend.md b/src/content/docs/api/classes/Canvas2dFilterBackend.md
index e4abed1eb..7b556f126 100644
--- a/src/content/docs/api/classes/Canvas2dFilterBackend.md
+++ b/src/content/docs/api/classes/Canvas2dFilterBackend.md
@@ -5,15 +5,17 @@ prev: false
title: "Canvas2dFilterBackend"
---
+Defined in: [src/filters/Canvas2dFilterBackend.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Canvas2dFilterBackend.ts#L7)
+
## Constructors
-### new Canvas2dFilterBackend()
+### Constructor
-> **new Canvas2dFilterBackend**(): [`Canvas2dFilterBackend`](/api/classes/canvas2dfilterbackend/)
+> **new Canvas2dFilterBackend**(): `Canvas2dFilterBackend`
#### Returns
-[`Canvas2dFilterBackend`](/api/classes/canvas2dfilterbackend/)
+`Canvas2dFilterBackend`
## Properties
@@ -21,51 +23,57 @@ title: "Canvas2dFilterBackend"
> **resources**: [`TPipelineResources`](/api/type-aliases/tpipelineresources/) = `{}`
+Defined in: [src/filters/Canvas2dFilterBackend.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Canvas2dFilterBackend.ts#L15)
+
Experimental. This object is a sort of repository of help layers used to avoid
of recreating them during frequent filtering. If you are previewing a filter with
a slider you probably do not want to create help layers every filter step.
in this object there will be appended some canvases, created once, resized sometimes
cleared never. Clearing is left to the developer.
-#### Defined in
-
-[src/filters/Canvas2dFilterBackend.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Canvas2dFilterBackend.ts#L15)
-
## Methods
### applyFilters()
> **applyFilters**(`filters`, `sourceElement`, `sourceWidth`, `sourceHeight`, `targetCanvas`): `void` \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/)
+Defined in: [src/filters/Canvas2dFilterBackend.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Canvas2dFilterBackend.ts#L27)
+
Apply a set of filters against a source image and draw the filtered output
to the provided destination canvas.
#### Parameters
-• **filters**: [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>\>[]
+##### filters
+
+[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>, `Record`\<`string`, `any`\>\>[]
The filter to apply.
-• **sourceElement**: `CanvasImageSource`
+##### sourceElement
+
+`CanvasImageSource`
The source to be filtered.
-• **sourceWidth**: `number`
+##### sourceWidth
+
+`number`
The width of the source input.
-• **sourceHeight**: `number`
+##### sourceHeight
+
+`number`
The height of the source input.
-• **targetCanvas**: `HTMLCanvasElement`
+##### targetCanvas
+
+`HTMLCanvasElement`
The destination for filtered output to be drawn.
#### Returns
`void` \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/)
-
-#### Defined in
-
-[src/filters/Canvas2dFilterBackend.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Canvas2dFilterBackend.ts#L27)
diff --git a/src/content/docs/api/classes/CanvasDOMManager.md b/src/content/docs/api/classes/CanvasDOMManager.md
index 92da18579..65264c1f8 100644
--- a/src/content/docs/api/classes/CanvasDOMManager.md
+++ b/src/content/docs/api/classes/CanvasDOMManager.md
@@ -5,25 +5,35 @@ prev: false
title: "CanvasDOMManager"
---
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L12)
+
## Extends
- [`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/)
## Constructors
-### new CanvasDOMManager()
+### Constructor
+
+> **new CanvasDOMManager**(`arg0?`, `__namedParameters?`): `CanvasDOMManager`
-> **new CanvasDOMManager**(`arg0`?, `__namedParameters`?): [`CanvasDOMManager`](/api/classes/canvasdommanager/)
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L16)
#### Parameters
-• **arg0?**: `string` \| `HTMLCanvasElement`
+##### arg0?
+
+`string` | `HTMLCanvasElement`
+
+##### \_\_namedParameters?
-• **\_\_namedParameters?** = `{}`
+###### allowTouchScrolling?
-• **\_\_namedParameters.allowTouchScrolling?**: `boolean` = `false`
+`boolean` = `false`
-• **\_\_namedParameters.containerClass?**: `string` = `''`
+###### containerClass?
+
+`string` = `''`
:::caution[Deprecated]
here only for backward compatibility
@@ -31,15 +41,11 @@ here only for backward compatibility
#### Returns
-[`CanvasDOMManager`](/api/classes/canvasdommanager/)
+`CanvasDOMManager`
#### Overrides
-[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`constructor`](/api/classes/staticcanvasdommanager/#constructors)
-
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L15)
+[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`constructor`](/api/classes/staticcanvasdommanager/#constructor)
## Properties
@@ -47,9 +53,7 @@ here only for backward compatibility
> **container**: `HTMLDivElement`
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L13)
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L14)
***
@@ -57,23 +61,19 @@ here only for backward compatibility
> **lower**: `CanvasItem`
+Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L22)
+
#### Inherited from
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`lower`](/api/classes/staticcanvasdommanager/#lower)
-#### Defined in
-
-[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L22)
-
***
### upper
> **upper**: `CanvasItem`
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L12)
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L13)
## Methods
@@ -81,6 +81,8 @@ here only for backward compatibility
> **calcOffset**(): `object`
+Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L71)
+
Calculates canvas element offset relative to the document
#### Returns
@@ -99,19 +101,19 @@ Calculates canvas element offset relative to the document
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`calcOffset`](/api/classes/staticcanvasdommanager/#calcoffset)
-#### Defined in
-
-[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L71)
-
***
### cleanupDOM()
> **cleanupDOM**(`size`): `void`
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L109)
+
#### Parameters
-• **size**: [`TSize`](/api/type-aliases/tsize/)
+##### size
+
+[`TSize`](/api/type-aliases/tsize/)
#### Returns
@@ -121,16 +123,14 @@ Calculates canvas element offset relative to the document
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`cleanupDOM`](/api/classes/staticcanvasdommanager/#cleanupdom)
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L108)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L121)
+
#### Returns
`void`
@@ -139,19 +139,19 @@ Calculates canvas element offset relative to the document
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`dispose`](/api/classes/staticcanvasdommanager/#dispose)
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L120)
-
***
### setCSSDimensions()
> **setCSSDimensions**(`size`): `void`
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L103)
+
#### Parameters
-• **size**: `Partial`\<`CSSDimensions`\>
+##### size
+
+`Partial`\<`CSSDimensions`\>
#### Returns
@@ -161,21 +161,23 @@ Calculates canvas element offset relative to the document
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`setCSSDimensions`](/api/classes/staticcanvasdommanager/#setcssdimensions)
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L102)
-
***
### setDimensions()
> **setDimensions**(`size`, `retinaScaling`): `void`
+Defined in: [src/canvas/DOMManagers/CanvasDOMManager.ts:97](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/CanvasDOMManager.ts#L97)
+
#### Parameters
-• **size**: [`TSize`](/api/type-aliases/tsize/)
+##### size
+
+[`TSize`](/api/type-aliases/tsize/)
-• **retinaScaling**: `number`
+##### retinaScaling
+
+`number`
#### Returns
@@ -184,7 +186,3 @@ Calculates canvas element offset relative to the document
#### Overrides
[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/).[`setDimensions`](/api/classes/staticcanvasdommanager/#setdimensions)
-
-#### Defined in
-
-[src/canvas/DOMManagers/CanvasDOMManager.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/CanvasDOMManager.ts#L96)
diff --git a/src/content/docs/api/classes/Circle.md b/src/content/docs/api/classes/Circle.md
index f7d0bf76b..4cad556f0 100644
--- a/src/content/docs/api/classes/Circle.md
+++ b/src/content/docs/api/classes/Circle.md
@@ -5,87 +5,9 @@ prev: false
title: "Circle"
---
-Root object class from which all 2d shape classes inherit from
+Defined in: [src/shapes/Circle.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L65)
-## Tutorial
-
-[http://fabricjs.com/fabric-intro-part-1#objects](http://fabricjs.com/fabric-intro-part-1#objects)
-
-## Fires
-
-added
-
-## Fires
-
-removed
-
-## Fires
-
-selected
-
-## Fires
-
-deselected
-
-## Fires
-
-rotating
-
-## Fires
-
-scaling
-
-## Fires
-
-moving
-
-## Fires
-
-skewing
-
-## Fires
-
-modified
-
-## Fires
-
-mousedown
-
-## Fires
-
-mouseup
-
-## Fires
-
-mouseover
-
-## Fires
-
-mouseout
-
-## Fires
-
-mousewheel
-
-## Fires
-
-mousedblclick
-
-## Fires
-
-dragover
-
-## Fires
-
-dragenter
-
-## Fires
-
-dragleave
-
-## Fires
-
-drop
+Exported so we can tweak default values
## Extends
@@ -93,11 +15,17 @@ drop
## Type Parameters
-• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`CircleProps`](/api/interfaces/circleprops/)\> = `Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>
+### Props
+
+`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`CircleProps`](/api/interfaces/circleprops/)\> = `Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>
-• **SProps** *extends* [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/) = [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/)
+### SProps
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`SProps` *extends* [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/) = [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/)
+
+### EventSpec
+
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Implements
@@ -105,29 +33,29 @@ drop
## Constructors
-### new Circle()
+### Constructor
-> **new Circle**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+> **new Circle**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `Circle`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Circle.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L95)
Constructor
#### Parameters
-• **options?**: `Props`
+##### options?
+
+`Props`
Options object
#### Returns
-[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+`Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
-[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors)
-
-#### Defined in
-
-[src/shapes/Circle.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L95)
+[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor)
## Properties
@@ -135,6 +63,8 @@ Options object
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -145,16 +75,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values
[`FabricObject`](/api/classes/fabricobject/).[`__corner`](/api/classes/fabricobject/#__corner)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_controlsVisibility
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -163,16 +91,14 @@ this takes priority over the generic control visibility
[`FabricObject`](/api/classes/fabricobject/).[`_controlsVisibility`](/api/classes/fabricobject/#_controlsvisibility)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_scaling?
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -187,37 +113,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
[`FabricObject`](/api/classes/fabricobject/).[`_scaling`](/api/classes/fabricobject/#_scaling)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/circle/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/circle/#calcacoords)
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
***
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -235,9 +138,24 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`absolutePositioned`](/api/classes/fabricobject/#absolutepositioned)
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/circle/#setcoords).
+You can calculate them without updating with [()](/api/classes/circle/#calcacoords)
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
***
@@ -245,6 +163,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -257,39 +177,29 @@ Angle of rotation of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`angle`](/api/classes/fabricobject/#angle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`backgroundColor`](/api/classes/fabricobject/#backgroundcolor)
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -302,16 +212,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`borderColor`](/api/classes/fabricobject/#bordercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -322,16 +230,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
[`FabricObject`](/api/classes/fabricobject/).[`borderDashArray`](/api/classes/fabricobject/#borderdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -344,20 +250,19 @@ Opacity of object's controlling borders when object is active and moving
[`FabricObject`](/api/classes/fabricobject/).[`borderOpacityWhenMoving`](/api/classes/fabricobject/#borderopacitywhenmoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -369,16 +274,14 @@ since there is no way to change the border itself.
[`FabricObject`](/api/classes/fabricobject/).[`borderScaleFactor`](/api/classes/fabricobject/#borderscalefactor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -389,26 +292,18 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`centeredRotation`](/api/classes/fabricobject/#centeredrotation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -416,26 +311,18 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`centeredScaling`](/api/classes/fabricobject/#centeredscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -445,16 +332,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
[`FabricObject`](/api/classes/fabricobject/).[`clipPath`](/api/classes/fabricobject/#clippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -462,16 +347,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
[`FabricObject`](/api/classes/fabricobject/).[`clipPathId`](/api/classes/fabricobject/#clippathid)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -479,16 +362,14 @@ controls are added by default_controls.js
[`FabricObject`](/api/classes/fabricobject/).[`controls`](/api/classes/fabricobject/#controls)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -501,16 +382,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`cornerColor`](/api/classes/fabricobject/#cornercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -527,16 +406,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`cornerDashArray`](/api/classes/fabricobject/#cornerdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -549,16 +426,14 @@ Size of object's controlling corners (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`cornerSize`](/api/classes/fabricobject/#cornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -575,20 +450,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
[`FabricObject`](/api/classes/fabricobject/).[`cornerStrokeColor`](/api/classes/fabricobject/#cornerstrokecolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -599,24 +476,18 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`cornerStyle`](/api/classes/fabricobject/#cornerstyle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### counterClockwise
> **counterClockwise**: `boolean`
+Defined in: [src/shapes/Circle.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L76)
+
Orientation for the direction of the circle.
Setting to true will switch the arc of the circle to traverse from startAngle to endAngle in a counter-clockwise direction.
Note: this will only change how the circle is drawn, and does not affect rotational transformation.
@@ -631,16 +502,14 @@ false
`UniqueCircleProps.counterClockwise`
-#### Defined in
-
-[src/shapes/Circle.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L76)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -654,16 +523,14 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`dirty`](/api/classes/fabricobject/#dirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### endAngle
> **endAngle**: `number`
+Defined in: [src/shapes/Circle.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L75)
+
Angle for the end of the circle, in degrees
#### Default
@@ -676,64 +543,46 @@ Angle for the end of the circle, in degrees
`UniqueCircleProps.endAngle`
-#### Defined in
-
-[src/shapes/Circle.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L75)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`evented`](/api/classes/fabricobject/#evented)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`excludeFromExport`](/api/classes/fabricobject/#excludefromexport)
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -747,16 +596,14 @@ rgb(0,0,0)
[`FabricObject`](/api/classes/fabricobject/).[`fill`](/api/classes/fabricobject/#fill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -771,16 +618,14 @@ nonzero
[`FabricObject`](/api/classes/fabricobject/).[`fillRule`](/api/classes/fabricobject/#fillrule)
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -793,16 +638,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipX`](/api/classes/fabricobject/#flipx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -815,60 +658,42 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipY`](/api/classes/fabricobject/#flipy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`globalCompositeOperation`](/api/classes/fabricobject/#globalcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`hasBorders`](/api/classes/fabricobject/#hasborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -881,38 +706,28 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`hasControls`](/api/classes/fabricobject/#hascontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`height`](/api/classes/fabricobject/#height)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -925,38 +740,28 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`hoverCursor`](/api/classes/fabricobject/#hovercursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`includeDefaultValues`](/api/classes/fabricobject/#includedefaultvalues)
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -971,16 +776,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`inverted`](/api/classes/fabricobject/#inverted)
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -988,19 +791,17 @@ part of the move action.
[`FabricObject`](/api/classes/fabricobject/).[`isMoving`](/api/classes/fabricobject/#ismoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -1012,31 +813,19 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`left`](/api/classes/fabricobject/#left)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
+
When `true`, object horizontal movement is locked
-#### Default
+#### Inherited from
-```ts
-
-```
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`lockMovementX`](/api/classes/fabricobject/#lockmovementx)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
+[`FabricObject`](/api/classes/fabricobject/).[`lockMovementX`](/api/classes/fabricobject/#lockmovementx)
***
@@ -1044,176 +833,120 @@ When `true`, object horizontal movement is locked
> **lockMovementY**: `boolean`
-When `true`, object vertical movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
-```
+When `true`, object vertical movement is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockMovementY`](/api/classes/fabricobject/#lockmovementy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockRotation`](/api/classes/fabricobject/#lockrotation)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingFlip`](/api/classes/fabricobject/#lockscalingflip)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingX`](/api/classes/fabricobject/#lockscalingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingY`](/api/classes/fabricobject/#lockscalingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingX`](/api/classes/fabricobject/#lockskewingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingY`](/api/classes/fabricobject/#lockskewingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`matrixCache`](/api/classes/fabricobject/#matrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
-
***
### minScaleLimit
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1226,16 +959,14 @@ Minimum allowed scale value of an object
[`FabricObject`](/api/classes/fabricobject/).[`minScaleLimit`](/api/classes/fabricobject/#minscalelimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1248,16 +979,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`moveCursor`](/api/classes/fabricobject/#movecursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1274,35 +1003,14 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`noScaleCache`](/api/classes/fabricobject/#noscalecache)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1321,9 +1029,22 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`objectCaching`](/api/classes/fabricobject/#objectcaching)
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
+
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
***
@@ -1331,6 +1052,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1343,16 +1066,14 @@ Opacity of an object
[`FabricObject`](/api/classes/fabricobject/).[`opacity`](/api/classes/fabricobject/#opacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1361,16 +1082,14 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originX`](/api/classes/fabricobject/#originx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1379,32 +1098,28 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originY`](/api/classes/fabricobject/#originy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`ownMatrixCache`](/api/classes/fabricobject/#ownmatrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1417,38 +1132,28 @@ Padding between object and its controlling borders (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`padding`](/api/classes/fabricobject/#padding)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`paintFirst`](/api/classes/fabricobject/#paintfirst)
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1456,38 +1161,28 @@ Used to keep the original parent ref when the object has been added to an Active
[`FabricObject`](/api/classes/fabricobject/).[`parent`](/api/classes/fabricobject/#parent)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`perPixelTargetFind`](/api/classes/fabricobject/#perpixeltargetfind)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### radius
> **radius**: `number`
+Defined in: [src/shapes/Circle.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L73)
+
Radius of this circle
#### Default
@@ -1500,16 +1195,14 @@ Radius of this circle
`UniqueCircleProps.radius`
-#### Defined in
-
-[src/shapes/Circle.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L73)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1522,16 +1215,14 @@ Object scale factor (horizontal)
[`FabricObject`](/api/classes/fabricobject/).[`scaleX`](/api/classes/fabricobject/#scalex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1544,48 +1235,32 @@ Object scale factor (vertical)
[`FabricObject`](/api/classes/fabricobject/).[`scaleY`](/api/classes/fabricobject/#scaley)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`selectable`](/api/classes/fabricobject/#selectable)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1594,16 +1269,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`selectionBackgroundColor`](/api/classes/fabricobject/#selectionbackgroundcolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1616,16 +1289,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`shadow`](/api/classes/fabricobject/#shadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1638,16 +1309,14 @@ Angle of skew on x axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewX`](/api/classes/fabricobject/#skewx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1660,32 +1329,28 @@ Angle of skew on y axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewY`](/api/classes/fabricobject/#skewy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`snapAngle`](/api/classes/fabricobject/#snapangle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1693,16 +1358,14 @@ When undefined, the snapThreshold will default to the snapAngle.
[`FabricObject`](/api/classes/fabricobject/).[`snapThreshold`](/api/classes/fabricobject/#snapthreshold)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### startAngle
> **startAngle**: `number`
+Defined in: [src/shapes/Circle.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L74)
+
Angle for the start of the circle, in degrees.
#### Default
@@ -1715,16 +1378,14 @@ Angle for the start of the circle, in degrees.
`UniqueCircleProps.startAngle`
-#### Defined in
-
-[src/shapes/Circle.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L74)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -1738,16 +1399,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`stroke`](/api/classes/fabricobject/#stroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -1760,16 +1419,14 @@ null;
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashArray`](/api/classes/fabricobject/#strokedasharray)
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -1782,16 +1439,14 @@ Line offset of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashOffset`](/api/classes/fabricobject/#strokedashoffset)
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -1804,38 +1459,28 @@ butt
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineCap`](/api/classes/fabricobject/#strokelinecap)
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineJoin`](/api/classes/fabricobject/#strokelinejoin)
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -1848,16 +1493,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeMiterLimit`](/api/classes/fabricobject/#strokemiterlimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -1883,16 +1526,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`strokeUniform`](/api/classes/fabricobject/#strokeuniform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -1905,19 +1546,17 @@ Width of a stroke used to render this object
[`FabricObject`](/api/classes/fabricobject/).[`strokeWidth`](/api/classes/fabricobject/#strokewidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -1929,16 +1568,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`top`](/api/classes/fabricobject/#top)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -1951,16 +1588,14 @@ Size of object's controlling corners when touch interaction is detected
[`FabricObject`](/api/classes/fabricobject/).[`touchCornerSize`](/api/classes/fabricobject/#touchcornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -1973,79 +1608,53 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`transparentCorners`](/api/classes/fabricobject/#transparentcorners)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### visible
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`visible`](/api/classes/fabricobject/#visible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`width`](/api/classes/fabricobject/#width)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
-
***
### ATTRIBUTE\_NAMES
> `static` **ATTRIBUTE\_NAMES**: `string`[]
-List of attribute names to account for when parsing SVG element (used by [Circle.fromElement](../../../../api/classes/circle/#fromelement))
-
-#### Static
+Defined in: [src/shapes/Circle.ts:212](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L212)
-#### Member Of
-
-Circle
+List of attribute names to account for when parsing SVG element (used by [Circle.fromElement](/api/classes/circle/#fromelement))
@see: http://www.w3.org/TR/SVG/shapes.html#CircleElement
-#### Defined in
-
-[src/shapes/Circle.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L214)
-
***
### cacheProperties
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Circle.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L80)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -2055,32 +1664,28 @@ and refreshed at the next render
[`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties)
-#### Defined in
-
-[src/shapes/Circle.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L80)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`colorProperties`](/api/classes/fabricobject/#colorproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -2088,30 +1693,26 @@ instance.toObject() gets called
[`FabricObject`](/api/classes/fabricobject/).[`customProperties`](/api/classes/fabricobject/#customproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
-> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Circle`](/api/classes/circle/)\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `circleDefaultValues`
+> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Circle`\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `circleDefaultValues`
+
+Defined in: [src/shapes/Circle.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L82)
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults)
-#### Defined in
-
-[src/shapes/Circle.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L82)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2120,16 +1721,14 @@ needs its cache regenerated during a .set call
[`FabricObject`](/api/classes/fabricobject/).[`stateProperties`](/api/classes/fabricobject/#stateproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'Circle'`
+Defined in: [src/shapes/Circle.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L78)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -2143,22 +1742,22 @@ We do not do that in fabricJS code because we want to try to have code splitting
[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type)
-#### Defined in
-
-[src/shapes/Circle.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L78)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2166,23 +1765,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type-1)
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type-1)
## Methods
@@ -2190,15 +1795,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
-• **context**: `DrawContext`
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2208,51 +1821,44 @@ Prepare clipPath state and cache and draw it on instance's cache
[`FabricObject`](/api/classes/fabricobject/).[`_drawClipPath`](/api/classes/fabricobject/#_drawclippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`_limitCacheSize`](/api/classes/fabricobject/#_limitcachesize)
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2263,26 +1869,28 @@ Remove cacheCanvas and its dimensions from the objects
[`FabricObject`](/api/classes/fabricobject/).[`_removeCacheCanvas`](/api/classes/fabricobject/#_removecachecanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2298,19 +1906,19 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_renderControls`](/api/classes/fabricobject/#_rendercontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2320,21 +1928,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setClippingProperties`](/api/classes/fabricobject/#_setclippingproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **\_\_namedParameters**: `Pick`\<[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+##### \_\_namedParameters
+
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2344,21 +1954,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setFillStyles`](/api/classes/fabricobject/#_setfillstyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### decl
-• **decl**: `Pick`\<[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2368,22 +1980,22 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setStrokeStyles`](/api/classes/fabricobject/#_setstrokestyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2395,16 +2007,14 @@ Rendering canvas context
[`FabricObject`](/api/classes/fabricobject/).[`_setupCompositeOperation`](/api/classes/fabricobject/#_setupcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_toSVG()
> **\_toSVG**(): `string`[]
+Defined in: [src/shapes/Circle.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L176)
+
Returns svg representation of an instance
#### Returns
@@ -2418,19 +2028,19 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg)
-#### Defined in
-
-[src/shapes/Circle.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L176)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2440,33 +2050,37 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`addPaintOrder`](/api/classes/fabricobject/#addpaintorder)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2475,24 +2089,22 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`animate`](/api/classes/fabricobject/#animate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -2504,16 +2116,14 @@ those never change with zoom or viewport changes.
[`FabricObject`](/api/classes/fabricobject/).[`calcACoords`](/api/classes/fabricobject/#calcacoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -2527,16 +2137,14 @@ is a public api and should be done just if extremely necessary
[`FabricObject`](/api/classes/fabricobject/).[`calcOCoords`](/api/classes/fabricobject/#calcocoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -2550,22 +2158,22 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcOwnMatrix`](/api/classes/fabricobject/#calcownmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -2580,21 +2188,21 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcTransformMatrix`](/api/classes/fabricobject/#calctransformmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -2606,15 +2214,13 @@ true if the object currently dragged can be dropped on the target
[`FabricObject`](/api/classes/fabricobject/).[`canDrop`](/api/classes/fabricobject/#candrop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -2623,7 +2229,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -2642,41 +2250,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
[`FabricObject`](/api/classes/fabricobject/).[`clearContextTop`](/api/classes/fabricobject/#clearcontexttop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`Circle`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>\>
+`Promise`\<`Circle`\<`Props`, `SProps`, `EventSpec`\>\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`clone`](/api/classes/fabricobject/#clone)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -2687,13 +2293,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -2705,16 +2313,14 @@ fix the export type, it could not be Image but the type that getClass return for
[`FabricObject`](/api/classes/fabricobject/).[`cloneAsImage`](/api/classes/fabricobject/#cloneasimage)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:1426](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1426)
+
Returns complexity of an instance
#### Returns
@@ -2727,21 +2333,21 @@ complexity of this instance (is 1 unless subclassed)
[`FabricObject`](/api/classes/fabricobject/).[`complexity`](/api/classes/fabricobject/#complexity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1460](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1460)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -2755,16 +2361,14 @@ true if point is inside the object
[`FabricObject`](/api/classes/fabricobject/).[`containsPoint`](/api/classes/fabricobject/#containspoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1494)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -2776,15 +2380,13 @@ override if necessary to dispose artifacts such as `clipPath`
[`FabricObject`](/api/classes/fabricobject/).[`dispose`](/api/classes/fabricobject/#dispose)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1528)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -2792,15 +2394,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -2812,23 +2420,25 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawBorders`](/api/classes/fabricobject/#drawborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **ctx**: `CanvasRenderingContext2D`
+`TCachedFabricObject`
+
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -2840,27 +2450,31 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawCacheOnCanvas`](/api/classes/fabricobject/#drawcacheoncanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
+
+[`BaseFabricObject`](/api/classes/basefabricobject/)
+
+##### canvasWithClipPath
-• **canvasWithClipPath**: `HTMLCanvasElement`
+`HTMLCanvasElement`
#### Returns
@@ -2870,16 +2484,14 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawClipPathOnCache`](/api/classes/fabricobject/#drawclippathoncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -2889,11 +2501,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -2905,27 +2521,29 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawControls`](/api/classes/fabricobject/#drawcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -2937,29 +2555,33 @@ object size x = width, y = height
[`FabricObject`](/api/classes/fabricobject/).[`drawControlsConnectingLines`](/api/classes/fabricobject/#drawcontrolsconnectinglines)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -2971,16 +2593,14 @@ additional context for rendering
[`FabricObject`](/api/classes/fabricobject/).[`drawObject`](/api/classes/fabricobject/#drawobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -2988,7 +2608,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -3006,25 +2628,27 @@ it seemed a good option, now is an edge case
[`FabricObject`](/api/classes/fabricobject/).[`drawSelectionBackground`](/api/classes/fabricobject/#drawselectionbackground)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3036,29 +2660,33 @@ an object that represent the ancestry situation.
[`FabricObject`](/api/classes/fabricobject/).[`findCommonAncestors`](/api/classes/fabricobject/#findcommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -3070,22 +2698,22 @@ Options object
[`FabricObject`](/api/classes/fabricobject/).[`fire`](/api/classes/fabricobject/#fire)
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3097,21 +2725,21 @@ function to iterate over the controls over
[`FabricObject`](/api/classes/fabricobject/).[`forEachControl`](/api/classes/fabricobject/#foreachcontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3125,34 +2753,30 @@ value of a property
[`FabricObject`](/api/classes/fabricobject/).[`get`](/api/classes/fabricobject/#get)
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getActiveControl`](/api/classes/fabricobject/#getactivecontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3163,16 +2787,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
[`FabricObject`](/api/classes/fabricobject/).[`getAncestors`](/api/classes/fabricobject/#getancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3186,16 +2808,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getBoundingRect`](/api/classes/fabricobject/#getboundingrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3204,16 +2824,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getCanvasRetinaScaling`](/api/classes/fabricobject/#getcanvasretinascaling)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3224,16 +2842,14 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCenterPoint`](/api/classes/fabricobject/#getcenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -3244,16 +2860,14 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCoords`](/api/classes/fabricobject/#getcoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -3264,16 +2878,14 @@ Return the object opacity counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getObjectOpacity`](/api/classes/fabricobject/#getobjectopacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
@@ -3284,16 +2896,14 @@ Return the object scale factor counting also the group scaling
[`FabricObject`](/api/classes/fabricobject/).[`getObjectScaling`](/api/classes/fabricobject/#getobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -3303,11 +2913,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3319,48 +2933,42 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`getPointByOrigin`](/api/classes/fabricobject/#getpointbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRadiusX()
> **getRadiusX**(): `number`
+Defined in: [src/shapes/Circle.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L137)
+
Returns horizontal radius of an object (according to how an object is scaled)
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Circle.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L137)
-
***
### getRadiusY()
> **getRadiusY**(): `number`
+Defined in: [src/shapes/Circle.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L145)
+
Returns vertical radius of an object (according to how an object is scaled)
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Circle.ts:145](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L145)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -3371,78 +2979,70 @@ Returns the center coordinates of the object relative to it's parent
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeCenterPoint`](/api/classes/fabricobject/#getrelativecenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/circle/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/circle/#getx)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeX`](/api/classes/fabricobject/#getrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeXY`](/api/classes/fabricobject/#getrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/circle/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/circle/#gety)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeY`](/api/classes/fabricobject/#getrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -3459,16 +3059,14 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledHeight`](/api/classes/fabricobject/#getscaledheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -3485,21 +3083,21 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledWidth`](/api/classes/fabricobject/#getscaledwidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -3509,21 +3107,21 @@ Returns id attribute for svg output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgCommons`](/api/classes/fabricobject/#getsvgcommons)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3533,23 +3131,25 @@ Returns filter for svg shadow
[`FabricObject`](/api/classes/fabricobject/).[`getSvgFilter`](/api/classes/fabricobject/#getsvgfilter)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### getSvgStyles()
-> **getSvgStyles**(`this`, `skipShadow`?): `string`
+> **getSvgStyles**(`this`, `skipShadow?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L22)
Returns styles-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### skipShadow?
-• **skipShadow?**: `boolean`
+`boolean`
a boolean to skip shadow filter output
@@ -3561,25 +3161,29 @@ a boolean to skip shadow filter output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgStyles`](/api/classes/fabricobject/#getsvgstyles)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L21)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
-• **full?**: `boolean`
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **additionalTransform?**: `string` = `''`
+##### full?
+
+`boolean`
+
+##### additionalTransform?
+
+`string` = `''`
#### Returns
@@ -3589,16 +3193,14 @@ Returns transform-string for svg-export
[`FabricObject`](/api/classes/fabricobject/).[`getSvgTransform`](/api/classes/fabricobject/#getsvgtransform)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -3609,16 +3211,14 @@ Returns the object angle relative to canvas counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getTotalAngle`](/api/classes/fabricobject/#gettotalangle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -3631,16 +3231,14 @@ object with scaleX and scaleY properties
[`FabricObject`](/api/classes/fabricobject/).[`getTotalObjectScaling`](/api/classes/fabricobject/#gettotalobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -3651,83 +3249,79 @@ Retrieves viewportTransform from Object's canvas if available
[`FabricObject`](/api/classes/fabricobject/).[`getViewportTransform`](/api/classes/fabricobject/#getviewporttransform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getX`](/api/classes/fabricobject/#getx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getXY`](/api/classes/fabricobject/#getxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getY`](/api/classes/fabricobject/#gety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3737,15 +3331,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy
[`FabricObject`](/api/classes/fabricobject/).[`hasCommonAncestors`](/api/classes/fabricobject/#hascommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3756,7 +3348,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -3768,15 +3360,13 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasFill`](/api/classes/fabricobject/#hasfill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3787,7 +3377,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -3799,21 +3389,21 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasStroke`](/api/classes/fabricobject/#hasstroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -3827,23 +3417,25 @@ true if object intersects with another object
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithObject`](/api/classes/fabricobject/#intersectswithobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -3853,21 +3445,24 @@ Checks if object intersects with the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithRect`](/api/classes/fabricobject/#intersectswithrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -3880,21 +3475,21 @@ on parent canvas.
[`FabricObject`](/api/classes/fabricobject/).[`isCacheDirty`](/api/classes/fabricobject/#iscachedirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -3908,23 +3503,25 @@ true if object is fully contained within area of another object
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinObject`](/api/classes/fabricobject/#iscontainedwithinobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -3934,21 +3531,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinRect`](/api/classes/fabricobject/#iscontainedwithinrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -3963,22 +3560,22 @@ true if the specified control is visible, false otherwise
[`FabricObject`](/api/classes/fabricobject/).[`isControlVisible`](/api/classes/fabricobject/#iscontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -3988,23 +3585,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
[`FabricObject`](/api/classes/fabricobject/).[`isDescendantOf`](/api/classes/fabricobject/#isdescendantof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -4018,16 +3617,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isInFrontOf`](/api/classes/fabricobject/#isinfrontof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -4036,16 +3635,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isNotVisible`](/api/classes/fabricobject/#isnotvisible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -4059,23 +3656,25 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOnScreen`](/api/classes/fabricobject/#isonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4085,16 +3684,14 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOverlapping`](/api/classes/fabricobject/#isoverlapping)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -4107,41 +3704,51 @@ true if object is partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isPartiallyOnScreen`](/api/classes/fabricobject/#ispartiallyonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`isType`](/api/classes/fabricobject/#istype)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -4157,18 +3764,16 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`needsItsOwnCache`](/api/classes/fabricobject/#needsitsowncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -4179,11 +3784,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -4195,27 +3804,31 @@ event name (eg. 'after:render')
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -4227,19 +3840,19 @@ event listener to unsubscribe
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -4251,14 +3864,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -4269,33 +3880,39 @@ unsubscribe all event listeners
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
-• **E**
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -4313,106 +3930,140 @@ on
[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
+disposer
+
+##### Alias
+
+on
+
##### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
-##### Defined in
+***
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+### once()
-***
+#### Call Signature
-### onDeselect()
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-> **onDeselect**(`_options`?): `boolean`
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to deselect this object. If the function returns true, the process is cancelled
+Observes specified event **once**
-#### Parameters
+##### Type Parameters
-• **\_options?**
+###### K
-options sent from the upper functions
+`K` *extends* `string` \| `number` \| `symbol`
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### E
-• **\_options.object?**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`E`
-#### Returns
+##### Parameters
-`boolean`
+###### eventName
-#### Inherited from
+`K`
-[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect)
+Event name (eg. 'after:render')
-#### Defined in
+###### handler
-[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658)
+`TEventCallback`\<`E`\>
-***
+Function that receives a notification when an event of the specified type occurs
-### onDragStart()
+##### Returns
-> **onDragStart**(`_e`): `boolean`
+`VoidFunction`
-Override to customize Drag behavior\
-Fired once a drag session has started
+disposer
-#### Parameters
+##### Alias
-• **\_e**: `DragEvent`
+once
-#### Returns
+##### Inherited from
-`boolean`
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
-true to handle the drag event
+#### Call Signature
-#### Inherited from
+> **once**(`handlers`): `VoidFunction`
-[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart)
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
+
+Observes specified event **once**
+
+##### Parameters
+
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
-#### Defined in
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
+##### Returns
+
+`VoidFunction`
+
+disposer
+
+##### Alias
+
+once
+
+##### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
***
-### onSelect()
+### onDeselect()
-> **onSelect**(`_options`?): `boolean`
+> **onDeselect**(`_options?`): `boolean`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658)
This callback function is called every time _discardActiveObject or _setActiveObject
-try to to select this object. If the function returns true, the process is cancelled
+try to to deselect this object. If the function returns true, the process is cancelled
#### Parameters
-• **\_options?**
+##### \_options?
options sent from the upper functions
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### e?
-event if the process is generated by an event
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+###### object?
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -4420,75 +4071,65 @@ event if the process is generated by an event
#### Inherited from
-[`FabricObject`](/api/classes/fabricobject/).[`onSelect`](/api/classes/fabricobject/#onselect)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
+[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect)
***
-### once()
-
-#### once(eventName, handler)
-
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-
-Observes specified event **once**
-
-##### Type Parameters
+### onDragStart()
-• **K** *extends* `string` \| `number` \| `symbol`
+> **onDragStart**(`_e`): `boolean`
-• **E**
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
-##### Parameters
+Override to customize Drag behavior\
+Fired once a drag session has started
-• **eventName**: `K`
+#### Parameters
-Event name (eg. 'after:render')
+##### \_e
-• **handler**: `TEventCallback`\<`E`\>
+`DragEvent`
-Function that receives a notification when an event of the specified type occurs
+#### Returns
-##### Returns
+`boolean`
-`VoidFunction`
+true to handle the drag event
-disposer
+#### Inherited from
-##### Alias
+[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart)
-once
+***
-##### Inherited from
+### onSelect()
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+> **onSelect**(`_options?`): `boolean`
-##### Defined in
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to select this object. If the function returns true, the process is cancelled
-#### once(handlers)
+#### Parameters
-> **once**(`handlers`): `VoidFunction`
+##### \_options?
-##### Parameters
+options sent from the upper functions
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### e?
-##### Returns
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
-`VoidFunction`
+event if the process is generated by an event
-##### Inherited from
+#### Returns
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+`boolean`
-##### Defined in
+#### Inherited from
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+[`FabricObject`](/api/classes/fabricobject/).[`onSelect`](/api/classes/fabricobject/#onselect)
***
@@ -4496,11 +4137,15 @@ once
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:649](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L649)
+
Renders an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -4512,21 +4157,23 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`render`](/api/classes/fabricobject/#render)
-#### Defined in
-
-[src/shapes/Object/Object.ts:698](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L698)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **options?**: `any`
+`TCachedFabricObject`
+
+##### options?
+
+`any`
#### Returns
@@ -4536,23 +4183,23 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`renderCache`](/api/classes/fabricobject/#rendercache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4562,16 +4209,14 @@ example: render the selection status for the part of text that is being dragged
[`FabricObject`](/api/classes/fabricobject/).[`renderDragSourceEffect`](/api/classes/fabricobject/#renderdragsourceeffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -4579,7 +4224,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4589,21 +4236,21 @@ object will change when dropping. example: show the cursor where the text is abo
[`FabricObject`](/api/classes/fabricobject/).[`renderDropTargetEffect`](/api/classes/fabricobject/#renderdroptargeteffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -4615,21 +4262,21 @@ Angle value (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`rotate`](/api/classes/fabricobject/#rotate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -4641,21 +4288,21 @@ Scale factor
[`FabricObject`](/api/classes/fabricobject/).[`scale`](/api/classes/fabricobject/#scale)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -4667,21 +4314,21 @@ New height value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToHeight`](/api/classes/fabricobject/#scaletoheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -4693,102 +4340,102 @@ New width value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToWidth`](/api/classes/fabricobject/#scaletowidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `Circle`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+`Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`set`](/api/classes/fabricobject/#set)
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
-### setControlVisible()
+### setControlsVisibility()
-> **setControlVisible**(`controlKey`, `visible`): `void`
+> **setControlsVisibility**(`options?`): `void`
-Sets the visibility of the specified control.
-please do not use.
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
-#### Parameters
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
-• **controlKey**: `string`
+#### Parameters
-The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
-but since the control api allow for any control name, can be any string.
+##### options?
-• **visible**: `boolean`
+`Record`\<`string`, `boolean`\> = `{}`
-true to set the specified control visible, false otherwise
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
#### Returns
`void`
-#### Todo
+#### Inherited from
-discuss this overlap of priority here with the team. Andrea Bogazzi for details
+[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
-#### Inherited from
+***
-[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
+### setControlVisible()
-#### Defined in
+> **setControlVisible**(`controlKey`, `visible`): `void`
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
-***
+Sets the visibility of the specified control.
+please do not use.
+
+#### Parameters
-### setControlsVisibility()
+##### controlKey
-> **setControlsVisibility**(`options`?): `void`
+`string`
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
+but since the control api allow for any control name, can be any string.
-#### Parameters
+##### visible
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
+`boolean`
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+true to set the specified control visible, false otherwise
#### Returns
`void`
-#### Inherited from
+#### Todo
-[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
+discuss this overlap of priority here with the team. Andrea Bogazzi for details
-#### Defined in
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
+[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
***
@@ -4796,8 +4443,10 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L343)
+
set controls' coordinates as well
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [https://fabric5.fabricjs.com/fabric-gotchas](https://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -4807,16 +4456,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
[`FabricObject`](/api/classes/fabricobject/).[`setCoords`](/api/classes/fabricobject/#setcoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -4830,29 +4477,33 @@ Travis build error about unused variables.
[`FabricObject`](/api/classes/fabricobject/).[`setOnGroup`](/api/classes/fabricobject/#setongroup)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -4864,42 +4515,42 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setPositionByOrigin`](/api/classes/fabricobject/#setpositionbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRadius()
> **setRadius**(`value`): `void`
+Defined in: [src/shapes/Circle.ts:152](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L152)
+
Sets radius of an object (and updates width accordingly)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Circle.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L152)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/circle/#setx)
+`number`
+
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/circle/#setx)
#### Returns
@@ -4909,29 +4560,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeX`](/api/classes/fabricobject/#setrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
-As [setXY](../../../../api/classes/circle/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
+
+As [setXY](/api/classes/circle/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -4943,22 +4598,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeXY`](/api/classes/fabricobject/#setrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/circle/#sety)
+`number`
+
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/circle/#sety)
#### Returns
@@ -4968,21 +4623,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeY`](/api/classes/fabricobject/#setrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -4992,15 +4647,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setX`](/api/classes/fabricobject/#setx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -5008,15 +4661,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5034,21 +4693,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
[`FabricObject`](/api/classes/fabricobject/).[`setXY`](/api/classes/fabricobject/#setxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -5058,20 +4717,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setY`](/api/classes/fabricobject/#sety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L775)
+
Decide if the object should cache or not. Create its own cache level
objectCaching is a global flag, wins over everything
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
Read as: cache if is needed, or if the feature is enabled but we are not already caching.
@@ -5083,22 +4740,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
[`FabricObject`](/api/classes/fabricobject/).[`shouldCache`](/api/classes/fabricobject/#shouldcache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L823)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -5110,25 +4767,27 @@ true in order for the window to start a drag session
[`FabricObject`](/api/classes/fabricobject/).[`shouldStartDragging`](/api/classes/fabricobject/#shouldstartdragging)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -5140,9 +4799,27 @@ the control box size used
[`FabricObject`](/api/classes/fabricobject/).[`strokeBorders`](/api/classes/fabricobject/#strokeborders)
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
+
+`toDataURLOptions` = `{}`
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob)
***
@@ -5150,11 +4827,15 @@ the control box size used
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -5168,23 +4849,25 @@ Returns DOM element with the FabricObject
[`FabricObject`](/api/classes/fabricobject/).[`toCanvasElement`](/api/classes/fabricobject/#tocanvaselement)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`this`, `reviver`?): `string`
+> **toClipPathSVG**(`this`, `reviver?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L144)
Returns svg clipPath representation of an instance
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### reviver?
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -5198,9 +4881,33 @@ svg representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toClipPathSVG`](/api/classes/fabricobject/#toclippathsvg)
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
+
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143)
+[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
***
@@ -5208,11 +4915,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -5226,37 +4937,31 @@ Returns a data: URL containing a representation of the object in the format spec
[`FabricObject`](/api/classes/fabricobject/).[`toDataURL`](/api/classes/fabricobject/#todataurl)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `Circle`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`Circle`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
***
@@ -5264,6 +4969,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -5276,27 +4983,31 @@ JSON
[`FabricObject`](/api/classes/fabricobject/).[`toJSON`](/api/classes/fabricobject/#tojson)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps`
+> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps`
+
+Defined in: [src/shapes/Circle.ts:162](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L162)
Returns object representation of an instance
#### Type Parameters
-• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+##### T
+
+`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Circle`\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+
+##### K
-• **K** *extends* `string` \| `number` \| `symbol` = `never`
+`K` *extends* `string` \| `number` \| `symbol` = `never`
#### Parameters
-• **propertiesToInclude?**: `K`[] = `[]`
+##### propertiesToInclude?
+
+`K`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -5310,46 +5021,14 @@ object representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject)
-#### Defined in
-
-[src/shapes/Circle.ts:162](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L162)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Object/Object.ts:1890](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1890)
+
Returns a string representation of an instance
#### Returns
@@ -5360,35 +5039,37 @@ Returns a string representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1924)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`Circle`](/api/classes/circle/)\<`Props`, `SProps`, `EventSpec`\>
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
+#### Returns
+
+`string`
-#### Defined in
+svg representation of an instance
+
+#### Inherited from
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
***
@@ -5396,11 +5077,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -5412,19 +5097,19 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transform`](/api/classes/fabricobject/#transform)
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -5434,29 +5119,33 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transformMatrixKey`](/api/classes/fabricobject/#transformmatrixkey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5468,37 +5157,45 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToCenterPoint`](/api/classes/fabricobject/#translatetocenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5510,29 +5207,33 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToGivenOrigin`](/api/classes/fabricobject/#translatetogivenorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5544,16 +5245,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToOriginPoint`](/api/classes/fabricobject/#translatetooriginpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -5569,25 +5268,29 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`willDrawShadow`](/api/classes/fabricobject/#willdrawshadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+`Record`\<`string`, `unknown`\>
+
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -5597,16 +5300,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`_fromObject`](/api/classes/fabricobject/#_fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -5623,65 +5324,65 @@ make this function return an empty object and add controls to the ownDefaults
[`FabricObject`](/api/classes/fabricobject/).[`createControls`](/api/classes/fabricobject/#createcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### fromElement()
-> `static` **fromElement**(`element`, `options`?, `cssRules`?): `Promise`\<[`Circle`](/api/classes/circle/)\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Circle`\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Circle.ts:220](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L220)
-Returns [Circle](../../../../api/classes/circle) instance from an SVG element
+Returns [Circle](/api/classes/circle/) instance from an SVG element
#### Parameters
-• **element**: `HTMLElement`
+##### element
-Element to parse
+`HTMLElement`
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
+Element to parse
-Partial Circle object to default missing properties on the element.
+##### options?
-• **cssRules?**: `CSSRules`
+[`Abortable`](/api/type-aliases/abortable/)
-#### Returns
+Partial Circle object to default missing properties on the element.
-`Promise`\<[`Circle`](/api/classes/circle/)\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### cssRules?
-#### Static
+`CSSRules`
-#### Member Of
+#### Returns
-Circle
+`Promise`\<`Circle`\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
#### Throws
If value of `r` attribute is missing or invalid
-#### Defined in
-
-[src/shapes/Circle.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L224)
-
***
### fromObject()
-> `static` **fromObject**\<`T`\>(`object`): `Promise`\<[`Circle`](/api/classes/circle/)\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromObject**\<`T`\>(`object`): `Promise`\<`Circle`\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Circle.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L251)
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedCircleProps`](/api/interfaces/serializedcircleprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedCircleProps`](/api/interfaces/serializedcircleprops/)\>
#### Parameters
-• **object**: `T`
+##### object
+
+`T`
#### Returns
-`Promise`\<[`Circle`](/api/classes/circle/)\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+`Promise`\<`Circle`\<`Partial`\<[`CircleProps`](/api/interfaces/circleprops/)\>, [`SerializedCircleProps`](/api/interfaces/serializedcircleprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
#### Todo
@@ -5691,16 +5392,14 @@ how do we declare this??
[`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject)
-#### Defined in
-
-[src/shapes/Circle.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L255)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Circle.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L84)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -5708,7 +5407,3 @@ how do we declare this??
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults)
-
-#### Defined in
-
-[src/shapes/Circle.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L84)
diff --git a/src/content/docs/api/classes/CircleBrush.md b/src/content/docs/api/classes/CircleBrush.md
index 07b57a469..f2bbe9a13 100644
--- a/src/content/docs/api/classes/CircleBrush.md
+++ b/src/content/docs/api/classes/CircleBrush.md
@@ -5,9 +5,11 @@ prev: false
title: "CircleBrush"
---
+Defined in: [src/brushes/CircleBrush.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L12)
+
## See
-[demo](http://fabricjs.com/freedrawing|Freedrawing)
+[demo](http://fabric5.fabricjs.com/freedrawing|Freedrawing)
## Extends
@@ -15,25 +17,25 @@ title: "CircleBrush"
## Constructors
-### new CircleBrush()
+### Constructor
+
+> **new CircleBrush**(`canvas`): `CircleBrush`
-> **new CircleBrush**(`canvas`): [`CircleBrush`](/api/classes/circlebrush/)
+Defined in: [src/brushes/CircleBrush.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L21)
#### Parameters
-• **canvas**: [`Canvas`](/api/classes/canvas/)
+##### canvas
+
+[`Canvas`](/api/classes/canvas/)
#### Returns
-[`CircleBrush`](/api/classes/circlebrush/)
+`CircleBrush`
#### Overrides
-[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructors)
-
-#### Defined in
-
-[src/brushes/CircleBrush.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L22)
+[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructor)
## Properties
@@ -41,6 +43,8 @@ title: "CircleBrush"
> **canvas**: [`Canvas`](/api/classes/canvas/)
+Defined in: [src/brushes/BaseBrush.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L66)
+
#### Todo
add type
@@ -49,38 +53,28 @@ add type
[`BaseBrush`](/api/classes/basebrush/).[`canvas`](/api/classes/basebrush/#canvas)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L73)
-
***
### color
> **color**: `string` = `'rgb(0, 0, 0)'`
-Color of a brush
-
-#### Default
-
-```ts
+Defined in: [src/brushes/BaseBrush.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L15)
-```
+Color of a brush
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`color`](/api/classes/basebrush/#color)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L16)
-
***
### limitedToCanvasSize
> **limitedToCanvasSize**: `boolean` = `false`
+Defined in: [src/brushes/BaseBrush.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L61)
+
When `true`, the free drawing is limited to the whiteboard size. Default to false.
#### Default
@@ -93,19 +87,13 @@ false
[`BaseBrush`](/api/classes/basebrush/).[`limitedToCanvasSize`](/api/classes/basebrush/#limitedtocanvassize)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L68)
-
***
### points
> **points**: [`CircleBrushPoint`](/api/type-aliases/circlebrushpoint/)[]
-#### Defined in
-
-[src/brushes/CircleBrush.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L20)
+Defined in: [src/brushes/CircleBrush.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L19)
***
@@ -113,143 +101,99 @@ false
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) = `null`
+Defined in: [src/brushes/BaseBrush.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L29)
+
Shadow object representing shadow of this shape.
Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number),
"shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`shadow`](/api/classes/basebrush/#shadow)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L32)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[] = `null`
-Stroke Dash Array.
+Defined in: [src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L53)
-#### Default
-
-```ts
-
-```
+Stroke Dash Array.
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`strokeDashArray`](/api/classes/basebrush/#strokedasharray)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L60)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap` = `'round'`
-Line endings style of a brush (one of "butt", "round", "square")
-
-#### Default
-
-```ts
+Defined in: [src/brushes/BaseBrush.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L35)
-```
+Line endings style of a brush (one of "butt", "round", "square")
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`strokeLineCap`](/api/classes/basebrush/#strokelinecap)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L39)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin` = `'round'`
-Corner style of a brush (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/brushes/BaseBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L41)
-```
+Corner style of a brush (one of "bevel", "round", "miter")
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`strokeLineJoin`](/api/classes/basebrush/#strokelinejoin)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L46)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number` = `10`
-Maximum miter length (used for strokeLineJoin = "miter") of a brush's
-
-#### Default
+Defined in: [src/brushes/BaseBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L47)
-```ts
-
-```
+Maximum miter length (used for strokeLineJoin = "miter") of a brush's
#### Inherited from
[`BaseBrush`](/api/classes/basebrush/).[`strokeMiterLimit`](/api/classes/basebrush/#strokemiterlimit)
-#### Defined in
-
-[src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L53)
-
***
### width
> **width**: `number` = `10`
-Width of a brush
-
-#### Default
-
-```ts
+Defined in: [src/brushes/CircleBrush.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L17)
-```
+Width of a brush
#### Overrides
[`BaseBrush`](/api/classes/basebrush/).[`width`](/api/classes/basebrush/#width)
-#### Defined in
-
-[src/brushes/CircleBrush.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L18)
-
## Methods
### addPoint()
> **addPoint**(`pointer`): [`CircleBrushPoint`](/api/type-aliases/circlebrushpoint/)
+Defined in: [src/brushes/CircleBrush.ts:127](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L127)
+
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -257,29 +201,27 @@ Width of a brush
Just added pointer point
-#### Defined in
-
-[src/brushes/CircleBrush.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L128)
-
***
### dot()
> **dot**(`ctx`, `point`): `void`
+Defined in: [src/brushes/CircleBrush.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L38)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **point**: [`CircleBrushPoint`](/api/type-aliases/circlebrushpoint/)
+`CanvasRenderingContext2D`
-#### Returns
+##### point
-`void`
+[`CircleBrushPoint`](/api/type-aliases/circlebrushpoint/)
-#### Defined in
+#### Returns
-[src/brushes/CircleBrush.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L39)
+`void`
***
@@ -287,31 +229,35 @@ Just added pointer point
> **drawDot**(`pointer`): `void`
+Defined in: [src/brushes/CircleBrush.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L30)
+
Invoked inside on mouse down and mouse move
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
+
+[`Point`](/api/classes/point/)
#### Returns
`void`
-#### Defined in
-
-[src/brushes/CircleBrush.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L31)
-
***
### onMouseDown()
> **onMouseDown**(`pointer`): `void`
+Defined in: [src/brushes/CircleBrush.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L49)
+
Invoked on mouse down
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -321,21 +267,21 @@ Invoked on mouse down
[`BaseBrush`](/api/classes/basebrush/).[`onMouseDown`](/api/classes/basebrush/#onmousedown)
-#### Defined in
-
-[src/brushes/CircleBrush.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L50)
-
***
### onMouseMove()
> **onMouseMove**(`pointer`): `void`
+Defined in: [src/brushes/CircleBrush.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L74)
+
Invoked on mouse move
#### Parameters
-• **pointer**: [`Point`](/api/classes/point/)
+##### pointer
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -345,16 +291,14 @@ Invoked on mouse move
[`BaseBrush`](/api/classes/basebrush/).[`onMouseMove`](/api/classes/basebrush/#onmousemove)
-#### Defined in
-
-[src/brushes/CircleBrush.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L75)
-
***
### onMouseUp()
> **onMouseUp**(): `void`
+Defined in: [src/brushes/CircleBrush.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/CircleBrush.ts#L90)
+
Invoked on mouse up
#### Returns
@@ -364,7 +308,3 @@ Invoked on mouse up
#### Overrides
[`BaseBrush`](/api/classes/basebrush/).[`onMouseUp`](/api/classes/basebrush/#onmouseup)
-
-#### Defined in
-
-[src/brushes/CircleBrush.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/CircleBrush.ts#L91)
diff --git a/src/content/docs/api/classes/ClipPathLayout.md b/src/content/docs/api/classes/ClipPathLayout.md
index 0a748375c..81acab2fd 100644
--- a/src/content/docs/api/classes/ClipPathLayout.md
+++ b/src/content/docs/api/classes/ClipPathLayout.md
@@ -5,6 +5,8 @@ prev: false
title: "ClipPathLayout"
---
+Defined in: [src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L13)
+
Layout will adjust the bounding box to match the clip path bounding box.
## Extends
@@ -13,17 +15,17 @@ Layout will adjust the bounding box to match the clip path bounding box.
## Constructors
-### new ClipPathLayout()
+### Constructor
-> **new ClipPathLayout**(): [`ClipPathLayout`](/api/classes/clippathlayout/)
+> **new ClipPathLayout**(): `ClipPathLayout`
#### Returns
-[`ClipPathLayout`](/api/classes/clippathlayout/)
+`ClipPathLayout`
#### Inherited from
-[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructors)
+[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructor)
## Properties
@@ -31,29 +33,33 @@ Layout will adjust the bounding box to match the clip path bounding box.
> `readonly` `static` **type**: `"clip-path"` = `'clip-path'`
+Defined in: [src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L14)
+
override by subclass for persistence (TS does not support `static abstract`)
#### Overrides
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`type`](/api/classes/layoutstrategy/#type)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L14)
-
## Methods
### calcBoundingBox()
> **calcBoundingBox**(`objects`, `context`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
+
Override this method to customize layout.
#### Parameters
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+
+##### context
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -63,25 +69,27 @@ Override this method to customize layout.
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcBoundingBox`](/api/classes/layoutstrategy/#calcboundingbox)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
-
***
### calcLayoutResult()
> **calcLayoutResult**(`context`, `objects`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L24)
+
Used by the `LayoutManager` to perform layout
@TODO/fix: if this method is calcResult, should calc unconditionally.
the condition to not calc should be evaluated by the layoutManager.
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### context
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -93,21 +101,23 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcLayoutResult`](/api/classes/layoutstrategy/#calclayoutresult)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L24)
-
***
### getInitialSize()
> **getInitialSize**(`context`, `result`): [`Point`](/api/classes/point/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L58)
+
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
+
+##### result
-• **result**: `Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
+`Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
#### Returns
@@ -117,16 +127,14 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`getInitialSize`](/api/classes/layoutstrategy/#getinitialsize)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L58)
-
***
### shouldLayoutClipPath()
> **shouldLayoutClipPath**(): `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L20)
+
#### Returns
`boolean`
@@ -135,19 +143,19 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldLayoutClipPath`](/api/classes/layoutstrategy/#shouldlayoutclippath)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L20)
-
***
### shouldPerformLayout()
> **shouldPerformLayout**(`context`): `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L16)
+
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -156,7 +164,3 @@ layout result **OR** `undefined` to skip layout
#### Overrides
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldPerformLayout`](/api/classes/layoutstrategy/#shouldperformlayout)
-
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts#L16)
diff --git a/src/content/docs/api/classes/Color.md b/src/content/docs/api/classes/Color.md
index 227e08e5e..bfaea0dac 100644
--- a/src/content/docs/api/classes/Color.md
+++ b/src/content/docs/api/classes/Color.md
@@ -5,31 +5,33 @@ prev: false
title: "Color"
---
+Defined in: [src/color/Color.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L18)
+
Color common color operations
-## Tutorial
+## See
-[colors](http://fabricjs.com/fabric-intro-part-2/#colors)
+[colors](http://fabric5.fabricjs.com/fabric-intro-part-2#colors)
## Constructors
-### new Color()
+### Constructor
+
+> **new Color**(`color?`): `Color`
-> **new Color**(`color`?): [`Color`](/api/classes/color/)
+Defined in: [src/color/Color.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L26)
#### Parameters
-• **color?**: [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### color?
+
+[`TColorArg`](/api/type-aliases/tcolorarg/)
optional in hex or rgb(a) or hsl format or from known color list
#### Returns
-[`Color`](/api/classes/color/)
-
-#### Defined in
-
-[src/color/Color.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L25)
+`Color`
## Properties
@@ -37,9 +39,7 @@ optional in hex or rgb(a) or hsl format or from known color list
> **isUnrecognised**: `boolean` = `false`
-#### Defined in
-
-[src/color/Color.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L19)
+Defined in: [src/color/Color.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L20)
## Methods
@@ -47,6 +47,8 @@ optional in hex or rgb(a) or hsl format or from known color list
> **getAlpha**(): `number`
+Defined in: [src/color/Color.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L134)
+
Gets value of alpha channel for this color
#### Returns
@@ -55,138 +57,132 @@ Gets value of alpha channel for this color
0-1
-#### Defined in
-
-[src/color/Color.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L132)
-
***
### getSource()
> **getSource**(): [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
+Defined in: [src/color/Color.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L65)
+
Returns source of this color (where source is an array representation; ex: [200, 200, 100, 1])
#### Returns
[`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
-#### Defined in
-
-[src/color/Color.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L63)
-
***
### overlayWith()
-> **overlayWith**(`otherColor`): [`Color`](/api/classes/color/)
+> **overlayWith**(`otherColor`): `Color`
+
+Defined in: [src/color/Color.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L174)
Overlays color with another color
#### Parameters
-• **otherColor**: `string` \| [`Color`](/api/classes/color/)
+##### otherColor
+
+`string` | `Color`
#### Returns
-[`Color`](/api/classes/color/)
+`Color`
thisArg
-#### Defined in
-
-[src/color/Color.ts:172](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L172)
-
***
### setAlpha()
-> **setAlpha**(`alpha`): [`Color`](/api/classes/color/)
+> **setAlpha**(`alpha`): `Color`
+
+Defined in: [src/color/Color.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L143)
Sets value of alpha channel for this color
#### Parameters
-• **alpha**: `number`
+##### alpha
+
+`number`
Alpha value 0-1
#### Returns
-[`Color`](/api/classes/color/)
+`Color`
thisArg
-#### Defined in
-
-[src/color/Color.ts:141](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L141)
-
***
### setSource()
> **setSource**(`source`): `void`
+Defined in: [src/color/Color.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L73)
+
Sets source of this color (where source is an array representation; ex: [200, 200, 100, 1])
#### Parameters
-• **source**: [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
+##### source
+
+[`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
#### Returns
`void`
-#### Defined in
-
-[src/color/Color.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L71)
-
***
### toBlackWhite()
-> **toBlackWhite**(`threshold`): [`Color`](/api/classes/color/)
+> **toBlackWhite**(`threshold`): `Color`
+
+Defined in: [src/color/Color.ts:162](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L162)
Transforms color to its black and white representation
#### Parameters
-• **threshold**: `number`
+##### threshold
+
+`number`
#### Returns
-[`Color`](/api/classes/color/)
+`Color`
thisArg
-#### Defined in
-
-[src/color/Color.ts:160](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L160)
-
***
### toGrayscale()
-> **toGrayscale**(): [`Color`](/api/classes/color/)
+> **toGrayscale**(): `Color`
+
+Defined in: [src/color/Color.ts:152](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L152)
Transforms color to its grayscale representation
#### Returns
-[`Color`](/api/classes/color/)
+`Color`
thisArg
-#### Defined in
-
-[src/color/Color.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L150)
-
***
### toHex()
> **toHex**(): `string`
+Defined in: [src/color/Color.ts:116](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L116)
+
Returns color representation in HEX format
#### Returns
@@ -195,16 +191,14 @@ Returns color representation in HEX format
ex: FF5555
-#### Defined in
-
-[src/color/Color.ts:114](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L114)
-
***
### toHexa()
> **toHexa**(): `string`
+Defined in: [src/color/Color.ts:125](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L125)
+
Returns color representation in HEXA format
#### Returns
@@ -213,16 +207,14 @@ Returns color representation in HEXA format
ex: FF5555CC
-#### Defined in
-
-[src/color/Color.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L123)
-
***
### toHsl()
> **toHsl**(): `string`
+Defined in: [src/color/Color.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L98)
+
Returns color representation in HSL format
#### Returns
@@ -231,16 +223,14 @@ Returns color representation in HSL format
ex: hsl(0-360,0%-100%,0%-100%)
-#### Defined in
-
-[src/color/Color.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L96)
-
***
### toHsla()
> **toHsla**(): `string`
+Defined in: [src/color/Color.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L107)
+
Returns color representation in HSLA format
#### Returns
@@ -249,16 +239,14 @@ Returns color representation in HSLA format
ex: hsla(0-360,0%-100%,0%-100%,0-1)
-#### Defined in
-
-[src/color/Color.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L105)
-
***
### toRgb()
> **toRgb**(): `string`
+Defined in: [src/color/Color.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L81)
+
Returns color representation in RGB format
#### Returns
@@ -267,16 +255,14 @@ Returns color representation in RGB format
ex: rgb(0-255,0-255,0-255)
-#### Defined in
-
-[src/color/Color.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L79)
-
***
### toRgba()
> **toRgba**(): `string`
+Defined in: [src/color/Color.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L90)
+
Returns color representation in RGBA format
#### Returns
@@ -285,145 +271,111 @@ Returns color representation in RGBA format
ex: rgba(0-255,0-255,0-255,0-1)
-#### Defined in
-
-[src/color/Color.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L88)
-
***
### fromHex()
-> `static` **fromHex**(`color`): [`Color`](/api/classes/color/)
+> `static` **fromHex**(`color`): `Color`
+
+Defined in: [src/color/Color.ts:287](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L287)
Returns new color object, when given a color in HEX format
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
Color value ex: FF5555
#### Returns
-[`Color`](/api/classes/color/)
-
-#### Static
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:297](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L297)
+`Color`
***
### fromHsl()
-> `static` **fromHsl**(`color`): [`Color`](/api/classes/color/)
+> `static` **fromHsl**(`color`): `Color`
+
+Defined in: [src/color/Color.ts:231](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L231)
Returns new color object, when given a color in HSL format
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
Color value ex: hsl(0-260,0%-100%,0%-100%)
#### Returns
-[`Color`](/api/classes/color/)
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:235](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L235)
+`Color`
***
### fromHsla()
-> `static` **fromHsla**(`color`): [`Color`](/api/classes/color/)
+> `static` **fromHsla**(`color`): `Color`
+
+Defined in: [src/color/Color.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L240)
Returns new color object, when given a color in HSLA format
#### Parameters
-• **color**: `string`
-
-#### Returns
-
-[`Color`](/api/classes/color/)
-
-#### Static
-
-#### Function
+##### color
-#### Member Of
-
-Color
+`string`
-#### Defined in
+#### Returns
-[src/color/Color.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L247)
+`Color`
***
### fromRgb()
-> `static` **fromRgb**(`color`): [`Color`](/api/classes/color/)
+> `static` **fromRgb**(`color`): `Color`
+
+Defined in: [src/color/Color.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L195)
Returns new color object, when given a color in RGB format
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
Color value ex: rgb(0-255,0-255,0-255)
#### Returns
-[`Color`](/api/classes/color/)
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L194)
+`Color`
***
### fromRgba()
-> `static` **fromRgba**(`color`): [`Color`](/api/classes/color/)
+> `static` **fromRgba**(`color`): `Color`
+
+Defined in: [src/color/Color.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L204)
Returns new color object, when given a color in RGBA format
#### Parameters
-• **color**: `string`
+##### color
-#### Returns
-
-[`Color`](/api/classes/color/)
-
-#### Static
-
-#### Function
-
-#### Member Of
-
-Color
+`string`
-#### Defined in
+#### Returns
-[src/color/Color.ts:206](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L206)
+`Color`
***
@@ -431,12 +383,16 @@ Color
> `static` **parseAngletoDegrees**(`value`): `number`
+Defined in: [src/color/Color.ts:319](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L319)
+
Converts a string that could be any angle notation (50deg, 0.5turn, 2rad)
into degrees without the 'deg' suffix
#### Parameters
-• **value**: `string`
+##### value
+
+`string`
ex: 0deg, 0.5turn, 2rad
@@ -446,27 +402,21 @@ ex: 0deg, 0.5turn, 2rad
number in degrees or NaN if inputs are invalid
-#### Static
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L333)
-
***
### sourceFromHex()
> `static` **sourceFromHex**(`color`): `undefined` \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
+Defined in: [src/color/Color.ts:296](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L296)
+
Returns array representation (ex: [100, 100, 200, 1]) of a color that's in HEX format
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
ex: FF5555 or FF5544CC (RGBa)
@@ -476,28 +426,22 @@ ex: FF5555 or FF5544CC (RGBa)
source
-#### Static
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:308](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L308)
-
***
### sourceFromHsl()
> `static` **sourceFromHsl**(`color`): `undefined` \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
+Defined in: [src/color/Color.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L251)
+
Returns array representation (ex: [100, 100, 200, 1]) of a color that's in HSL or HSLA format.
Adapted from https://github.com/mjijackson
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1)
@@ -507,29 +451,25 @@ Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1)
source
-#### Member Of
-
-Color
-
#### See
http://http://www.w3.org/TR/css3-color/#hsl-color
-#### Defined in
-
-[src/color/Color.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L259)
-
***
### sourceFromRgb()
> `static` **sourceFromRgb**(`color`): `undefined` \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
+Defined in: [src/color/Color.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/Color.ts#L213)
+
Returns array representation (ex: [100, 100, 200, 1]) of a color that's in RGB or RGBA format
#### Parameters
-• **color**: `string`
+##### color
+
+`string`
Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%)
@@ -538,11 +478,3 @@ Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%)
`undefined` \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/)
source
-
-#### Member Of
-
-Color
-
-#### Defined in
-
-[src/color/Color.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/Color.ts#L216)
diff --git a/src/content/docs/api/classes/Control.md b/src/content/docs/api/classes/Control.md
index 8f5ea6ad6..a423108dd 100644
--- a/src/content/docs/api/classes/Control.md
+++ b/src/content/docs/api/classes/Control.md
@@ -5,23 +5,25 @@ prev: false
title: "Control"
---
+Defined in: [src/controls/Control.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L24)
+
## Constructors
-### new Control()
+### Constructor
+
+> **new Control**(`options?`): `Control`
-> **new Control**(`options`?): [`Control`](/api/classes/control/)
+Defined in: [src/controls/Control.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L145)
#### Parameters
-• **options?**: `Partial`\<[`Control`](/api/classes/control/)\>
+##### options?
-#### Returns
+`Partial`\<`Control`\>
-[`Control`](/api/classes/control/)
-
-#### Defined in
+#### Returns
-[src/controls/Control.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L142)
+`Control`
## Properties
@@ -29,6 +31,8 @@ title: "Control"
> **actionHandler**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)
+Defined in: [src/controls/Control.ts:157](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L157)
+
The control actionHandler, provide one to handle action ( control being moved )
#### Param
@@ -47,9 +51,9 @@ x position of the cursor
y position of the cursor
-#### Defined in
+#### Returns
-[src/controls/Control.ts:154](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L154)
+true if the action/event modified the object
***
@@ -57,6 +61,8 @@ y position of the cursor
> **actionName**: `string` = `SCALE`
+Defined in: [src/controls/Control.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L46)
+
Name of the action that the control will likely execute.
This is optional. FabricJS uses to identify what the user is doing for some
extra optimizations. If you are writing a custom control and you want to know
@@ -71,16 +77,14 @@ default to scale since is the most common, used on 4 corners by default
'scale'
```
-#### Defined in
-
-[src/controls/Control.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L43)
-
***
### angle
> **angle**: `number` = `0`
+Defined in: [src/controls/Control.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L55)
+
Drawing angle of the control.
NOT used for now, but name marked as needed for internal logic
example: to reuse the same drawing function for different rotated controls
@@ -91,16 +95,14 @@ example: to reuse the same drawing function for different rotated controls
0
```
-#### Defined in
-
-[src/controls/Control.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L52)
-
***
### cursorStyle
> **cursorStyle**: `string` = `'crosshair'`
+Defined in: [src/controls/Control.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L135)
+
Css cursor style to display when the control is hovered.
if the method `cursorStyleHandler` is provided, this property is ignored.
@@ -110,16 +112,14 @@ if the method `cursorStyleHandler` is provided, this property is ignored.
'crosshair'
```
-#### Defined in
-
-[src/controls/Control.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L132)
-
***
### mouseDownHandler?
> `optional` **mouseDownHandler**: [`ControlActionHandler`](/api/type-aliases/controlactionhandler/)
+Defined in: [src/controls/Control.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L167)
+
The control handler for mouse down, provide one to handle mouse down on control
#### Param
@@ -138,9 +138,9 @@ x position of the cursor
y position of the cursor
-#### Defined in
+#### Returns
-[src/controls/Control.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L164)
+true if the action/event modified the object
***
@@ -148,6 +148,8 @@ y position of the cursor
> `optional` **mouseUpHandler**: [`ControlActionHandler`](/api/type-aliases/controlactionhandler/)
+Defined in: [src/controls/Control.ts:177](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L177)
+
The control mouseUpHandler, provide one to handle an effect on mouse up.
#### Param
@@ -166,9 +168,9 @@ x position of the cursor
y position of the cursor
-#### Defined in
+#### Returns
-[src/controls/Control.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L174)
+true if the action/event modified the object
***
@@ -176,6 +178,8 @@ y position of the cursor
> **offsetX**: `number` = `0`
+Defined in: [src/controls/Control.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L87)
+
Horizontal offset of the control from the defined position. In pixels
Positive offset moves the control to the right, negative to the left.
It used when you want to have position of control that does not scale with
@@ -191,16 +195,14 @@ of the bounding box.
0
```
-#### Defined in
-
-[src/controls/Control.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L84)
-
***
### offsetY
> **offsetY**: `number` = `0`
+Defined in: [src/controls/Control.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L95)
+
Vertical offset of the control from the defined position. In pixels
Positive offset moves the control to the bottom, negative to the top.
@@ -210,16 +212,14 @@ Positive offset moves the control to the bottom, negative to the top.
0
```
-#### Defined in
-
-[src/controls/Control.ts:92](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L92)
-
***
### sizeX
> **sizeX**: `number` = `0`
+Defined in: [src/controls/Control.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L103)
+
Sets the length of the control. If null, defaults to object's cornerSize.
Expects both sizeX and sizeY to be set when set.
@@ -229,16 +229,14 @@ Expects both sizeX and sizeY to be set when set.
null
```
-#### Defined in
-
-[src/controls/Control.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L100)
-
***
### sizeY
> **sizeY**: `number` = `0`
+Defined in: [src/controls/Control.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L111)
+
Sets the height of the control. If null, defaults to object's cornerSize.
Expects both sizeX and sizeY to be set when set.
@@ -248,16 +246,14 @@ Expects both sizeX and sizeY to be set when set.
null
```
-#### Defined in
-
-[src/controls/Control.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L108)
-
***
### touchSizeX
> **touchSizeX**: `number` = `0`
+Defined in: [src/controls/Control.ts:119](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L119)
+
Sets the length of the touch area of the control. If null, defaults to object's touchCornerSize.
Expects both touchSizeX and touchSizeY to be set when set.
@@ -267,16 +263,14 @@ Expects both touchSizeX and touchSizeY to be set when set.
null
```
-#### Defined in
-
-[src/controls/Control.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L116)
-
***
### touchSizeY
> **touchSizeY**: `number` = `0`
+Defined in: [src/controls/Control.ts:127](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L127)
+
Sets the height of the touch area of the control. If null, defaults to object's touchCornerSize.
Expects both touchSizeX and touchSizeY to be set when set.
@@ -286,16 +280,14 @@ Expects both touchSizeX and touchSizeY to be set when set.
null
```
-#### Defined in
-
-[src/controls/Control.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L124)
-
***
### visible
> **visible**: `boolean` = `true`
+Defined in: [src/controls/Control.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L33)
+
keep track of control visibility.
mainly for backward compatibility.
if you do not want to see a control, you can remove it
@@ -307,16 +299,14 @@ from the control set.
true
```
-#### Defined in
-
-[src/controls/Control.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L30)
-
***
### withConnection
> **withConnection**: `boolean` = `false`
+Defined in: [src/controls/Control.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L143)
+
If controls has an offsetY or offsetX, draw a line that connects
the control to the bounding box
@@ -326,16 +316,14 @@ the control to the bounding box
false
```
-#### Defined in
-
-[src/controls/Control.ts:140](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L140)
-
***
### x
> **x**: `number` = `0`
+Defined in: [src/controls/Control.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L64)
+
Relative position of the control. X
0,0 is the center of the Object, while -0.5 (left) or 0.5 (right) are the extremities
of the bounding box.
@@ -346,16 +334,14 @@ of the bounding box.
0
```
-#### Defined in
-
-[src/controls/Control.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L61)
-
***
### y
> **y**: `number` = `0`
+Defined in: [src/controls/Control.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L73)
+
Relative position of the control. Y
0,0 is the center of the Object, while -0.5 (top) or 0.5 (bottom) are the extremities
of the bounding box.
@@ -366,40 +352,50 @@ of the bounding box.
0
```
-#### Defined in
-
-[src/controls/Control.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L70)
-
## Methods
### calcCornerCoords()
> **calcCornerCoords**(`angle`, `objectCornerSize`, `centerX`, `centerY`, `isTouch`, `fabricObject`): `object`
+Defined in: [src/controls/Control.ts:316](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L316)
+
Returns the coords for this control based on object values.
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
-• **objectCornerSize**: `number`
+##### objectCornerSize
+
+`number`
cornerSize from the fabric object holding the control (or touchCornerSize if
isTouch is true)
-• **centerX**: `number`
+##### centerX
+
+`number`
x coordinate where the control center should be
-• **centerY**: `number`
+##### centerY
+
+`number`
y coordinate where the control center should be
-• **isTouch**: `boolean`
+##### isTouch
+
+`boolean`
true if touch corner, false if normal corner
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
#### Returns
@@ -421,15 +417,13 @@ true if touch corner, false if normal corner
> **tr**: [`Point`](/api/classes/point/)
-#### Defined in
-
-[src/controls/Control.ts:312](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L312)
-
***
### cursorStyleHandler()
-> **cursorStyleHandler**(`eventData`, `control`, `fabricObject`): `string`
+> **cursorStyleHandler**(`eventData`, `control`, `fabricObject`, `coord`): `string`
+
+Defined in: [src/controls/Control.ts:248](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L248)
Returns control cursorStyle for css using cursorStyle. If you need a more elaborate
function you can pass one in the constructor
@@ -437,23 +431,29 @@ the cursorStyle property
#### Parameters
-• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventData
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
the native mouse event
-• **control**: [`Control`](/api/classes/control/)
+##### control
+
+`Control`
the current control ( likely this)
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
-#### Returns
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
-`string`
+##### coord
-#### Defined in
+`TOCoord`
-[src/controls/Control.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L245)
+#### Returns
+
+`string`
***
@@ -461,19 +461,27 @@ the current control ( likely this)
> **getActionHandler**(`eventData`, `fabricObject`, `control`): `undefined` \| [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)
+Defined in: [src/controls/Control.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L200)
+
Returns control actionHandler
#### Parameters
-• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventData
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
the native mouse event
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
on which the control is displayed
-• **control**: [`Control`](/api/classes/control/)
+##### control
+
+`Control`
control for which the action handler is being asked
@@ -483,57 +491,65 @@ control for which the action handler is being asked
the action handler
-#### Defined in
-
-[src/controls/Control.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L197)
-
***
### getActionName()
> **getActionName**(`eventData`, `control`, `fabricObject`): `string`
+Defined in: [src/controls/Control.ts:264](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L264)
+
Returns the action name. The basic implementation just return the actionName property.
#### Parameters
-• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventData
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
the native mouse event
-• **control**: [`Control`](/api/classes/control/)
+##### control
+
+`Control`
the current control ( likely this)
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
#### Returns
`string`
-#### Defined in
-
-[src/controls/Control.ts:260](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L260)
-
***
### getMouseDownHandler()
> **getMouseDownHandler**(`eventData`, `fabricObject`, `control`): `undefined` \| [`ControlActionHandler`](/api/type-aliases/controlactionhandler/)
+Defined in: [src/controls/Control.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L215)
+
Returns control mouseDown handler
#### Parameters
-• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventData
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
the native mouse event
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
on which the control is displayed
-• **control**: [`Control`](/api/classes/control/)
+##### control
+
+`Control`
control for which the action handler is being asked
@@ -543,30 +559,34 @@ control for which the action handler is being asked
the action handler
-#### Defined in
-
-[src/controls/Control.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L212)
-
***
### getMouseUpHandler()
> **getMouseUpHandler**(`eventData`, `fabricObject`, `control`): `undefined` \| [`ControlActionHandler`](/api/type-aliases/controlactionhandler/)
+Defined in: [src/controls/Control.ts:231](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L231)
+
Returns control mouseUp handler.
During actions the fabricObject or the control can be of different obj
#### Parameters
-• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### eventData
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
the native mouse event
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
on which the control is displayed
-• **control**: [`Control`](/api/classes/control/)
+##### control
+
+`Control`
control for which the action handler is being asked
@@ -576,23 +596,25 @@ control for which the action handler is being asked
the action handler
-#### Defined in
-
-[src/controls/Control.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L228)
-
***
### getVisibility()
> **getVisibility**(`fabricObject`, `controlKey`): `boolean`
+Defined in: [src/controls/Control.ts:278](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L278)
+
Returns controls visibility
#### Parameters
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
+
+##### controlKey
-• **controlKey**: `string`
+`string`
key where the control is memorized on the
@@ -600,33 +622,35 @@ key where the control is memorized on the
`boolean`
-#### Defined in
-
-[src/controls/Control.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L274)
-
***
### positionHandler()
> **positionHandler**(`dim`, `finalMatrix`, `fabricObject`, `currentControl`): [`Point`](/api/classes/point/)
+Defined in: [src/controls/Control.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L295)
+
#### Parameters
-• **dim**: [`Point`](/api/classes/point/)
+##### dim
-• **finalMatrix**: [`TMat2D`](/api/type-aliases/tmat2d/)
+[`Point`](/api/classes/point/)
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### finalMatrix
-• **currentControl**: [`Control`](/api/classes/control/)
+[`TMat2D`](/api/type-aliases/tmat2d/)
-#### Returns
+##### fabricObject
-[`Point`](/api/classes/point/)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
+
+##### currentControl
-#### Defined in
+`Control`
-[src/controls/Control.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L291)
+#### Returns
+
+[`Point`](/api/classes/point/)
***
@@ -634,6 +658,8 @@ key where the control is memorized on the
> **render**(`ctx`, `left`, `top`, `styleOverride`, `fabricObject`): `void`
+Defined in: [src/controls/Control.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L352)
+
Render function for the control.
When this function runs the context is unscaled. unrotate. Just retina scaled.
all the functions will have to translate to the point left,top before starting Drawing
@@ -642,21 +668,31 @@ left and top are the result of the positionHandler function
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
the context where the control will be drawn
-• **left**: `number`
+##### left
+
+`number`
position of the canvas where we are about to render the control.
-• **top**: `number`
+##### top
+
+`number`
position of the canvas where we are about to render the control.
-• **styleOverride**: `undefined` \| `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
+##### styleOverride
+
+`undefined` | `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\>
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### fabricObject
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
the object where the control is about to be rendered
@@ -664,35 +700,35 @@ the object where the control is about to be rendered
`void`
-#### Defined in
-
-[src/controls/Control.ts:348](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L348)
-
***
### setVisibility()
-> **setVisibility**(`visibility`, `name`, `fabricObject`): `void`
+> **setVisibility**(`visibility`, `name?`, `fabricObject?`): `void`
+
+Defined in: [src/controls/Control.ts:287](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L287)
Sets controls visibility
#### Parameters
-• **visibility**: `boolean`
+##### visibility
+
+`boolean`
for the object
-• **name**: `string`
+##### name?
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`string`
-#### Returns
+##### fabricObject?
-`void`
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Defined in
+#### Returns
-[src/controls/Control.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L283)
+`void`
***
@@ -700,20 +736,26 @@ for the object
> **shouldActivate**(`controlKey`, `fabricObject`, `pointer`, `__namedParameters`): `boolean`
+Defined in: [src/controls/Control.ts:179](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/Control.ts#L179)
+
#### Parameters
-• **controlKey**: `string`
+##### controlKey
-• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`string`
-• **pointer**: [`Point`](/api/classes/point/)
+##### fabricObject
-• **\_\_namedParameters**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)
-#### Returns
+##### pointer
-`boolean`
+[`Point`](/api/classes/point/)
-#### Defined in
+##### \_\_namedParameters
-[src/controls/Control.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/Control.ts#L176)
+[`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+#### Returns
+
+`boolean`
diff --git a/src/content/docs/api/classes/Ellipse.md b/src/content/docs/api/classes/Ellipse.md
index bfc17e541..286ea17dd 100644
--- a/src/content/docs/api/classes/Ellipse.md
+++ b/src/content/docs/api/classes/Ellipse.md
@@ -5,87 +5,9 @@ prev: false
title: "Ellipse"
---
-Root object class from which all 2d shape classes inherit from
+Defined in: [src/shapes/Ellipse.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L29)
-## Tutorial
-
-[http://fabricjs.com/fabric-intro-part-1#objects](http://fabricjs.com/fabric-intro-part-1#objects)
-
-## Fires
-
-added
-
-## Fires
-
-removed
-
-## Fires
-
-selected
-
-## Fires
-
-deselected
-
-## Fires
-
-rotating
-
-## Fires
-
-scaling
-
-## Fires
-
-moving
-
-## Fires
-
-skewing
-
-## Fires
-
-modified
-
-## Fires
-
-mousedown
-
-## Fires
-
-mouseup
-
-## Fires
-
-mouseover
-
-## Fires
-
-mouseout
-
-## Fires
-
-mousewheel
-
-## Fires
-
-mousedblclick
-
-## Fires
-
-dragover
-
-## Fires
-
-dragenter
-
-## Fires
-
-dragleave
-
-## Fires
-
-drop
+Exported so we can tweak default values
## Extends
@@ -93,11 +15,17 @@ drop
## Type Parameters
-• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`EllipseProps`](/api/interfaces/ellipseprops/)\> = `Partial`\<[`EllipseProps`](/api/interfaces/ellipseprops/)\>
+### Props
+
+`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`EllipseProps`](/api/interfaces/ellipseprops/)\> = `Partial`\<[`EllipseProps`](/api/interfaces/ellipseprops/)\>
-• **SProps** *extends* [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/) = [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/)
+### SProps
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`SProps` *extends* [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/) = [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/)
+
+### EventSpec
+
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Implements
@@ -105,29 +33,29 @@ drop
## Constructors
-### new Ellipse()
+### Constructor
-> **new Ellipse**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+> **new Ellipse**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Ellipse.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L66)
Constructor
#### Parameters
-• **options?**: `Props`
+##### options?
+
+`Props`
Options object
#### Returns
-[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+`Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
-[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors)
-
-#### Defined in
-
-[src/shapes/Ellipse.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L68)
+[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor)
## Properties
@@ -135,6 +63,8 @@ Options object
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -145,16 +75,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values
[`FabricObject`](/api/classes/fabricobject/).[`__corner`](/api/classes/fabricobject/#__corner)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_controlsVisibility
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -163,16 +91,14 @@ this takes priority over the generic control visibility
[`FabricObject`](/api/classes/fabricobject/).[`_controlsVisibility`](/api/classes/fabricobject/#_controlsvisibility)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_scaling?
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -187,37 +113,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
[`FabricObject`](/api/classes/fabricobject/).[`_scaling`](/api/classes/fabricobject/#_scaling)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/ellipse/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/ellipse/#calcacoords)
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
***
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -239,9 +142,24 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`absolutePositioned`](/api/classes/fabricobject/#absolutepositioned)
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/ellipse/#setcoords).
+You can calculate them without updating with [()](/api/classes/ellipse/#calcacoords)
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
***
@@ -249,6 +167,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -265,25 +185,17 @@ Angle of rotation of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`angle`](/api/classes/fabricobject/#angle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`backgroundColor`](/api/interfaces/ellipseprops/#backgroundcolor)
@@ -292,16 +204,14 @@ takes css colors https://www.w3.org/TR/css-color-3/
[`FabricObject`](/api/classes/fabricobject/).[`backgroundColor`](/api/classes/fabricobject/#backgroundcolor)
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -318,16 +228,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`borderColor`](/api/classes/fabricobject/#bordercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -342,16 +250,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
[`FabricObject`](/api/classes/fabricobject/).[`borderDashArray`](/api/classes/fabricobject/#borderdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -368,20 +274,19 @@ Opacity of object's controlling borders when object is active and moving
[`FabricObject`](/api/classes/fabricobject/).[`borderOpacityWhenMoving`](/api/classes/fabricobject/#borderopacitywhenmoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -397,16 +302,14 @@ since there is no way to change the border itself.
[`FabricObject`](/api/classes/fabricobject/).[`borderScaleFactor`](/api/classes/fabricobject/#borderscalefactor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -417,12 +320,6 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`centeredRotation`](/api/interfaces/ellipseprops/#centeredrotation)
@@ -431,16 +328,14 @@ The object method `rotate` will always consider this property and never the canv
[`FabricObject`](/api/classes/fabricobject/).[`centeredRotation`](/api/classes/fabricobject/#centeredrotation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -448,12 +343,6 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`centeredScaling`](/api/interfaces/ellipseprops/#centeredscaling)
@@ -462,16 +351,14 @@ when being scaled via the controls.
[`FabricObject`](/api/classes/fabricobject/).[`centeredScaling`](/api/classes/fabricobject/#centeredscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -485,16 +372,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
[`FabricObject`](/api/classes/fabricobject/).[`clipPath`](/api/classes/fabricobject/#clippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -502,16 +387,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
[`FabricObject`](/api/classes/fabricobject/).[`clipPathId`](/api/classes/fabricobject/#clippathid)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -519,16 +402,14 @@ controls are added by default_controls.js
[`FabricObject`](/api/classes/fabricobject/).[`controls`](/api/classes/fabricobject/#controls)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -545,16 +426,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`cornerColor`](/api/classes/fabricobject/#cornercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -575,16 +454,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`cornerDashArray`](/api/classes/fabricobject/#cornerdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -601,16 +478,14 @@ Size of object's controlling corners (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`cornerSize`](/api/classes/fabricobject/#cornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -631,20 +506,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
[`FabricObject`](/api/classes/fabricobject/).[`cornerStrokeColor`](/api/classes/fabricobject/#cornerstrokecolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -655,10 +532,6 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`cornerStyle`](/api/interfaces/ellipseprops/#cornerstyle)
@@ -667,16 +540,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`cornerStyle`](/api/classes/fabricobject/#cornerstyle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -690,23 +561,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`dirty`](/api/classes/fabricobject/#dirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Implementation of
@@ -716,28 +579,20 @@ When set to `false`, an object can not be a target of events. All events propaga
[`FabricObject`](/api/classes/fabricobject/).[`evented`](/api/classes/fabricobject/#evented)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`excludeFromExport`](/api/interfaces/ellipseprops/#excludefromexport)
@@ -746,16 +601,14 @@ When `true`, object is not exported in OBJECT/JSON
[`FabricObject`](/api/classes/fabricobject/).[`excludeFromExport`](/api/classes/fabricobject/#excludefromexport)
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -773,16 +626,14 @@ rgb(0,0,0)
[`FabricObject`](/api/classes/fabricobject/).[`fill`](/api/classes/fabricobject/#fill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -801,16 +652,14 @@ nonzero
[`FabricObject`](/api/classes/fabricobject/).[`fillRule`](/api/classes/fabricobject/#fillrule)
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -827,16 +676,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipX`](/api/classes/fabricobject/#flipx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -853,23 +700,15 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipY`](/api/classes/fabricobject/#flipy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Implementation of
@@ -879,23 +718,15 @@ Composite rule used for canvas globalCompositeOperation
[`FabricObject`](/api/classes/fabricobject/).[`globalCompositeOperation`](/api/classes/fabricobject/#globalcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Implementation of
@@ -905,16 +736,14 @@ When set to `false`, object's controlling borders are not rendered
[`FabricObject`](/api/classes/fabricobject/).[`hasBorders`](/api/classes/fabricobject/#hasborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -931,23 +760,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`hasControls`](/api/classes/fabricobject/#hascontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Implementation of
@@ -957,16 +778,14 @@ Object height
[`FabricObject`](/api/classes/fabricobject/).[`height`](/api/classes/fabricobject/#height)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -983,23 +802,15 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`hoverCursor`](/api/classes/fabricobject/#hovercursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Implementation of
@@ -1009,16 +820,14 @@ When `false`, default object's values are not included in its serialization
[`FabricObject`](/api/classes/fabricobject/).[`includeDefaultValues`](/api/classes/fabricobject/#includedefaultvalues)
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -1037,16 +846,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`inverted`](/api/classes/fabricobject/#inverted)
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -1054,19 +861,17 @@ part of the move action.
[`FabricObject`](/api/classes/fabricobject/).[`isMoving`](/api/classes/fabricobject/#ismoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -1082,23 +887,15 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`left`](/api/classes/fabricobject/#left)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
-When `true`, object horizontal movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
-```
+When `true`, object horizontal movement is locked
#### Implementation of
@@ -1108,24 +905,16 @@ When `true`, object horizontal movement is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockMovementX`](/api/classes/fabricobject/#lockmovementx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
-
***
### lockMovementY
> **lockMovementY**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
+
When `true`, object vertical movement is locked
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`lockMovementY`](/api/interfaces/ellipseprops/#lockmovementy)
@@ -1134,23 +923,15 @@ When `true`, object vertical movement is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockMovementY`](/api/classes/fabricobject/#lockmovementy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Implementation of
@@ -1160,23 +941,15 @@ When `true`, object rotation is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockRotation`](/api/classes/fabricobject/#lockrotation)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Implementation of
@@ -1186,23 +959,15 @@ When `true`, object cannot be flipped by scaling into negative values
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingFlip`](/api/classes/fabricobject/#lockscalingflip)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Implementation of
@@ -1212,23 +977,15 @@ When `true`, object horizontal scaling is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingX`](/api/classes/fabricobject/#lockscalingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Implementation of
@@ -1238,23 +995,15 @@ When `true`, object vertical scaling is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingY`](/api/classes/fabricobject/#lockscalingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Implementation of
@@ -1264,23 +1013,15 @@ When `true`, object horizontal skewing is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingX`](/api/classes/fabricobject/#lockskewingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Implementation of
@@ -1290,32 +1031,28 @@ When `true`, object vertical skewing is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingY`](/api/classes/fabricobject/#lockskewingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`matrixCache`](/api/classes/fabricobject/#matrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
-
***
### minScaleLimit
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1332,16 +1069,14 @@ Minimum allowed scale value of an object
[`FabricObject`](/api/classes/fabricobject/).[`minScaleLimit`](/api/classes/fabricobject/#minscalelimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1358,16 +1093,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`moveCursor`](/api/classes/fabricobject/#movecursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1388,35 +1121,14 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`noScaleCache`](/api/classes/fabricobject/#noscalecache)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1439,9 +1151,22 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`objectCaching`](/api/classes/fabricobject/#objectcaching)
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
***
@@ -1449,6 +1174,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1465,16 +1192,14 @@ Opacity of an object
[`FabricObject`](/api/classes/fabricobject/).[`opacity`](/api/classes/fabricobject/#opacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1487,16 +1212,14 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originX`](/api/classes/fabricobject/#originx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1509,32 +1232,28 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originY`](/api/classes/fabricobject/#originy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`ownMatrixCache`](/api/classes/fabricobject/#ownmatrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1551,23 +1270,15 @@ Padding between object and its controlling borders (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`padding`](/api/classes/fabricobject/#padding)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Implementation of
@@ -1577,16 +1288,14 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
[`FabricObject`](/api/classes/fabricobject/).[`paintFirst`](/api/classes/fabricobject/#paintfirst)
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1594,23 +1303,15 @@ Used to keep the original parent ref when the object has been added to an Active
[`FabricObject`](/api/classes/fabricobject/).[`parent`](/api/classes/fabricobject/#parent)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Implementation of
@@ -1620,60 +1321,42 @@ When set to `true`, objects are "found" on canvas on per-pixel basis rather than
[`FabricObject`](/api/classes/fabricobject/).[`perPixelTargetFind`](/api/classes/fabricobject/#perpixeltargetfind)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### rx
> **rx**: `number`
-Horizontal radius
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Ellipse.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L41)
-```
+Horizontal radius
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`rx`](/api/interfaces/ellipseprops/#rx)
-#### Defined in
-
-[src/shapes/Ellipse.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L42)
-
***
### ry
> **ry**: `number`
-Vertical radius
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Ellipse.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L47)
-```
+Vertical radius
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`ry`](/api/interfaces/ellipseprops/#ry)
-#### Defined in
-
-[src/shapes/Ellipse.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L49)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1690,16 +1373,14 @@ Object scale factor (horizontal)
[`FabricObject`](/api/classes/fabricobject/).[`scaleX`](/api/classes/fabricobject/#scalex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1716,25 +1397,17 @@ Object scale factor (vertical)
[`FabricObject`](/api/classes/fabricobject/).[`scaleY`](/api/classes/fabricobject/#scaley)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`EllipseProps`](/api/interfaces/ellipseprops/).[`selectable`](/api/interfaces/ellipseprops/#selectable)
@@ -1743,25 +1416,17 @@ But events still fire on it.
[`FabricObject`](/api/classes/fabricobject/).[`selectable`](/api/classes/fabricobject/#selectable)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1774,16 +1439,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`selectionBackgroundColor`](/api/classes/fabricobject/#selectionbackgroundcolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1800,16 +1463,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`shadow`](/api/classes/fabricobject/#shadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1826,16 +1487,14 @@ Angle of skew on x axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewX`](/api/classes/fabricobject/#skewx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1852,16 +1511,14 @@ Angle of skew on y axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewY`](/api/classes/fabricobject/#skewy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Implementation of
@@ -1872,16 +1529,14 @@ The angle that an object will lock to while rotating.
[`FabricObject`](/api/classes/fabricobject/).[`snapAngle`](/api/classes/fabricobject/#snapangle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1893,16 +1548,14 @@ When undefined, the snapThreshold will default to the snapAngle.
[`FabricObject`](/api/classes/fabricobject/).[`snapThreshold`](/api/classes/fabricobject/#snapthreshold)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -1920,16 +1573,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`stroke`](/api/classes/fabricobject/#stroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -1946,16 +1597,14 @@ null;
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashArray`](/api/classes/fabricobject/#strokedasharray)
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -1972,16 +1621,14 @@ Line offset of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashOffset`](/api/classes/fabricobject/#strokedashoffset)
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -1998,23 +1645,15 @@ butt
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineCap`](/api/classes/fabricobject/#strokelinecap)
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Implementation of
@@ -2024,16 +1663,14 @@ Corner style of an object's stroke (one of "bevel", "round", "miter")
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineJoin`](/api/classes/fabricobject/#strokelinejoin)
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -2050,16 +1687,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeMiterLimit`](/api/classes/fabricobject/#strokemiterlimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -2089,16 +1724,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`strokeUniform`](/api/classes/fabricobject/#strokeuniform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -2115,19 +1748,17 @@ Width of a stroke used to render this object
[`FabricObject`](/api/classes/fabricobject/).[`strokeWidth`](/api/classes/fabricobject/#strokewidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -2143,16 +1774,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`top`](/api/classes/fabricobject/#top)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -2169,16 +1798,14 @@ Size of object's controlling corners when touch interaction is detected
[`FabricObject`](/api/classes/fabricobject/).[`touchCornerSize`](/api/classes/fabricobject/#touchcornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -2195,23 +1822,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`transparentCorners`](/api/classes/fabricobject/#transparentcorners)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### visible
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Implementation of
@@ -2221,23 +1840,15 @@ When set to `false`, an object is not rendered on canvas
[`FabricObject`](/api/classes/fabricobject/).[`visible`](/api/classes/fabricobject/#visible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Implementation of
@@ -2247,38 +1858,28 @@ Object width
[`FabricObject`](/api/classes/fabricobject/).[`width`](/api/classes/fabricobject/#width)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
-
***
### ATTRIBUTE\_NAMES
> `static` **ATTRIBUTE\_NAMES**: `string`[]
-List of attribute names to account for when parsing SVG element (used by [Ellipse.fromElement](../../../../api/classes/ellipse/#fromelement))
-
-#### Static
+Defined in: [src/shapes/Ellipse.ts:154](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L154)
-#### Member Of
-
-Ellipse
+List of attribute names to account for when parsing SVG element (used by [Ellipse.fromElement](/api/classes/ellipse/#fromelement))
#### See
http://www.w3.org/TR/SVG/shapes.html#EllipseElement
-#### Defined in
-
-[src/shapes/Ellipse.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L158)
-
-***
+***
### cacheProperties
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Ellipse.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L51)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -2288,32 +1889,28 @@ and refreshed at the next render
[`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties)
-#### Defined in
-
-[src/shapes/Ellipse.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L53)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`colorProperties`](/api/classes/fabricobject/#colorproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -2321,30 +1918,26 @@ instance.toObject() gets called
[`FabricObject`](/api/classes/fabricobject/).[`customProperties`](/api/classes/fabricobject/#customproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
-> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Ellipse`](/api/classes/ellipse/)\<`Partial`\<[`EllipseProps`](/api/interfaces/ellipseprops/)\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `ellipseDefaultValues`
+> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Ellipse`\<`Partial`\<[`EllipseProps`](/api/interfaces/ellipseprops/)\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `ellipseDefaultValues`
+
+Defined in: [src/shapes/Ellipse.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L53)
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults)
-#### Defined in
-
-[src/shapes/Ellipse.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L55)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2353,16 +1946,14 @@ needs its cache regenerated during a .set call
[`FabricObject`](/api/classes/fabricobject/).[`stateProperties`](/api/classes/fabricobject/#stateproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'Ellipse'`
+Defined in: [src/shapes/Ellipse.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L49)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -2376,22 +1967,22 @@ We do not do that in fabricJS code because we want to try to have code splitting
[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type)
-#### Defined in
-
-[src/shapes/Ellipse.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L51)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2399,23 +1990,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type-1)
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type-1)
## Methods
@@ -2423,15 +2020,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
-• **context**: `DrawContext`
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2441,51 +2046,44 @@ Prepare clipPath state and cache and draw it on instance's cache
[`FabricObject`](/api/classes/fabricobject/).[`_drawClipPath`](/api/classes/fabricobject/#_drawclippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`_limitCacheSize`](/api/classes/fabricobject/#_limitcachesize)
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2496,26 +2094,28 @@ Remove cacheCanvas and its dimensions from the objects
[`FabricObject`](/api/classes/fabricobject/).[`_removeCacheCanvas`](/api/classes/fabricobject/#_removecachecanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2531,19 +2131,19 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_renderControls`](/api/classes/fabricobject/#_rendercontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2553,21 +2153,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setClippingProperties`](/api/classes/fabricobject/#_setclippingproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **\_\_namedParameters**: `Pick`\<[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+##### \_\_namedParameters
+
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2577,21 +2179,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setFillStyles`](/api/classes/fabricobject/#_setfillstyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### decl
-• **decl**: `Pick`\<[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2601,22 +2205,22 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setStrokeStyles`](/api/classes/fabricobject/#_setstrokestyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2628,16 +2232,14 @@ Rendering canvas context
[`FabricObject`](/api/classes/fabricobject/).[`_setupCompositeOperation`](/api/classes/fabricobject/#_setupcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_toSVG()
> **\_toSVG**(): `string`[]
+Defined in: [src/shapes/Ellipse.ts:127](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L127)
+
Returns svg representation of an instance
#### Returns
@@ -2651,19 +2253,19 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg)
-#### Defined in
-
-[src/shapes/Ellipse.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L129)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2673,33 +2275,37 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`addPaintOrder`](/api/classes/fabricobject/#addpaintorder)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2708,24 +2314,22 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`animate`](/api/classes/fabricobject/#animate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -2737,16 +2341,14 @@ those never change with zoom or viewport changes.
[`FabricObject`](/api/classes/fabricobject/).[`calcACoords`](/api/classes/fabricobject/#calcacoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -2760,16 +2362,14 @@ is a public api and should be done just if extremely necessary
[`FabricObject`](/api/classes/fabricobject/).[`calcOCoords`](/api/classes/fabricobject/#calcocoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -2783,22 +2383,22 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcOwnMatrix`](/api/classes/fabricobject/#calcownmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -2813,21 +2413,21 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcTransformMatrix`](/api/classes/fabricobject/#calctransformmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -2839,15 +2439,13 @@ true if the object currently dragged can be dropped on the target
[`FabricObject`](/api/classes/fabricobject/).[`canDrop`](/api/classes/fabricobject/#candrop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -2856,7 +2454,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -2875,41 +2475,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
[`FabricObject`](/api/classes/fabricobject/).[`clearContextTop`](/api/classes/fabricobject/#clearcontexttop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`Ellipse`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>\>
+`Promise`\<`Ellipse`\<`Props`, `SProps`, `EventSpec`\>\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`clone`](/api/classes/fabricobject/#clone)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -2920,13 +2518,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -2938,16 +2538,14 @@ fix the export type, it could not be Image but the type that getClass return for
[`FabricObject`](/api/classes/fabricobject/).[`cloneAsImage`](/api/classes/fabricobject/#cloneasimage)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:1426](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1426)
+
Returns complexity of an instance
#### Returns
@@ -2960,21 +2558,21 @@ complexity of this instance (is 1 unless subclassed)
[`FabricObject`](/api/classes/fabricobject/).[`complexity`](/api/classes/fabricobject/#complexity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1460](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1460)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -2988,16 +2586,14 @@ true if point is inside the object
[`FabricObject`](/api/classes/fabricobject/).[`containsPoint`](/api/classes/fabricobject/#containspoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1494)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -3009,15 +2605,13 @@ override if necessary to dispose artifacts such as `clipPath`
[`FabricObject`](/api/classes/fabricobject/).[`dispose`](/api/classes/fabricobject/#dispose)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1528)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -3025,15 +2619,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -3045,23 +2645,25 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawBorders`](/api/classes/fabricobject/#drawborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -3073,27 +2675,31 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawCacheOnCanvas`](/api/classes/fabricobject/#drawcacheoncanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
+
+[`BaseFabricObject`](/api/classes/basefabricobject/)
-• **canvasWithClipPath**: `HTMLCanvasElement`
+##### canvasWithClipPath
+
+`HTMLCanvasElement`
#### Returns
@@ -3103,16 +2709,14 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawClipPathOnCache`](/api/classes/fabricobject/#drawclippathoncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -3122,11 +2726,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -3138,27 +2746,29 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawControls`](/api/classes/fabricobject/#drawcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -3170,29 +2780,33 @@ object size x = width, y = height
[`FabricObject`](/api/classes/fabricobject/).[`drawControlsConnectingLines`](/api/classes/fabricobject/#drawcontrolsconnectinglines)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -3204,16 +2818,14 @@ additional context for rendering
[`FabricObject`](/api/classes/fabricobject/).[`drawObject`](/api/classes/fabricobject/#drawobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -3221,7 +2833,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -3239,25 +2853,27 @@ it seemed a good option, now is an edge case
[`FabricObject`](/api/classes/fabricobject/).[`drawSelectionBackground`](/api/classes/fabricobject/#drawselectionbackground)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3269,29 +2885,33 @@ an object that represent the ancestry situation.
[`FabricObject`](/api/classes/fabricobject/).[`findCommonAncestors`](/api/classes/fabricobject/#findcommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -3303,22 +2923,22 @@ Options object
[`FabricObject`](/api/classes/fabricobject/).[`fire`](/api/classes/fabricobject/#fire)
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3330,21 +2950,21 @@ function to iterate over the controls over
[`FabricObject`](/api/classes/fabricobject/).[`forEachControl`](/api/classes/fabricobject/#foreachcontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3358,34 +2978,30 @@ value of a property
[`FabricObject`](/api/classes/fabricobject/).[`get`](/api/classes/fabricobject/#get)
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getActiveControl`](/api/classes/fabricobject/#getactivecontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3396,16 +3012,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
[`FabricObject`](/api/classes/fabricobject/).[`getAncestors`](/api/classes/fabricobject/#getancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3419,16 +3033,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getBoundingRect`](/api/classes/fabricobject/#getboundingrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3437,16 +3049,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getCanvasRetinaScaling`](/api/classes/fabricobject/#getcanvasretinascaling)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3457,16 +3067,14 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCenterPoint`](/api/classes/fabricobject/#getcenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -3477,16 +3085,14 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCoords`](/api/classes/fabricobject/#getcoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -3497,16 +3103,14 @@ Return the object opacity counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getObjectOpacity`](/api/classes/fabricobject/#getobjectopacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
@@ -3517,16 +3121,14 @@ Return the object scale factor counting also the group scaling
[`FabricObject`](/api/classes/fabricobject/).[`getObjectScaling`](/api/classes/fabricobject/#getobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -3536,11 +3138,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3552,16 +3158,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`getPointByOrigin`](/api/classes/fabricobject/#getpointbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -3572,110 +3176,98 @@ Returns the center coordinates of the object relative to it's parent
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeCenterPoint`](/api/classes/fabricobject/#getrelativecenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/ellipse/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/ellipse/#getx)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeX`](/api/classes/fabricobject/#getrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeXY`](/api/classes/fabricobject/#getrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/ellipse/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/ellipse/#gety)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeY`](/api/classes/fabricobject/#getrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getRx()
> **getRx**(): `number`
+Defined in: [src/shapes/Ellipse.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L98)
+
Returns horizontal radius of an object (according to how an object is scaled)
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Ellipse.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L100)
-
***
### getRy()
> **getRy**(): `number`
+Defined in: [src/shapes/Ellipse.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L106)
+
Returns Vertical radius of an object (according to how an object is scaled)
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Ellipse.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L108)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -3692,16 +3284,14 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledHeight`](/api/classes/fabricobject/#getscaledheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -3718,21 +3308,21 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledWidth`](/api/classes/fabricobject/#getscaledwidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -3742,21 +3332,21 @@ Returns id attribute for svg output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgCommons`](/api/classes/fabricobject/#getsvgcommons)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3766,25 +3356,27 @@ Returns filter for svg shadow
[`FabricObject`](/api/classes/fabricobject/).[`getSvgFilter`](/api/classes/fabricobject/#getsvgfilter)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### getSvgStyles()
-> **getSvgStyles**(`this`, `skipShadow`?): `string`
+> **getSvgStyles**(`this`, `skipShadow?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L22)
Returns styles-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
-• **skipShadow?**: `boolean`
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-a boolean to skip shadow filter output
+##### skipShadow?
+
+`boolean`
+
+a boolean to skip shadow filter output
#### Returns
@@ -3794,25 +3386,29 @@ a boolean to skip shadow filter output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgStyles`](/api/classes/fabricobject/#getsvgstyles)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L21)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **full?**: `boolean`
+##### full?
-• **additionalTransform?**: `string` = `''`
+`boolean`
+
+##### additionalTransform?
+
+`string` = `''`
#### Returns
@@ -3822,16 +3418,14 @@ Returns transform-string for svg-export
[`FabricObject`](/api/classes/fabricobject/).[`getSvgTransform`](/api/classes/fabricobject/#getsvgtransform)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -3842,16 +3436,14 @@ Returns the object angle relative to canvas counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getTotalAngle`](/api/classes/fabricobject/#gettotalangle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -3864,16 +3456,14 @@ object with scaleX and scaleY properties
[`FabricObject`](/api/classes/fabricobject/).[`getTotalObjectScaling`](/api/classes/fabricobject/#gettotalobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -3884,83 +3474,79 @@ Retrieves viewportTransform from Object's canvas if available
[`FabricObject`](/api/classes/fabricobject/).[`getViewportTransform`](/api/classes/fabricobject/#getviewporttransform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getX`](/api/classes/fabricobject/#getx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getXY`](/api/classes/fabricobject/#getxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getY`](/api/classes/fabricobject/#gety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3970,15 +3556,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy
[`FabricObject`](/api/classes/fabricobject/).[`hasCommonAncestors`](/api/classes/fabricobject/#hascommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3989,7 +3573,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4001,15 +3585,13 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasFill`](/api/classes/fabricobject/#hasfill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -4020,7 +3602,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4032,21 +3614,21 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasStroke`](/api/classes/fabricobject/#hasstroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4060,23 +3642,25 @@ true if object intersects with another object
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithObject`](/api/classes/fabricobject/#intersectswithobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -4086,21 +3670,24 @@ Checks if object intersects with the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithRect`](/api/classes/fabricobject/#intersectswithrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -4113,21 +3700,21 @@ on parent canvas.
[`FabricObject`](/api/classes/fabricobject/).[`isCacheDirty`](/api/classes/fabricobject/#iscachedirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4141,23 +3728,25 @@ true if object is fully contained within area of another object
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinObject`](/api/classes/fabricobject/#iscontainedwithinobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
+
+##### br
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -4167,21 +3756,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinRect`](/api/classes/fabricobject/#iscontainedwithinrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -4196,22 +3785,22 @@ true if the specified control is visible, false otherwise
[`FabricObject`](/api/classes/fabricobject/).[`isControlVisible`](/api/classes/fabricobject/#iscontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -4221,23 +3810,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
[`FabricObject`](/api/classes/fabricobject/).[`isDescendantOf`](/api/classes/fabricobject/#isdescendantof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -4251,16 +3842,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isInFrontOf`](/api/classes/fabricobject/#isinfrontof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -4269,16 +3860,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isNotVisible`](/api/classes/fabricobject/#isnotvisible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -4292,23 +3881,25 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOnScreen`](/api/classes/fabricobject/#isonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4318,16 +3909,14 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOverlapping`](/api/classes/fabricobject/#isoverlapping)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -4340,41 +3929,51 @@ true if object is partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isPartiallyOnScreen`](/api/classes/fabricobject/#ispartiallyonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`isType`](/api/classes/fabricobject/#istype)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -4390,18 +3989,16 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`needsItsOwnCache`](/api/classes/fabricobject/#needsitsowncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -4412,11 +4009,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -4428,27 +4029,31 @@ event name (eg. 'after:render')
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -4460,19 +4065,19 @@ event listener to unsubscribe
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -4484,14 +4089,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -4502,33 +4105,39 @@ unsubscribe all event listeners
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
-• **E**
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -4546,48 +4155,140 @@ on
[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
+disposer
+
+##### Alias
+
+on
+
##### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
-##### Defined in
+***
+
+### once()
+
+#### Call Signature
+
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
+
+Observes specified event **once**
+
+##### Type Parameters
+
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
+
+###### E
+
+`E`
+
+##### Parameters
+
+###### eventName
+
+`K`
+
+Event name (eg. 'after:render')
+
+###### handler
+
+`TEventCallback`\<`E`\>
+
+Function that receives a notification when an event of the specified type occurs
+
+##### Returns
+
+`VoidFunction`
+
+disposer
+
+##### Alias
+
+once
+
+##### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+
+#### Call Signature
+
+> **once**(`handlers`): `VoidFunction`
+
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
+
+Observes specified event **once**
+
+##### Parameters
+
+###### handlers
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
+
+##### Returns
+
+`VoidFunction`
+
+disposer
+
+##### Alias
+
+once
+
+##### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
***
### onDeselect()
-> **onDeselect**(`_options`?): `boolean`
+> **onDeselect**(`_options?`): `boolean`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658)
This callback function is called every time _discardActiveObject or _setActiveObject
try to to deselect this object. If the function returns true, the process is cancelled
#### Parameters
-• **\_options?**
+##### \_options?
options sent from the upper functions
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### e?
-• **\_options.object?**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+###### object?
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -4597,22 +4298,22 @@ options sent from the upper functions
[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658)
-
***
### onDragStart()
> **onDragStart**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
+
Override to customize Drag behavior\
Fired once a drag session has started
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4624,26 +4325,26 @@ true to handle the drag event
[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
-
***
### onSelect()
-> **onSelect**(`_options`?): `boolean`
+> **onSelect**(`_options?`): `boolean`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
This callback function is called every time _discardActiveObject or _setActiveObject
try to to select this object. If the function returns true, the process is cancelled
#### Parameters
-• **\_options?**
+##### \_options?
options sent from the upper functions
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
event if the process is generated by an event
@@ -4655,137 +4356,75 @@ event if the process is generated by an event
[`FabricObject`](/api/classes/fabricobject/).[`onSelect`](/api/classes/fabricobject/#onselect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
-
***
-### once()
+### render()
-#### once(eventName, handler)
+> **render**(`ctx`): `void`
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/shapes/Object/Object.ts:649](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L649)
-Observes specified event **once**
+Renders an object on a specified context
-##### Type Parameters
+#### Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### ctx
-• **E**
+`CanvasRenderingContext2D`
-##### Parameters
+Context to render on
-• **eventName**: `K`
+#### Returns
-Event name (eg. 'after:render')
+`void`
-• **handler**: `TEventCallback`\<`E`\>
+#### Inherited from
-Function that receives a notification when an event of the specified type occurs
+[`FabricObject`](/api/classes/fabricobject/).[`render`](/api/classes/fabricobject/#render)
-##### Returns
+***
-`VoidFunction`
+### renderCache()
-disposer
+> **renderCache**(`this`, `options?`): `void`
-##### Alias
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
-once
+#### Parameters
-##### Inherited from
+##### this
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+`TCachedFabricObject`
-##### Defined in
+##### options?
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+`any`
-#### once(handlers)
+#### Returns
-> **once**(`handlers`): `VoidFunction`
+`void`
-##### Parameters
+#### Inherited from
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+[`FabricObject`](/api/classes/fabricobject/).[`renderCache`](/api/classes/fabricobject/#rendercache)
-##### Returns
-
-`VoidFunction`
-
-##### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
-
-##### Defined in
-
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
-
-***
-
-### render()
-
-> **render**(`ctx`): `void`
-
-Renders an object on a specified context
-
-#### Parameters
-
-• **ctx**: `CanvasRenderingContext2D`
-
-Context to render on
-
-#### Returns
-
-`void`
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`render`](/api/classes/fabricobject/#render)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:698](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L698)
-
-***
-
-### renderCache()
-
-> **renderCache**(`this`, `options`?): `void`
-
-#### Parameters
-
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
-
-• **options?**: `any`
-
-#### Returns
-
-`void`
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`renderCache`](/api/classes/fabricobject/#rendercache)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
-***
+***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4795,16 +4434,14 @@ example: render the selection status for the part of text that is being dragged
[`FabricObject`](/api/classes/fabricobject/).[`renderDragSourceEffect`](/api/classes/fabricobject/#renderdragsourceeffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -4812,7 +4449,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4822,21 +4461,21 @@ object will change when dropping. example: show the cursor where the text is abo
[`FabricObject`](/api/classes/fabricobject/).[`renderDropTargetEffect`](/api/classes/fabricobject/#renderdroptargeteffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -4848,21 +4487,21 @@ Angle value (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`rotate`](/api/classes/fabricobject/#rotate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -4874,21 +4513,21 @@ Scale factor
[`FabricObject`](/api/classes/fabricobject/).[`scale`](/api/classes/fabricobject/#scale)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -4900,21 +4539,21 @@ New height value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToHeight`](/api/classes/fabricobject/#scaletoheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -4926,102 +4565,102 @@ New width value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToWidth`](/api/classes/fabricobject/#scaletowidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+`Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`set`](/api/classes/fabricobject/#set)
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
-### setControlVisible()
+### setControlsVisibility()
-> **setControlVisible**(`controlKey`, `visible`): `void`
+> **setControlsVisibility**(`options?`): `void`
-Sets the visibility of the specified control.
-please do not use.
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
-#### Parameters
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
-• **controlKey**: `string`
+#### Parameters
-The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
-but since the control api allow for any control name, can be any string.
+##### options?
-• **visible**: `boolean`
+`Record`\<`string`, `boolean`\> = `{}`
-true to set the specified control visible, false otherwise
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
#### Returns
`void`
-#### Todo
+#### Inherited from
-discuss this overlap of priority here with the team. Andrea Bogazzi for details
+[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
-#### Inherited from
+***
-[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
+### setControlVisible()
-#### Defined in
+> **setControlVisible**(`controlKey`, `visible`): `void`
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
-***
+Sets the visibility of the specified control.
+please do not use.
-### setControlsVisibility()
+#### Parameters
-> **setControlsVisibility**(`options`?): `void`
+##### controlKey
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+`string`
-#### Parameters
+The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
+but since the control api allow for any control name, can be any string.
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
+##### visible
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+`boolean`
+
+true to set the specified control visible, false otherwise
#### Returns
`void`
-#### Inherited from
+#### Todo
-[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
+discuss this overlap of priority here with the team. Andrea Bogazzi for details
-#### Defined in
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
+[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
***
@@ -5029,8 +4668,10 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L343)
+
set controls' coordinates as well
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [https://fabric5.fabricjs.com/fabric-gotchas](https://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -5040,16 +4681,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
[`FabricObject`](/api/classes/fabricobject/).[`setCoords`](/api/classes/fabricobject/#setcoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -5063,29 +4702,33 @@ Travis build error about unused variables.
[`FabricObject`](/api/classes/fabricobject/).[`setOnGroup`](/api/classes/fabricobject/#setongroup)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5097,22 +4740,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setPositionByOrigin`](/api/classes/fabricobject/#setpositionbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/ellipse/#setx)
+`number`
+
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/ellipse/#setx)
#### Returns
@@ -5122,29 +4765,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeX`](/api/classes/fabricobject/#setrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
-As [setXY](../../../../api/classes/ellipse/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+As [setXY](/api/classes/ellipse/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -5156,22 +4803,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeXY`](/api/classes/fabricobject/#setrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/ellipse/#sety)
+`number`
+
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/ellipse/#sety)
#### Returns
@@ -5181,21 +4828,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeY`](/api/classes/fabricobject/#setrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+`number`
+
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -5205,15 +4852,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setX`](/api/classes/fabricobject/#setx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -5221,15 +4866,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5247,21 +4898,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
[`FabricObject`](/api/classes/fabricobject/).[`setXY`](/api/classes/fabricobject/#setxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -5271,20 +4922,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setY`](/api/classes/fabricobject/#sety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L775)
+
Decide if the object should cache or not. Create its own cache level
objectCaching is a global flag, wins over everything
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
Read as: cache if is needed, or if the feature is enabled but we are not already caching.
@@ -5296,22 +4945,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
[`FabricObject`](/api/classes/fabricobject/).[`shouldCache`](/api/classes/fabricobject/#shouldcache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L823)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -5323,25 +4972,27 @@ true in order for the window to start a drag session
[`FabricObject`](/api/classes/fabricobject/).[`shouldStartDragging`](/api/classes/fabricobject/#shouldstartdragging)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -5353,9 +5004,27 @@ the control box size used
[`FabricObject`](/api/classes/fabricobject/).[`strokeBorders`](/api/classes/fabricobject/#strokeborders)
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
+`toDataURLOptions` = `{}`
+
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob)
***
@@ -5363,11 +5032,15 @@ the control box size used
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -5381,23 +5054,25 @@ Returns DOM element with the FabricObject
[`FabricObject`](/api/classes/fabricobject/).[`toCanvasElement`](/api/classes/fabricobject/#tocanvaselement)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`this`, `reviver`?): `string`
+> **toClipPathSVG**(`this`, `reviver?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L144)
Returns svg clipPath representation of an instance
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -5411,9 +5086,33 @@ svg representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toClipPathSVG`](/api/classes/fabricobject/#toclippathsvg)
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
+
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143)
+[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
***
@@ -5421,11 +5120,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -5439,37 +5142,31 @@ Returns a data: URL containing a representation of the object in the format spec
[`FabricObject`](/api/classes/fabricobject/).[`toDataURL`](/api/classes/fabricobject/#todataurl)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `Ellipse`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`Ellipse`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
***
@@ -5477,6 +5174,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -5489,27 +5188,31 @@ JSON
[`FabricObject`](/api/classes/fabricobject/).[`toJSON`](/api/classes/fabricobject/#tojson)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps`
+> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps`
+
+Defined in: [src/shapes/Ellipse.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L115)
Returns object representation of an instance
#### Type Parameters
-• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+##### T
-• **K** *extends* `string` \| `number` \| `symbol` = `never`
+`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Ellipse`\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol` = `never`
#### Parameters
-• **propertiesToInclude?**: `K`[] = `[]`
+##### propertiesToInclude?
+
+`K`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -5523,46 +5226,14 @@ object representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject)
-#### Defined in
-
-[src/shapes/Ellipse.ts:117](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L117)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Object/Object.ts:1890](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1890)
+
Returns a string representation of an instance
#### Returns
@@ -5573,35 +5244,37 @@ Returns a string representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1924)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`Ellipse`](/api/classes/ellipse/)\<`Props`, `SProps`, `EventSpec`\>
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
+#### Returns
+
+`string`
-#### Defined in
+svg representation of an instance
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
***
@@ -5609,11 +5282,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -5625,19 +5302,19 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transform`](/api/classes/fabricobject/#transform)
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -5647,29 +5324,33 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transformMatrixKey`](/api/classes/fabricobject/#transformmatrixkey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5681,37 +5362,45 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToCenterPoint`](/api/classes/fabricobject/#translatetocenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5723,29 +5412,33 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToGivenOrigin`](/api/classes/fabricobject/#translatetogivenorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5757,16 +5450,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToOriginPoint`](/api/classes/fabricobject/#translatetooriginpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -5782,25 +5473,29 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`willDrawShadow`](/api/classes/fabricobject/#willdrawshadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
+
+`Record`\<`string`, `unknown`\>
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -5810,16 +5505,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`_fromObject`](/api/classes/fabricobject/#_fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -5836,57 +5529,59 @@ make this function return an empty object and add controls to the ownDefaults
[`FabricObject`](/api/classes/fabricobject/).[`createControls`](/api/classes/fabricobject/#createcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### fromElement()
-> `static` **fromElement**(`element`, `options`, `cssRules`?): `Promise`\<[`Ellipse`](/api/classes/ellipse/)\<`Record`\<`string`, `any`\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Ellipse`\<`Record`\<`string`, `any`\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
-Returns [Ellipse](../../../../api/classes/ellipse) instance from an SVG element
+Defined in: [src/shapes/Ellipse.ts:161](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L161)
-#### Parameters
-
-• **element**: `HTMLElement`
+Returns [Ellipse](/api/classes/ellipse/) instance from an SVG element
-Element to parse
+#### Parameters
-• **options**: [`Abortable`](/api/type-aliases/abortable/)
+##### element
-• **cssRules?**: `CSSRules`
+`HTMLElement`
-#### Returns
+Element to parse
-`Promise`\<[`Ellipse`](/api/classes/ellipse/)\<`Record`\<`string`, `any`\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### options?
-#### Static
+[`Abortable`](/api/type-aliases/abortable/)
-#### Member Of
+##### cssRules?
-Ellipse
+`CSSRules`
-#### Defined in
+#### Returns
-[src/shapes/Ellipse.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L167)
+`Promise`\<`Ellipse`\<`Record`\<`string`, `any`\>, [`SerializedEllipseProps`](/api/interfaces/serializedellipseprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
***
### fromObject()
-> `static` **fromObject**\<`T`\>(`object`, `options`?): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromObject**\<`T`\>(`object`, `options?`): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1932](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1932)
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
#### Parameters
-• **object**: `T`
+##### object
+
+`T`
+
+##### options?
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
+[`Abortable`](/api/type-aliases/abortable/)
#### Returns
@@ -5896,16 +5591,14 @@ Ellipse
[`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1966](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1966)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Ellipse.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L55)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -5913,7 +5606,3 @@ Ellipse
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults)
-
-#### Defined in
-
-[src/shapes/Ellipse.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L57)
diff --git a/src/content/docs/api/classes/FabricImage.md b/src/content/docs/api/classes/FabricImage.md
index 59e0caf6e..a8d03222d 100644
--- a/src/content/docs/api/classes/FabricImage.md
+++ b/src/content/docs/api/classes/FabricImage.md
@@ -5,9 +5,11 @@ prev: false
title: "FabricImage"
---
-## Tutorial
+Defined in: [src/shapes/Image.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L77)
-[http://fabricjs.com/fabric-intro-part-1#images](http://fabricjs.com/fabric-intro-part-1#images)
+## See
+
+[http://fabric5.fabricjs.com/fabric-intro-part-1#images](http://fabric5.fabricjs.com/fabric-intro-part-1#images)
## Extends
@@ -15,11 +17,17 @@ title: "FabricImage"
## Type Parameters
-• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ImageProps`](/api/interfaces/imageprops/)\> = `Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>
+### Props
+
+`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ImageProps`](/api/interfaces/imageprops/)\> = `Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>
+
+### SProps
+
+`SProps` *extends* [`SerializedImageProps`](/api/interfaces/serializedimageprops/) = [`SerializedImageProps`](/api/interfaces/serializedimageprops/)
-• **SProps** *extends* [`SerializedImageProps`](/api/interfaces/serializedimageprops/) = [`SerializedImageProps`](/api/interfaces/serializedimageprops/)
+### EventSpec
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Implements
@@ -27,9 +35,11 @@ title: "FabricImage"
## Constructors
-### new FabricImage()
+### Constructor
-> **new FabricImage**\<`Props`, `SProps`, `EventSpec`\>(`elementId`, `options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+> **new FabricImage**\<`Props`, `SProps`, `EventSpec`\>(`elementId`, `options?`): `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Image.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L193)
Constructor
Image can be initialized with any canvas drawable or a string.
@@ -39,52 +49,56 @@ Please check video element events for seeking.
#### Parameters
-• **elementId**: `string`
+##### elementId
+
+`string`
+
+##### options?
-• **options?**: `Props`
+`Props`
Options object
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
-[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors)
+[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor)
-#### Defined in
+### Constructor
-[src/shapes/Image.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L197)
+> **new FabricImage**\<`Props`, `SProps`, `EventSpec`\>(`element`, `options?`): `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
-### new FabricImage()
-
-> **new FabricImage**\<`Props`, `SProps`, `EventSpec`\>(`element`, `options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+Defined in: [src/shapes/Image.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L194)
#### Parameters
-• **element**: [`ImageSource`](/api/type-aliases/imagesource/)
+##### element
+
+[`ImageSource`](/api/type-aliases/imagesource/)
+
+##### options?
-• **options?**: `Props`
+`Props`
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
`FabricObject.constructor`
-#### Defined in
-
-[src/shapes/Image.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L198)
-
## Properties
### \_\_corner?
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -95,16 +109,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values
[`FabricObject`](/api/classes/fabricobject/).[`__corner`](/api/classes/fabricobject/#__corner)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_controlsVisibility
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -113,19 +125,13 @@ this takes priority over the generic control visibility
[`FabricObject`](/api/classes/fabricobject/).[`_controlsVisibility`](/api/classes/fabricobject/#_controlsvisibility)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_element
> **\_element**: [`ImageSource`](/api/type-aliases/imagesource/)
-#### Defined in
-
-[src/shapes/Image.ts:172](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L172)
+Defined in: [src/shapes/Image.ts:168](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L168)
***
@@ -133,9 +139,7 @@ this takes priority over the generic control visibility
> `optional` **\_filteredEl**: `HTMLCanvasElement`
-#### Defined in
-
-[src/shapes/Image.ts:173](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L173)
+Defined in: [src/shapes/Image.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L169)
***
@@ -143,9 +147,7 @@ this takes priority over the generic control visibility
> **\_originalElement**: [`ImageSource`](/api/type-aliases/imagesource/)
-#### Defined in
-
-[src/shapes/Image.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L174)
+Defined in: [src/shapes/Image.ts:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L170)
***
@@ -153,6 +155,8 @@ this takes priority over the generic control visibility
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -167,37 +171,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
[`FabricObject`](/api/classes/fabricobject/).[`_scaling`](/api/classes/fabricobject/#_scaling)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/fabricimage/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/fabricimage/#calcacoords)
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
***
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -219,9 +200,24 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`absolutePositioned`](/api/classes/fabricobject/#absolutepositioned)
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/fabricimage/#setcoords).
+You can calculate them without updating with [()](/api/classes/fabricimage/#calcacoords)
+
+#### Inherited from
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords)
***
@@ -229,6 +225,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -245,25 +243,17 @@ Angle of rotation of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`angle`](/api/classes/fabricobject/#angle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`backgroundColor`](/api/interfaces/imageprops/#backgroundcolor)
@@ -272,16 +262,14 @@ takes css colors https://www.w3.org/TR/css-color-3/
[`FabricObject`](/api/classes/fabricobject/).[`backgroundColor`](/api/classes/fabricobject/#backgroundcolor)
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -298,16 +286,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`borderColor`](/api/classes/fabricobject/#bordercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -322,16 +308,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
[`FabricObject`](/api/classes/fabricobject/).[`borderDashArray`](/api/classes/fabricobject/#borderdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -348,20 +332,19 @@ Opacity of object's controlling borders when object is active and moving
[`FabricObject`](/api/classes/fabricobject/).[`borderOpacityWhenMoving`](/api/classes/fabricobject/#borderopacitywhenmoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -377,38 +360,28 @@ since there is no way to change the border itself.
[`FabricObject`](/api/classes/fabricobject/).[`borderScaleFactor`](/api/classes/fabricobject/#borderscalefactor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### cacheKey
> **cacheKey**: `string`
+Defined in: [src/shapes/Image.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L137)
+
key used to retrieve the texture representing this image
#### Since
2.0.0
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/shapes/Image.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L138)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -419,12 +392,6 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`centeredRotation`](/api/interfaces/imageprops/#centeredrotation)
@@ -433,16 +400,14 @@ The object method `rotate` will always consider this property and never the canv
[`FabricObject`](/api/classes/fabricobject/).[`centeredRotation`](/api/classes/fabricobject/#centeredrotation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -450,12 +415,6 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`centeredScaling`](/api/interfaces/imageprops/#centeredscaling)
@@ -464,16 +423,14 @@ when being scaled via the controls.
[`FabricObject`](/api/classes/fabricobject/).[`centeredScaling`](/api/classes/fabricobject/#centeredscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -487,16 +444,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
[`FabricObject`](/api/classes/fabricobject/).[`clipPath`](/api/classes/fabricobject/#clippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -504,16 +459,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
[`FabricObject`](/api/classes/fabricobject/).[`clipPathId`](/api/classes/fabricobject/#clippathid)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -521,16 +474,14 @@ controls are added by default_controls.js
[`FabricObject`](/api/classes/fabricobject/).[`controls`](/api/classes/fabricobject/#controls)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -547,16 +498,14 @@ rgb(178,204,255)
[`FabricObject`](/api/classes/fabricobject/).[`cornerColor`](/api/classes/fabricobject/#cornercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -577,16 +526,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`cornerDashArray`](/api/classes/fabricobject/#cornerdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -603,16 +550,14 @@ Size of object's controlling corners (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`cornerSize`](/api/classes/fabricobject/#cornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -633,20 +578,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
[`FabricObject`](/api/classes/fabricobject/).[`cornerStrokeColor`](/api/classes/fabricobject/#cornerstrokecolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -657,10 +604,6 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`cornerStyle`](/api/interfaces/imageprops/#cornerstyle)
@@ -669,68 +612,50 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`cornerStyle`](/api/classes/fabricobject/#cornerstyle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### cropX
> **cropX**: `number`
+Defined in: [src/shapes/Image.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L144)
+
Image crop in pixels from original image size.
#### Since
2.0.0
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`cropX`](/api/interfaces/imageprops/#cropx)
-#### Defined in
-
-[src/shapes/Image.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L146)
-
***
### cropY
> **cropY**: `number`
+Defined in: [src/shapes/Image.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L151)
+
Image crop in pixels from original image size.
#### Since
2.0.0
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`cropY`](/api/interfaces/imageprops/#cropy)
-#### Defined in
-
-[src/shapes/Image.ts:154](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L154)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -744,23 +669,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`dirty`](/api/classes/fabricobject/#dirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Implementation of
@@ -770,28 +687,20 @@ When set to `false`, an object can not be a target of events. All events propaga
[`FabricObject`](/api/classes/fabricobject/).[`evented`](/api/classes/fabricobject/#evented)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`excludeFromExport`](/api/interfaces/imageprops/#excludefromexport)
@@ -800,16 +709,14 @@ When `true`, object is not exported in OBJECT/JSON
[`FabricObject`](/api/classes/fabricobject/).[`excludeFromExport`](/api/classes/fabricobject/#excludefromexport)
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -827,16 +734,14 @@ rgb(0,0,0)
[`FabricObject`](/api/classes/fabricobject/).[`fill`](/api/classes/fabricobject/#fill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -855,30 +760,26 @@ nonzero
[`FabricObject`](/api/classes/fabricobject/).[`fillRule`](/api/classes/fabricobject/#fillrule)
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### filters
-> **filters**: [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>\>[]
+> **filters**: [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>, `Record`\<`string`, `any`\>\>[]
+
+Defined in: [src/shapes/Image.ts:165](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L165)
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`filters`](/api/interfaces/imageprops/#filters)
-#### Defined in
-
-[src/shapes/Image.ts:169](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L169)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -895,16 +796,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipX`](/api/classes/fabricobject/#flipx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -921,23 +820,15 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`flipY`](/api/classes/fabricobject/#flipy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Implementation of
@@ -947,23 +838,15 @@ Composite rule used for canvas globalCompositeOperation
[`FabricObject`](/api/classes/fabricobject/).[`globalCompositeOperation`](/api/classes/fabricobject/#globalcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Implementation of
@@ -973,16 +856,14 @@ When set to `false`, object's controlling borders are not rendered
[`FabricObject`](/api/classes/fabricobject/).[`hasBorders`](/api/classes/fabricobject/#hasborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -999,23 +880,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`hasControls`](/api/classes/fabricobject/#hascontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Implementation of
@@ -1025,16 +898,14 @@ Object height
[`FabricObject`](/api/classes/fabricobject/).[`height`](/api/classes/fabricobject/#height)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -1051,16 +922,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`hoverCursor`](/api/classes/fabricobject/#hovercursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
-
***
### imageSmoothing
> **imageSmoothing**: `boolean`
+Defined in: [src/shapes/Image.ts:159](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L159)
+
Indicates whether this canvas will use image smoothing when painting this image.
Also influence if the cacheCanvas for this image uses imageSmoothing
@@ -1068,33 +937,19 @@ Also influence if the cacheCanvas for this image uses imageSmoothing
4.0.0-beta.11
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`imageSmoothing`](/api/interfaces/imageprops/#imagesmoothing)
-#### Defined in
-
-[src/shapes/Image.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L163)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Implementation of
@@ -1104,16 +959,14 @@ When `false`, default object's values are not included in its serialization
[`FabricObject`](/api/classes/fabricobject/).[`includeDefaultValues`](/api/classes/fabricobject/#includedefaultvalues)
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -1132,16 +985,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`inverted`](/api/classes/fabricobject/#inverted)
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -1149,19 +1000,17 @@ part of the move action.
[`FabricObject`](/api/classes/fabricobject/).[`isMoving`](/api/classes/fabricobject/#ismoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -1177,24 +1026,16 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`left`](/api/classes/fabricobject/#left)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
+
When `true`, object horizontal movement is locked
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`lockMovementX`](/api/interfaces/imageprops/#lockmovementx)
@@ -1203,23 +1044,15 @@ When `true`, object horizontal movement is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockMovementX`](/api/classes/fabricobject/#lockmovementx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
-
***
### lockMovementY
> **lockMovementY**: `boolean`
-When `true`, object vertical movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
-```
+When `true`, object vertical movement is locked
#### Implementation of
@@ -1229,23 +1062,15 @@ When `true`, object vertical movement is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockMovementY`](/api/classes/fabricobject/#lockmovementy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Implementation of
@@ -1255,23 +1080,15 @@ When `true`, object rotation is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockRotation`](/api/classes/fabricobject/#lockrotation)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Implementation of
@@ -1281,23 +1098,15 @@ When `true`, object cannot be flipped by scaling into negative values
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingFlip`](/api/classes/fabricobject/#lockscalingflip)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Implementation of
@@ -1307,23 +1116,15 @@ When `true`, object horizontal scaling is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingX`](/api/classes/fabricobject/#lockscalingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Implementation of
@@ -1333,23 +1134,15 @@ When `true`, object vertical scaling is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockScalingY`](/api/classes/fabricobject/#lockscalingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Implementation of
@@ -1359,23 +1152,15 @@ When `true`, object horizontal skewing is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingX`](/api/classes/fabricobject/#lockskewingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Implementation of
@@ -1385,25 +1170,35 @@ When `true`, object vertical skewing is locked
[`FabricObject`](/api/classes/fabricobject/).[`lockSkewingY`](/api/classes/fabricobject/#lockskewingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`matrixCache`](/api/classes/fabricobject/#matrixcache)
-#### Defined in
+***
+
+### minimumScaleTrigger
+
+> **minimumScaleTrigger**: `number`
+
+Defined in: [src/shapes/Image.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L130)
+
+minimum scale factor under which any resizeFilter is triggered to resize the image
+0 will disable the automatic resize. 1 will trigger automatically always.
+number bigger than 1 are not implemented yet.
+
+#### Implementation of
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
+[`ImageProps`](/api/interfaces/imageprops/).[`minimumScaleTrigger`](/api/interfaces/imageprops/#minimumscaletrigger)
***
@@ -1411,6 +1206,8 @@ storage cache for object full transform matrix
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1427,34 +1224,14 @@ Minimum allowed scale value of an object
[`FabricObject`](/api/classes/fabricobject/).[`minScaleLimit`](/api/classes/fabricobject/#minscalelimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
-***
-
-### minimumScaleTrigger
-
-> **minimumScaleTrigger**: `number`
-
-minimum scale factor under which any resizeFilter is triggered to resize the image
-0 will disable the automatic resize. 1 will trigger automatically always.
-number bigger than 1 are not implemented yet.
-
-#### Implementation of
-
-[`ImageProps`](/api/interfaces/imageprops/).[`minimumScaleTrigger`](/api/interfaces/imageprops/#minimumscaletrigger)
-
-#### Defined in
-
-[src/shapes/Image.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L130)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1471,16 +1248,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`moveCursor`](/api/classes/fabricobject/#movecursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1501,35 +1276,14 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`noScaleCache`](/api/classes/fabricobject/#noscalecache)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1552,9 +1306,22 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`objectCaching`](/api/classes/fabricobject/#objectcaching)
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
+
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+[`FabricObject`](/api/classes/fabricobject/).[`oCoords`](/api/classes/fabricobject/#ocoords)
***
@@ -1562,6 +1329,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1578,16 +1347,14 @@ Opacity of an object
[`FabricObject`](/api/classes/fabricobject/).[`opacity`](/api/classes/fabricobject/#opacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1600,16 +1367,14 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originX`](/api/classes/fabricobject/#originx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1622,32 +1387,28 @@ please use 'center' as value in new projects
[`FabricObject`](/api/classes/fabricobject/).[`originY`](/api/classes/fabricobject/#originy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`ownMatrixCache`](/api/classes/fabricobject/#ownmatrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1664,23 +1425,15 @@ Padding between object and its controlling borders (in pixels)
[`FabricObject`](/api/classes/fabricobject/).[`padding`](/api/classes/fabricobject/#padding)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Implementation of
@@ -1690,16 +1443,14 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
[`FabricObject`](/api/classes/fabricobject/).[`paintFirst`](/api/classes/fabricobject/#paintfirst)
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1707,23 +1458,15 @@ Used to keep the original parent ref when the object has been added to an Active
[`FabricObject`](/api/classes/fabricobject/).[`parent`](/api/classes/fabricobject/#parent)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Implementation of
@@ -1733,40 +1476,34 @@ When set to `true`, objects are "found" on canvas on per-pixel basis rather than
[`FabricObject`](/api/classes/fabricobject/).[`perPixelTargetFind`](/api/classes/fabricobject/#perpixeltargetfind)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### preserveAspectRatio
> **preserveAspectRatio**: `string`
-#### Defined in
-
-[src/shapes/Image.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L165)
+Defined in: [src/shapes/Image.ts:161](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L161)
***
### resizeFilter
-> **resizeFilter**: [`Resize`](/api/namespaces/filters/classes/resize/)
+> **resizeFilter**: [`Resize`](/api/fabric/namespaces/filters/classes/resize/)
+
+Defined in: [src/shapes/Image.ts:166](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L166)
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`resizeFilter`](/api/interfaces/imageprops/#resizefilter)
-#### Defined in
-
-[src/shapes/Image.ts:170](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L170)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1783,16 +1520,14 @@ Object scale factor (horizontal)
[`FabricObject`](/api/classes/fabricobject/).[`scaleX`](/api/classes/fabricobject/#scalex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1809,25 +1544,17 @@ Object scale factor (vertical)
[`FabricObject`](/api/classes/fabricobject/).[`scaleY`](/api/classes/fabricobject/#scaley)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`ImageProps`](/api/interfaces/imageprops/).[`selectable`](/api/interfaces/imageprops/#selectable)
@@ -1836,25 +1563,17 @@ But events still fire on it.
[`FabricObject`](/api/classes/fabricobject/).[`selectable`](/api/classes/fabricobject/#selectable)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1867,16 +1586,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`selectionBackgroundColor`](/api/classes/fabricobject/#selectionbackgroundcolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1893,16 +1610,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`shadow`](/api/classes/fabricobject/#shadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1919,16 +1634,14 @@ Angle of skew on x axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewX`](/api/classes/fabricobject/#skewx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1945,16 +1658,14 @@ Angle of skew on y axes of an object (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`skewY`](/api/classes/fabricobject/#skewy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Implementation of
@@ -1965,16 +1676,14 @@ The angle that an object will lock to while rotating.
[`FabricObject`](/api/classes/fabricobject/).[`snapAngle`](/api/classes/fabricobject/#snapangle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1986,17 +1695,15 @@ When undefined, the snapThreshold will default to the snapAngle.
[`FabricObject`](/api/classes/fabricobject/).[`snapThreshold`](/api/classes/fabricobject/#snapthreshold)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### srcFromAttribute
> **srcFromAttribute**: `boolean`
-When calling [FabricImage.getSrc](../../../../api/classes/fabricimage/#getsrc), return value from element src with `element.getAttribute('src')`.
+Defined in: [src/shapes/Image.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L92)
+
+When calling [FabricImage.getSrc](/api/classes/fabricimage/#getsrc), return value from element src with `element.getAttribute('src')`.
This allows for relative urls as image src.
#### Since
@@ -2013,16 +1720,14 @@ false
[`ImageProps`](/api/interfaces/imageprops/).[`srcFromAttribute`](/api/interfaces/imageprops/#srcfromattribute)
-#### Defined in
-
-[src/shapes/Image.ts:92](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L92)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -2040,16 +1745,14 @@ null
[`FabricObject`](/api/classes/fabricobject/).[`stroke`](/api/classes/fabricobject/#stroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -2066,16 +1769,14 @@ null;
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashArray`](/api/classes/fabricobject/#strokedasharray)
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -2092,16 +1793,14 @@ Line offset of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeDashOffset`](/api/classes/fabricobject/#strokedashoffset)
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -2118,23 +1817,15 @@ butt
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineCap`](/api/classes/fabricobject/#strokelinecap)
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Implementation of
@@ -2144,16 +1835,14 @@ Corner style of an object's stroke (one of "bevel", "round", "miter")
[`FabricObject`](/api/classes/fabricobject/).[`strokeLineJoin`](/api/classes/fabricobject/#strokelinejoin)
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -2170,16 +1859,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
[`FabricObject`](/api/classes/fabricobject/).[`strokeMiterLimit`](/api/classes/fabricobject/#strokemiterlimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -2209,16 +1896,14 @@ false
[`FabricObject`](/api/classes/fabricobject/).[`strokeUniform`](/api/classes/fabricobject/#strokeuniform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -2235,19 +1920,17 @@ Width of a stroke used to render this object
[`FabricObject`](/api/classes/fabricobject/).[`strokeWidth`](/api/classes/fabricobject/#strokewidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -2263,16 +1946,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
[`FabricObject`](/api/classes/fabricobject/).[`top`](/api/classes/fabricobject/#top)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -2289,16 +1970,14 @@ Size of object's controlling corners when touch interaction is detected
[`FabricObject`](/api/classes/fabricobject/).[`touchCornerSize`](/api/classes/fabricobject/#touchcornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -2315,23 +1994,15 @@ true
[`FabricObject`](/api/classes/fabricobject/).[`transparentCorners`](/api/classes/fabricobject/#transparentcorners)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### visible
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Implementation of
@@ -2341,23 +2012,15 @@ When set to `false`, an object is not rendered on canvas
[`FabricObject`](/api/classes/fabricobject/).[`visible`](/api/classes/fabricobject/#visible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Implementation of
@@ -2367,54 +2030,28 @@ Object width
[`FabricObject`](/api/classes/fabricobject/).[`width`](/api/classes/fabricobject/#width)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
-
***
### ATTRIBUTE\_NAMES
> `static` **ATTRIBUTE\_NAMES**: `string`[]
-List of attribute names to account for when parsing SVG element (used by [FabricImage.fromElement](../../../../api/classes/fabricimage/#fromelement))
+Defined in: [src/shapes/Image.ts:759](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L759)
-#### Static
+List of attribute names to account for when parsing SVG element (used by [FabricImage.fromElement](/api/classes/fabricimage/#fromelement))
#### See
[http://www.w3.org/TR/SVG/struct.html#ImageElement](http://www.w3.org/TR/SVG/struct.html#ImageElement)
-#### Defined in
-
-[src/shapes/Image.ts:773](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L773)
-
-***
-
-### CSS\_CANVAS
-
-> `static` **CSS\_CANVAS**: `string` = `'canvas-img'`
-
-Default CSS class name for canvas
-
-#### Static
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/shapes/Image.ts:766](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L766)
-
***
### cacheProperties
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Image.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L174)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -2424,32 +2061,28 @@ and refreshed at the next render
[`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties)
-#### Defined in
-
-[src/shapes/Image.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L178)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`colorProperties`](/api/classes/fabricobject/#colorproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -2457,30 +2090,26 @@ instance.toObject() gets called
[`FabricObject`](/api/classes/fabricobject/).[`customProperties`](/api/classes/fabricobject/#customproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
-> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `imageDefaultValues`
+> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `imageDefaultValues`
+
+Defined in: [src/shapes/Image.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L176)
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults)
-#### Defined in
-
-[src/shapes/Image.ts:180](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L180)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2489,16 +2118,14 @@ needs its cache regenerated during a .set call
[`FabricObject`](/api/classes/fabricobject/).[`stateProperties`](/api/classes/fabricobject/#stateproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'Image'`
+Defined in: [src/shapes/Image.ts:172](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L172)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -2512,22 +2139,22 @@ We do not do that in fabricJS code because we want to try to have code splitting
[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type)
-#### Defined in
-
-[src/shapes/Image.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L176)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2535,23 +2162,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-[`FabricObject`](/api/classes/fabricobject/).[`type`](/api/classes/fabricobject/#type-1)
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#type-1)
## Methods
@@ -2559,15 +2192,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### clipPath
+
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### context
-• **context**: `DrawContext`
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2577,51 +2218,44 @@ Prepare clipPath state and cache and draw it on instance's cache
[`FabricObject`](/api/classes/fabricobject/).[`_drawClipPath`](/api/classes/fabricobject/#_drawclippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`_limitCacheSize`](/api/classes/fabricobject/#_limitcachesize)
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2632,26 +2266,28 @@ Remove cacheCanvas and its dimensions from the objects
[`FabricObject`](/api/classes/fabricobject/).[`_removeCacheCanvas`](/api/classes/fabricobject/#_removecachecanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2667,19 +2303,19 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_renderControls`](/api/classes/fabricobject/#_rendercontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2689,21 +2325,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setClippingProperties`](/api/classes/fabricobject/#_setclippingproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **\_\_namedParameters**: `Pick`\<[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+##### \_\_namedParameters
+
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2713,21 +2351,23 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setFillStyles`](/api/classes/fabricobject/#_setfillstyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **decl**: `Pick`\<[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+`CanvasRenderingContext2D`
+
+##### decl
+
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2737,22 +2377,22 @@ move to interactivity
[`FabricObject`](/api/classes/fabricobject/).[`_setStrokeStyles`](/api/classes/fabricobject/#_setstrokestyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2764,16 +2404,14 @@ Rendering canvas context
[`FabricObject`](/api/classes/fabricobject/).[`_setupCompositeOperation`](/api/classes/fabricobject/#_setupcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_toSVG()
> **\_toSVG**(): `string`[]
+Defined in: [src/shapes/Image.ts:360](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L360)
+
Returns svg representation of an instance
#### Returns
@@ -2787,19 +2425,19 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg)
-#### Defined in
-
-[src/shapes/Image.ts:365](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L365)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2809,33 +2447,37 @@ of the instance
[`FabricObject`](/api/classes/fabricobject/).[`addPaintOrder`](/api/classes/fabricobject/#addpaintorder)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2844,29 +2486,29 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`animate`](/api/classes/fabricobject/#animate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### applyFilters()
> **applyFilters**(`filters`): `void`
+Defined in: [src/shapes/Image.ts:516](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L516)
+
Applies filters assigned to this image (from "filters" array) or from filter param
#### Parameters
-• **filters**: [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>\>[] = `...`
+##### filters
+
+[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `Record`\<`string`, `any`\>, `Record`\<`string`, `any`\>\>[] = `...`
to be applied
@@ -2874,34 +2516,26 @@ to be applied
`void`
-#### Method
-
-applyFilters
-
-#### Defined in
-
-[src/shapes/Image.ts:522](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L522)
-
***
### applyResizeFilters()
> **applyResizeFilters**(): `void`
+Defined in: [src/shapes/Image.ts:477](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L477)
+
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Image.ts:482](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L482)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -2913,16 +2547,14 @@ those never change with zoom or viewport changes.
[`FabricObject`](/api/classes/fabricobject/).[`calcACoords`](/api/classes/fabricobject/#calcacoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -2936,16 +2568,14 @@ is a public api and should be done just if extremely necessary
[`FabricObject`](/api/classes/fabricobject/).[`calcOCoords`](/api/classes/fabricobject/#calcocoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -2959,22 +2589,22 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcOwnMatrix`](/api/classes/fabricobject/#calcownmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -2989,21 +2619,21 @@ transform matrix for the object
[`FabricObject`](/api/classes/fabricobject/).[`calcTransformMatrix`](/api/classes/fabricobject/#calctransformmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -3015,15 +2645,13 @@ true if the object currently dragged can be dropped on the target
[`FabricObject`](/api/classes/fabricobject/).[`canDrop`](/api/classes/fabricobject/#candrop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -3032,7 +2660,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -3051,41 +2681,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
[`FabricObject`](/api/classes/fabricobject/).[`clearContextTop`](/api/classes/fabricobject/#clearcontexttop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`FabricImage`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>\>
+`Promise`\<`FabricImage`\<`Props`, `SProps`, `EventSpec`\>\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`clone`](/api/classes/fabricobject/#clone)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): `FabricImage`
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -3096,13 +2724,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`FabricImage`
Object cloned as image.
@@ -3114,16 +2744,14 @@ fix the export type, it could not be Image but the type that getClass return for
[`FabricObject`](/api/classes/fabricobject/).[`cloneAsImage`](/api/classes/fabricobject/#cloneasimage)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:1426](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1426)
+
Returns complexity of an instance
#### Returns
@@ -3136,21 +2764,21 @@ complexity of this instance (is 1 unless subclassed)
[`FabricObject`](/api/classes/fabricobject/).[`complexity`](/api/classes/fabricobject/#complexity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1460](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1460)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -3164,16 +2792,14 @@ true if point is inside the object
[`FabricObject`](/api/classes/fabricobject/).[`containsPoint`](/api/classes/fabricobject/#containspoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Image.ts:257](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L257)
+
Delete textures, reference to elements and eventually JSDOM cleanup
#### Returns
@@ -3184,15 +2810,13 @@ Delete textures, reference to elements and eventually JSDOM cleanup
[`FabricObject`](/api/classes/fabricobject/).[`dispose`](/api/classes/fabricobject/#dispose)
-#### Defined in
-
-[src/shapes/Image.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L262)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -3200,15 +2824,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -3220,24 +2850,26 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawBorders`](/api/classes/fabricobject/#drawborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Image.ts:598](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L598)
+
Paint the cached copy of the object on the target context.
it will set the imageSmoothing for the draw operation
#### Parameters
-• **this**: `TCachedFabricObject`\<[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **ctx**: `CanvasRenderingContext2D`
+`TCachedFabricObject`\<`FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -3249,27 +2881,31 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawCacheOnCanvas`](/api/classes/fabricobject/#drawcacheoncanvas)
-#### Defined in
-
-[src/shapes/Image.ts:603](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L603)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
+
+[`BaseFabricObject`](/api/classes/basefabricobject/)
+
+##### canvasWithClipPath
-• **canvasWithClipPath**: `HTMLCanvasElement`
+`HTMLCanvasElement`
#### Returns
@@ -3279,16 +2915,14 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`drawClipPathOnCache`](/api/classes/fabricobject/#drawclippathoncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -3298,11 +2932,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -3314,27 +2952,29 @@ object to override the object style
[`FabricObject`](/api/classes/fabricobject/).[`drawControls`](/api/classes/fabricobject/#drawcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -3346,29 +2986,33 @@ object size x = width, y = height
[`FabricObject`](/api/classes/fabricobject/).[`drawControlsConnectingLines`](/api/classes/fabricobject/#drawcontrolsconnectinglines)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -3380,16 +3024,14 @@ additional context for rendering
[`FabricObject`](/api/classes/fabricobject/).[`drawObject`](/api/classes/fabricobject/#drawobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -3397,7 +3039,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -3415,25 +3059,27 @@ it seemed a good option, now is an edge case
[`FabricObject`](/api/classes/fabricobject/).[`drawSelectionBackground`](/api/classes/fabricobject/#drawselectionbackground)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3445,29 +3091,33 @@ an object that represent the ancestry situation.
[`FabricObject`](/api/classes/fabricobject/).[`findCommonAncestors`](/api/classes/fabricobject/#findcommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -3479,22 +3129,22 @@ Options object
[`FabricObject`](/api/classes/fabricobject/).[`fire`](/api/classes/fabricobject/#fire)
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3506,21 +3156,21 @@ function to iterate over the controls over
[`FabricObject`](/api/classes/fabricobject/).[`forEachControl`](/api/classes/fabricobject/#foreachcontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3534,34 +3184,30 @@ value of a property
[`FabricObject`](/api/classes/fabricobject/).[`get`](/api/classes/fabricobject/#get)
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getActiveControl`](/api/classes/fabricobject/#getactivecontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3572,16 +3218,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
[`FabricObject`](/api/classes/fabricobject/).[`getAncestors`](/api/classes/fabricobject/#getancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3595,16 +3239,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getBoundingRect`](/api/classes/fabricobject/#getboundingrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3613,16 +3255,14 @@ Object with left, top, width, height properties
[`FabricObject`](/api/classes/fabricobject/).[`getCanvasRetinaScaling`](/api/classes/fabricobject/#getcanvasretinascaling)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3633,16 +3273,14 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCenterPoint`](/api/classes/fabricobject/#getcenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -3653,48 +3291,42 @@ Returns the center coordinates of the object relative to canvas
[`FabricObject`](/api/classes/fabricobject/).[`getCoords`](/api/classes/fabricobject/#getcoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getCrossOrigin()
> **getCrossOrigin**(): `null` \| `string`
+Defined in: [src/shapes/Image.ts:275](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L275)
+
Get the crossOrigin value (of the corresponding image element)
#### Returns
`null` \| `string`
-#### Defined in
-
-[src/shapes/Image.ts:280](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L280)
-
-***
+***
### getElement()
> **getElement**(): [`ImageSource`](/api/type-aliases/imagesource/)
+Defined in: [src/shapes/Image.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L215)
+
Returns image element which this instance if based on
#### Returns
[`ImageSource`](/api/type-aliases/imagesource/)
-#### Defined in
-
-[src/shapes/Image.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L219)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -3705,16 +3337,14 @@ Return the object opacity counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getObjectOpacity`](/api/classes/fabricobject/#getobjectopacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
@@ -3725,16 +3355,14 @@ Return the object scale factor counting also the group scaling
[`FabricObject`](/api/classes/fabricobject/).[`getObjectScaling`](/api/classes/fabricobject/#getobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getOriginalSize()
> **getOriginalSize**(): `object`
+Defined in: [src/shapes/Image.ts:285](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L285)
+
Returns original size of an image
#### Returns
@@ -3749,16 +3377,14 @@ Returns original size of an image
> **width**: `any`
-#### Defined in
-
-[src/shapes/Image.ts:290](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L290)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -3768,11 +3394,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3784,16 +3414,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`getPointByOrigin`](/api/classes/fabricobject/#getpointbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -3804,78 +3432,70 @@ Returns the center coordinates of the object relative to it's parent
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeCenterPoint`](/api/classes/fabricobject/#getrelativecenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/fabricimage/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/fabricimage/#getx)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeX`](/api/classes/fabricobject/#getrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeXY`](/api/classes/fabricobject/#getrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/fabricimage/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/fabricimage/#gety)
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getRelativeY`](/api/classes/fabricobject/#getrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -3892,16 +3512,14 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledHeight`](/api/classes/fabricobject/#getscaledheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -3918,21 +3536,21 @@ shouldn't this account for group transform and return the actual size in canvas
[`FabricObject`](/api/classes/fabricobject/).[`getScaledWidth`](/api/classes/fabricobject/#getscaledwidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSrc()
-> **getSrc**(`filtered`?): `string`
+> **getSrc**(`filtered?`): `string`
+
+Defined in: [src/shapes/Image.ts:430](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L430)
Returns source of an image
#### Parameters
-• **filtered?**: `boolean`
+##### filtered?
+
+`boolean`
indicates if the src is needed for svg
@@ -3942,21 +3560,21 @@ indicates if the src is needed for svg
Source of an image
-#### Defined in
-
-[src/shapes/Image.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L435)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -3966,21 +3584,21 @@ Returns id attribute for svg output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgCommons`](/api/classes/fabricobject/#getsvgcommons)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3990,15 +3608,13 @@ Returns filter for svg shadow
[`FabricObject`](/api/classes/fabricobject/).[`getSvgFilter`](/api/classes/fabricobject/#getsvgfilter)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### ~~getSvgSrc()~~
-> **getSvgSrc**(`filtered`?): `string`
+> **getSvgSrc**(`filtered?`): `string`
+
+Defined in: [src/shapes/Image.ts:452](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L452)
Alias for getSrc
@@ -4008,29 +3624,33 @@ This API is no longer supported and may be removed in a future release.
#### Parameters
-• **filtered?**: `boolean`
+##### filtered?
+
+`boolean`
#### Returns
`string`
-#### Defined in
-
-[src/shapes/Image.ts:457](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L457)
-
***
### getSvgStyles()
-> **getSvgStyles**(`this`, `skipShadow`?): `string`
+> **getSvgStyles**(`this`, `skipShadow?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L22)
Returns styles-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **skipShadow?**: `boolean`
+##### skipShadow?
+
+`boolean`
a boolean to skip shadow filter output
@@ -4042,25 +3662,29 @@ a boolean to skip shadow filter output
[`FabricObject`](/api/classes/fabricobject/).[`getSvgStyles`](/api/classes/fabricobject/#getsvgstyles)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L21)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **full?**: `boolean`
+##### full?
-• **additionalTransform?**: `string` = `''`
+`boolean`
+
+##### additionalTransform?
+
+`string` = `''`
#### Returns
@@ -4070,16 +3694,14 @@ Returns transform-string for svg-export
[`FabricObject`](/api/classes/fabricobject/).[`getSvgTransform`](/api/classes/fabricobject/#getsvgtransform)
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -4090,16 +3712,14 @@ Returns the object angle relative to canvas counting also the group property
[`FabricObject`](/api/classes/fabricobject/).[`getTotalAngle`](/api/classes/fabricobject/#gettotalangle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -4112,16 +3732,14 @@ object with scaleX and scaleY properties
[`FabricObject`](/api/classes/fabricobject/).[`getTotalObjectScaling`](/api/classes/fabricobject/#gettotalobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -4132,83 +3750,79 @@ Retrieves viewportTransform from Object's canvas if available
[`FabricObject`](/api/classes/fabricobject/).[`getViewportTransform`](/api/classes/fabricobject/#getviewporttransform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getX`](/api/classes/fabricobject/#getx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getXY`](/api/classes/fabricobject/#getxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`getY`](/api/classes/fabricobject/#gety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4218,31 +3832,27 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy
[`FabricObject`](/api/classes/fabricobject/).[`hasCommonAncestors`](/api/classes/fabricobject/#hascommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasCrop()
> **hasCrop**(): `boolean`
+Defined in: [src/shapes/Image.ts:346](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L346)
+
Returns true if an image has crop applied, inspecting values of cropX,cropY,width,height.
#### Returns
`boolean`
-#### Defined in
-
-[src/shapes/Image.ts:351](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L351)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -4253,7 +3863,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4265,15 +3875,13 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasFill`](/api/classes/fabricobject/#hasfill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -4284,7 +3892,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4296,21 +3904,21 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`hasStroke`](/api/classes/fabricobject/#hasstroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4324,23 +3932,25 @@ true if object intersects with another object
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithObject`](/api/classes/fabricobject/#intersectswithobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
+
+##### br
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -4350,21 +3960,24 @@ Checks if object intersects with the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`intersectsWithRect`](/api/classes/fabricobject/#intersectswithrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -4377,21 +3990,21 @@ on parent canvas.
[`FabricObject`](/api/classes/fabricobject/).[`isCacheDirty`](/api/classes/fabricobject/#iscachedirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4405,23 +4018,25 @@ true if object is fully contained within area of another object
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinObject`](/api/classes/fabricobject/#iscontainedwithinobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -4431,21 +4046,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
[`FabricObject`](/api/classes/fabricobject/).[`isContainedWithinRect`](/api/classes/fabricobject/#iscontainedwithinrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -4460,22 +4075,22 @@ true if the specified control is visible, false otherwise
[`FabricObject`](/api/classes/fabricobject/).[`isControlVisible`](/api/classes/fabricobject/#iscontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -4485,23 +4100,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
[`FabricObject`](/api/classes/fabricobject/).[`isDescendantOf`](/api/classes/fabricobject/#isdescendantof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -4515,16 +4132,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isInFrontOf`](/api/classes/fabricobject/#isinfrontof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -4533,16 +4150,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`FabricObject`](/api/classes/fabricobject/).[`isNotVisible`](/api/classes/fabricobject/#isnotvisible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -4556,23 +4171,25 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOnScreen`](/api/classes/fabricobject/#isonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4582,16 +4199,14 @@ true if object is fully or partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isOverlapping`](/api/classes/fabricobject/#isoverlapping)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -4604,41 +4219,51 @@ true if object is partially contained within canvas
[`FabricObject`](/api/classes/fabricobject/).[`isPartiallyOnScreen`](/api/classes/fabricobject/#ispartiallyonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`isType`](/api/classes/fabricobject/#istype)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -4654,18 +4279,16 @@ Boolean
[`FabricObject`](/api/classes/fabricobject/).[`needsItsOwnCache`](/api/classes/fabricobject/#needsitsowncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -4676,11 +4299,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -4692,27 +4319,31 @@ event name (eg. 'after:render')
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -4724,19 +4355,19 @@ event listener to unsubscribe
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -4748,14 +4379,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -4766,33 +4395,39 @@ unsubscribe all event listeners
[`FabricObject`](/api/classes/fabricobject/).[`off`](/api/classes/fabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
-• **E**
+`K` *extends* `string` \| `number` \| `symbol`
+
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -4810,182 +4445,206 @@ on
[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
-##### Inherited from
+disposer
-[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
+##### Alias
+
+on
-##### Defined in
+##### Inherited from
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+[`FabricObject`](/api/classes/fabricobject/).[`on`](/api/classes/fabricobject/#on)
***
-### onDeselect()
+### once()
-> **onDeselect**(`_options`?): `boolean`
+#### Call Signature
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to deselect this object. If the function returns true, the process is cancelled
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-#### Parameters
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
-• **\_options?**
+Observes specified event **once**
-options sent from the upper functions
+##### Type Parameters
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### K
-• **\_options.object?**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`K` *extends* `string` \| `number` \| `symbol`
-#### Returns
+###### E
-`boolean`
+`E`
-#### Inherited from
+##### Parameters
-[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect)
+###### eventName
-#### Defined in
+`K`
-[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658)
+Event name (eg. 'after:render')
-***
+###### handler
-### onDragStart()
+`TEventCallback`\<`E`\>
-> **onDragStart**(`_e`): `boolean`
+Function that receives a notification when an event of the specified type occurs
-Override to customize Drag behavior\
-Fired once a drag session has started
+##### Returns
-#### Parameters
+`VoidFunction`
-• **\_e**: `DragEvent`
+disposer
-#### Returns
+##### Alias
-`boolean`
+once
-true to handle the drag event
+##### Inherited from
-#### Inherited from
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
-[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart)
+#### Call Signature
-#### Defined in
+> **once**(`handlers`): `VoidFunction`
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
-***
+Observes specified event **once**
-### onSelect()
+##### Parameters
-> **onSelect**(`_options`?): `boolean`
+###### handlers
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to select this object. If the function returns true, the process is cancelled
+`EventRegistryObject`\<`EventSpec`\>
-#### Parameters
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
-• **\_options?**
+##### Returns
-options sent from the upper functions
+`VoidFunction`
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+disposer
-event if the process is generated by an event
+##### Alias
-#### Returns
+once
-`boolean`
+##### Inherited from
-#### Inherited from
+[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
-[`FabricObject`](/api/classes/fabricobject/).[`onSelect`](/api/classes/fabricobject/#onselect)
+***
-#### Defined in
+### onDeselect()
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
+> **onDeselect**(`_options?`): `boolean`
-***
+Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658)
-### once()
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to deselect this object. If the function returns true, the process is cancelled
-#### once(eventName, handler)
+#### Parameters
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+##### \_options?
-Observes specified event **once**
+options sent from the upper functions
-##### Type Parameters
+###### e?
-• **K** *extends* `string` \| `number` \| `symbol`
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
-• **E**
+###### object?
-##### Parameters
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **eventName**: `K`
+#### Returns
-Event name (eg. 'after:render')
+`boolean`
-• **handler**: `TEventCallback`\<`E`\>
+#### Inherited from
-Function that receives a notification when an event of the specified type occurs
+[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect)
-##### Returns
+***
-`VoidFunction`
+### onDragStart()
-disposer
+> **onDragStart**(`_e`): `boolean`
-##### Alias
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
-once
+Override to customize Drag behavior\
+Fired once a drag session has started
-##### Inherited from
+#### Parameters
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+##### \_e
-##### Defined in
+`DragEvent`
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+#### Returns
-#### once(handlers)
+`boolean`
-> **once**(`handlers`): `VoidFunction`
+true to handle the drag event
-##### Parameters
+#### Inherited from
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart)
-##### Returns
+***
-`VoidFunction`
+### onSelect()
-##### Inherited from
+> **onSelect**(`_options?`): `boolean`
-[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once)
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
+
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to select this object. If the function returns true, the process is cancelled
-##### Defined in
+#### Parameters
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+##### \_options?
+
+options sent from the upper functions
+
+###### e?
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+event if the process is generated by an event
+
+#### Returns
+
+`boolean`
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`onSelect`](/api/classes/fabricobject/#onselect)
***
@@ -4993,31 +4652,35 @@ once
> **removeTexture**(`key`): `void`
+Defined in: [src/shapes/Image.ts:247](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L247)
+
Delete a single texture if in webgl mode
#### Parameters
-• **key**: `string`
+##### key
+
+`string`
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Image.ts:252](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L252)
-
***
### render()
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:649](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L649)
+
Renders an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -5029,21 +4692,23 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`render`](/api/classes/fabricobject/#render)
-#### Defined in
-
-[src/shapes/Object/Object.ts:698](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L698)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **options?**: `any`
+##### options?
+
+`any`
#### Returns
@@ -5053,23 +4718,23 @@ Context to render on
[`FabricObject`](/api/classes/fabricobject/).[`renderCache`](/api/classes/fabricobject/#rendercache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -5079,16 +4744,14 @@ example: render the selection status for the part of text that is being dragged
[`FabricObject`](/api/classes/fabricobject/).[`renderDragSourceEffect`](/api/classes/fabricobject/#renderdragsourceeffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -5096,7 +4759,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -5106,21 +4771,21 @@ object will change when dropping. example: show the cursor where the text is abo
[`FabricObject`](/api/classes/fabricobject/).[`renderDropTargetEffect`](/api/classes/fabricobject/#renderdroptargeteffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -5132,21 +4797,21 @@ Angle value (in degrees)
[`FabricObject`](/api/classes/fabricobject/).[`rotate`](/api/classes/fabricobject/#rotate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -5158,21 +4823,21 @@ Scale factor
[`FabricObject`](/api/classes/fabricobject/).[`scale`](/api/classes/fabricobject/#scale)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -5184,21 +4849,21 @@ New height value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToHeight`](/api/classes/fabricobject/#scaletoheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -5210,102 +4875,102 @@ New width value
[`FabricObject`](/api/classes/fabricobject/).[`scaleToWidth`](/api/classes/fabricobject/#scaletowidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
[`FabricObject`](/api/classes/fabricobject/).[`set`](/api/classes/fabricobject/#set)
-#### Defined in
-
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
-
***
-### setControlVisible()
+### setControlsVisibility()
-> **setControlVisible**(`controlKey`, `visible`): `void`
+> **setControlsVisibility**(`options?`): `void`
-Sets the visibility of the specified control.
-please do not use.
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
+
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
#### Parameters
-• **controlKey**: `string`
+##### options?
-The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
-but since the control api allow for any control name, can be any string.
-
-• **visible**: `boolean`
+`Record`\<`string`, `boolean`\> = `{}`
-true to set the specified control visible, false otherwise
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
#### Returns
`void`
-#### Todo
+#### Inherited from
-discuss this overlap of priority here with the team. Andrea Bogazzi for details
+[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
-#### Inherited from
+***
-[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
+### setControlVisible()
-#### Defined in
+> **setControlVisible**(`controlKey`, `visible`): `void`
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
-***
+Sets the visibility of the specified control.
+please do not use.
-### setControlsVisibility()
+#### Parameters
-> **setControlsVisibility**(`options`?): `void`
+##### controlKey
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+`string`
-#### Parameters
+The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
+but since the control api allow for any control name, can be any string.
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
+##### visible
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+`boolean`
+
+true to set the specified control visible, false otherwise
#### Returns
`void`
-#### Inherited from
+#### Todo
-[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility)
+discuss this overlap of priority here with the team. Andrea Bogazzi for details
-#### Defined in
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
+[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible)
***
@@ -5313,8 +4978,10 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L343)
+
set controls' coordinates as well
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [https://fabric5.fabricjs.com/fabric-gotchas](https://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -5324,15 +4991,13 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
[`FabricObject`](/api/classes/fabricobject/).[`setCoords`](/api/classes/fabricobject/#setcoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343)
-
***
### setElement()
-> **setElement**(`element`, `size`?): `void`
+> **setElement**(`element`, `size?`): `void`
+
+Defined in: [src/shapes/Image.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L226)
Sets image element for this instance to a specified one.
If filters defined they are applied to new image.
@@ -5340,9 +5005,13 @@ You might need to call `canvas.renderAll` and `object.setCoords` after replacing
#### Parameters
-• **element**: [`ImageSource`](/api/type-aliases/imagesource/)
+##### element
-• **size?**: `Partial`\<[`TSize`](/api/type-aliases/tsize/)\> = `{}`
+[`ImageSource`](/api/type-aliases/imagesource/)
+
+##### size?
+
+`Partial`\<[`TSize`](/api/type-aliases/tsize/)\> = `{}`
Options object
@@ -5350,16 +5019,14 @@ Options object
`void`
-#### Defined in
-
-[src/shapes/Image.ts:230](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L230)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -5373,29 +5040,33 @@ Travis build error about unused variables.
[`FabricObject`](/api/classes/fabricobject/).[`setOnGroup`](/api/classes/fabricobject/#setongroup)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5407,22 +5078,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setPositionByOrigin`](/api/classes/fabricobject/#setpositionbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/fabricimage/#setx)
+`number`
+
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/fabricimage/#setx)
#### Returns
@@ -5432,29 +5103,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeX`](/api/classes/fabricobject/#setrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
-As [setXY](../../../../api/classes/fabricimage/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+As [setXY](/api/classes/fabricimage/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -5466,22 +5141,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeXY`](/api/classes/fabricobject/#setrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/fabricimage/#sety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/fabricimage/#sety)
#### Returns
@@ -5491,26 +5166,28 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
[`FabricObject`](/api/classes/fabricobject/).[`setRelativeY`](/api/classes/fabricobject/#setrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setSrc()
-> **setSrc**(`src`, `options`?): `Promise`\<`void`\>
+> **setSrc**(`src`, `options?`): `Promise`\<`void`\>
+
+Defined in: [src/shapes/Image.ts:462](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L462)
Loads and sets source of an image\
**IMPORTANT**: It is recommended to abort loading tasks before calling this method to prevent race conditions and unnecessary networking
#### Parameters
-• **src**: `string`
+##### src
+
+`string`
Source string (URL)
-• **options?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) = `{}`
+##### options?
+
+[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) = `{}`
Options object
@@ -5518,21 +5195,21 @@ Options object
`Promise`\<`void`\>
-#### Defined in
-
-[src/shapes/Image.ts:467](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L467)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -5542,15 +5219,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setX`](/api/classes/fabricobject/#setx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -5558,15 +5233,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5584,21 +5265,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
[`FabricObject`](/api/classes/fabricobject/).[`setXY`](/api/classes/fabricobject/#setxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+`number`
+
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -5608,21 +5289,19 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
[`FabricObject`](/api/classes/fabricobject/).[`setY`](/api/classes/fabricobject/#sety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
-Decide if the object should cache or not. Create its own cache level
+Defined in: [src/shapes/Image.ts:617](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L617)
+
+Decide if the FabricImage should cache or not. Create its own cache level
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
-This is the special image version where we would like to avoid caching where possible.
+This is the special Image version where we would like to avoid caching where possible.
Essentially images do not benefit from caching. They may require caching, and in that
case we do it. Also caching an image usually ends in a loss of details.
A full performance audit should be done.
@@ -5635,22 +5314,22 @@ A full performance audit should be done.
[`FabricObject`](/api/classes/fabricobject/).[`shouldCache`](/api/classes/fabricobject/#shouldcache)
-#### Defined in
-
-[src/shapes/Image.ts:622](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L622)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -5662,25 +5341,27 @@ true in order for the window to start a drag session
[`FabricObject`](/api/classes/fabricobject/).[`shouldStartDragging`](/api/classes/fabricobject/#shouldstartdragging)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -5692,9 +5373,27 @@ the control box size used
[`FabricObject`](/api/classes/fabricobject/).[`strokeBorders`](/api/classes/fabricobject/#strokeborders)
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
+#### Parameters
+
+##### options
+
+`toDataURLOptions` = `{}`
+
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob)
***
@@ -5702,11 +5401,15 @@ the control box size used
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -5720,23 +5423,25 @@ Returns DOM element with the FabricObject
[`FabricObject`](/api/classes/fabricobject/).[`toCanvasElement`](/api/classes/fabricobject/#tocanvaselement)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`this`, `reviver`?): `string`
+> **toClipPathSVG**(`this`, `reviver?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L144)
Returns svg clipPath representation of an instance
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -5750,9 +5455,33 @@ svg representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toClipPathSVG`](/api/classes/fabricobject/#toclippathsvg)
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143)
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
***
@@ -5760,11 +5489,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -5778,37 +5511,31 @@ Returns a data: URL containing a representation of the object in the format spec
[`FabricObject`](/api/classes/fabricobject/).[`toDataURL`](/api/classes/fabricobject/#todataurl)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `FabricImage`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`FabricImage`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
***
@@ -5816,6 +5543,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -5828,27 +5557,31 @@ JSON
[`FabricObject`](/api/classes/fabricobject/).[`toJSON`](/api/classes/fabricobject/#tojson)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps`
+> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps`
+
+Defined in: [src/shapes/Image.ts:323](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L323)
Returns object representation of an instance
#### Type Parameters
-• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+##### T
-• **K** *extends* `string` \| `number` \| `symbol` = `never`
+`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`FabricImage`\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol` = `never`
#### Parameters
-• **propertiesToInclude?**: `K`[] = `[]`
+##### propertiesToInclude?
+
+`K`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -5862,46 +5595,14 @@ Object representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject)
-#### Defined in
-
-[src/shapes/Image.ts:328](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L328)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Image.ts:473](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L473)
+
Returns string representation of an instance
#### Returns
@@ -5914,35 +5615,37 @@ String representation of an instance
[`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring)
-#### Defined in
-
-[src/shapes/Image.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L478)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`FabricImage`](/api/classes/fabricimage/)\<`Props`, `SProps`, `EventSpec`\>
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle)
+#### Returns
-#### Defined in
+`string`
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+svg representation of an instance
+
+#### Inherited from
+
+[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg)
***
@@ -5950,11 +5653,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -5966,19 +5673,19 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transform`](/api/classes/fabricobject/#transform)
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -5988,29 +5695,33 @@ Context
[`FabricObject`](/api/classes/fabricobject/).[`transformMatrixKey`](/api/classes/fabricobject/#transformmatrixkey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6022,37 +5733,45 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToCenterPoint`](/api/classes/fabricobject/#translatetocenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6064,29 +5783,33 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToGivenOrigin`](/api/classes/fabricobject/#translatetogivenorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6098,16 +5821,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`FabricObject`](/api/classes/fabricobject/).[`translateToOriginPoint`](/api/classes/fabricobject/#translatetooriginpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -6123,25 +5844,29 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`willDrawShadow`](/api/classes/fabricobject/#willdrawshadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+`Record`\<`string`, `unknown`\>
+
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -6151,16 +5876,14 @@ This API is no longer supported and may be removed in a future release.
[`FabricObject`](/api/classes/fabricobject/).[`_fromObject`](/api/classes/fabricobject/#_fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -6177,107 +5900,111 @@ make this function return an empty object and add controls to the ownDefaults
[`FabricObject`](/api/classes/fabricobject/).[`createControls`](/api/classes/fabricobject/#createcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### fromElement()
-> `static` **fromElement**(`element`, `options`?, `cssRules`?): `Promise`\<`null` \| [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`null` \| `FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Image.ts:824](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L824)
-Returns [FabricImage](../../../../api/classes/fabricimage) instance from an SVG element
+Returns [FabricImage](/api/classes/fabricimage/) instance from an SVG element
#### Parameters
-• **element**: `HTMLElement`
+##### element
+
+`HTMLElement`
Element to parse
-• **options?**: [`Abortable`](/api/type-aliases/abortable/) = `{}`
+##### options?
-Options object
+[`Abortable`](/api/type-aliases/abortable/) = `{}`
-• **cssRules?**: `CSSRules`
-
-#### Returns
+Options object
-`Promise`\<`null` \| [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### cssRules?
-#### Static
+`CSSRules`
-#### Defined in
+#### Returns
-[src/shapes/Image.ts:840](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L840)
+`Promise`\<`null` \| `FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
***
### fromObject()
-> `static` **fromObject**\<`T`\>(`object`, `options`?): `Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Omit`\<`T`, `"type"` \| `"filters"` \| `"resizeFilter"` \| `"src"` \| `"crossOrigin"`\> & `object`, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromObject**\<`T`\>(`object`, `options?`): `Promise`\<`FabricImage`\<`Omit`\<`T`, `"type"` \| `"filters"` \| `"resizeFilter"` \| `"src"` \| `"crossOrigin"`\> & `object`, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Image.ts:779](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L779)
Creates an instance of FabricImage from its object representation
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedImageProps`](/api/interfaces/serializedimageprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedImageProps`](/api/interfaces/serializedimageprops/)\>
#### Parameters
-• **object**: `T`
+##### object
+
+`T`
Object to create an instance from
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
+##### options?
+
+[`Abortable`](/api/type-aliases/abortable/)
Options object
#### Returns
-`Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Omit`\<`T`, `"type"` \| `"filters"` \| `"resizeFilter"` \| `"src"` \| `"crossOrigin"`\> & `object`, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
-
-#### Static
+`Promise`\<`FabricImage`\<`Omit`\<`T`, `"type"` \| `"filters"` \| `"resizeFilter"` \| `"src"` \| `"crossOrigin"`\> & `object`, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject)
-#### Defined in
-
-[src/shapes/Image.ts:793](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L793)
-
***
### fromURL()
-> `static` **fromURL**\<`T`\>(`url`, `__namedParameters`?, `imageOptions`?): `Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromURL**\<`T`\>(`url`, `__namedParameters?`, `imageOptions?`): `Promise`\<`FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Image.ts:807](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L807)
Creates an instance of Image from an URL string
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ImageProps`](/api/interfaces/imageprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ImageProps`](/api/interfaces/imageprops/)\>
#### Parameters
-• **url**: `string`
+##### url
-URL to create an image from
+`string`
-• **\_\_namedParameters?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) = `{}`
+URL to create an image from
-• **imageOptions?**: `T`
+##### \_\_namedParameters?
-#### Returns
+[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) = `{}`
-`Promise`\<[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### imageOptions?
-#### Static
+`T`
-#### Defined in
+#### Returns
-[src/shapes/Image.ts:822](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L822)
+`Promise`\<`FabricImage`\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
***
@@ -6285,6 +6012,8 @@ URL to create an image from
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Image.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L178)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -6292,7 +6021,3 @@ URL to create an image from
#### Overrides
[`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults)
-
-#### Defined in
-
-[src/shapes/Image.ts:182](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L182)
diff --git a/src/content/docs/api/classes/FabricObject.md b/src/content/docs/api/classes/FabricObject.md
index a2a57f3e6..4041299a5 100644
--- a/src/content/docs/api/classes/FabricObject.md
+++ b/src/content/docs/api/classes/FabricObject.md
@@ -5,87 +5,9 @@ prev: false
title: "FabricObject"
---
-Root object class from which all 2d shape classes inherit from
+Defined in: [src/shapes/Object/FabricObject.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObject.ts#L12)
-## Tutorial
-
-[http://fabricjs.com/fabric-intro-part-1#objects](http://fabricjs.com/fabric-intro-part-1#objects)
-
-## Fires
-
-added
-
-## Fires
-
-removed
-
-## Fires
-
-selected
-
-## Fires
-
-deselected
-
-## Fires
-
-rotating
-
-## Fires
-
-scaling
-
-## Fires
-
-moving
-
-## Fires
-
-skewing
-
-## Fires
-
-modified
-
-## Fires
-
-mousedown
-
-## Fires
-
-mouseup
-
-## Fires
-
-mouseover
-
-## Fires
-
-mouseout
-
-## Fires
-
-mousewheel
-
-## Fires
-
-mousedblclick
-
-## Fires
-
-dragover
-
-## Fires
-
-dragenter
-
-## Fires
-
-dragleave
-
-## Fires
-
-drop
+Exported so we can tweak default values
## Extends
@@ -104,37 +26,43 @@ drop
## Type Parameters
-• **Props** *extends* [`TFabricObjectProps`](/api/type-aliases/tfabricobjectprops/) = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>
+### Props
+
+`Props` *extends* [`TFabricObjectProps`](/api/type-aliases/tfabricobjectprops/) = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>
-• **SProps** *extends* [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) = [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)
+### SProps
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`SProps` *extends* [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) = [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)
+
+### EventSpec
+
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Constructors
-### new FabricObject()
+### Constructor
-> **new FabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+> **new FabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L151)
Constructor
#### Parameters
-• **options?**: `Props`
+##### options?
+
+`Props`
Options object
#### Returns
-[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`constructor`](/api/classes/interactivefabricobject/#constructors)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L151)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`constructor`](/api/classes/interactivefabricobject/#constructor)
## Properties
@@ -142,6 +70,8 @@ Options object
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -152,16 +82,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`__corner`](/api/classes/interactivefabricobject/#__corner)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_controlsVisibility
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -170,16 +98,14 @@ this takes priority over the generic control visibility
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_controlsVisibility`](/api/classes/interactivefabricobject/#_controlsvisibility)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_scaling?
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -194,37 +120,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_scaling`](/api/classes/interactivefabricobject/#_scaling)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/fabricobject/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/fabricobject/#calcacoords)
-
-#### Inherited from
-
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`aCoords`](/api/classes/interactivefabricobject/#acoords)
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
-
***
### absolutePositioned
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -242,9 +145,24 @@ false
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`absolutePositioned`](/api/classes/interactivefabricobject/#absolutepositioned)
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/fabricobject/#setcoords).
+You can calculate them without updating with [()](/api/classes/fabricobject/#calcacoords)
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+#### Inherited from
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`aCoords`](/api/classes/interactivefabricobject/#acoords)
***
@@ -252,6 +170,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -264,39 +184,29 @@ Angle of rotation of an object (in degrees)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`angle`](/api/classes/interactivefabricobject/#angle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`backgroundColor`](/api/classes/interactivefabricobject/#backgroundcolor)
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -309,16 +219,14 @@ rgb(178,204,255)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`borderColor`](/api/classes/interactivefabricobject/#bordercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -329,16 +237,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`borderDashArray`](/api/classes/interactivefabricobject/#borderdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -351,20 +257,19 @@ Opacity of object's controlling borders when object is active and moving
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`borderOpacityWhenMoving`](/api/classes/interactivefabricobject/#borderopacitywhenmoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -376,16 +281,14 @@ since there is no way to change the border itself.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`borderScaleFactor`](/api/classes/interactivefabricobject/#borderscalefactor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -396,26 +299,18 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`centeredRotation`](/api/classes/interactivefabricobject/#centeredrotation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -423,26 +318,18 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`centeredScaling`](/api/classes/interactivefabricobject/#centeredscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -452,16 +339,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`clipPath`](/api/classes/interactivefabricobject/#clippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -469,16 +354,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
`FabricObjectSVGExportMixin.clipPathId`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -486,16 +369,14 @@ controls are added by default_controls.js
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`controls`](/api/classes/interactivefabricobject/#controls)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -508,16 +389,14 @@ rgb(178,204,255)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cornerColor`](/api/classes/interactivefabricobject/#cornercolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -534,16 +413,14 @@ null
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cornerDashArray`](/api/classes/interactivefabricobject/#cornerdasharray)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -556,16 +433,14 @@ Size of object's controlling corners (in pixels)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cornerSize`](/api/classes/interactivefabricobject/#cornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -582,20 +457,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cornerStrokeColor`](/api/classes/interactivefabricobject/#cornerstrokecolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -606,24 +483,18 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cornerStyle`](/api/classes/interactivefabricobject/#cornerstyle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -637,64 +508,46 @@ true
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`dirty`](/api/classes/interactivefabricobject/#dirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`evented`](/api/classes/interactivefabricobject/#evented)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`excludeFromExport`](/api/classes/interactivefabricobject/#excludefromexport)
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -708,16 +561,14 @@ rgb(0,0,0)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`fill`](/api/classes/interactivefabricobject/#fill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -732,16 +583,14 @@ nonzero
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`fillRule`](/api/classes/interactivefabricobject/#fillrule)
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -754,16 +603,14 @@ false
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`flipX`](/api/classes/interactivefabricobject/#flipx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -776,60 +623,42 @@ false
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`flipY`](/api/classes/interactivefabricobject/#flipy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`globalCompositeOperation`](/api/classes/interactivefabricobject/#globalcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hasBorders`](/api/classes/interactivefabricobject/#hasborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -842,38 +671,28 @@ true
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hasControls`](/api/classes/interactivefabricobject/#hascontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`height`](/api/classes/interactivefabricobject/#height)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -886,38 +705,28 @@ null
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hoverCursor`](/api/classes/interactivefabricobject/#hovercursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
-
***
### includeDefaultValues
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`includeDefaultValues`](/api/classes/interactivefabricobject/#includedefaultvalues)
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -932,16 +741,14 @@ false
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`inverted`](/api/classes/interactivefabricobject/#inverted)
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -949,19 +756,17 @@ part of the move action.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isMoving`](/api/classes/interactivefabricobject/#ismoving)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -973,208 +778,140 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`left`](/api/classes/interactivefabricobject/#left)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
-When `true`, object horizontal movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
-```
+When `true`, object horizontal movement is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockMovementX`](/api/classes/interactivefabricobject/#lockmovementx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
-
***
### lockMovementY
> **lockMovementY**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
+
When `true`, object vertical movement is locked
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockMovementY`](/api/classes/interactivefabricobject/#lockmovementy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockRotation`](/api/classes/interactivefabricobject/#lockrotation)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockScalingFlip`](/api/classes/interactivefabricobject/#lockscalingflip)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockScalingX`](/api/classes/interactivefabricobject/#lockscalingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockScalingY`](/api/classes/interactivefabricobject/#lockscalingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockSkewingX`](/api/classes/interactivefabricobject/#lockskewingx)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`lockSkewingY`](/api/classes/interactivefabricobject/#lockskewingy)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`matrixCache`](/api/classes/interactivefabricobject/#matrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
-
***
### minScaleLimit
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1187,16 +924,14 @@ Minimum allowed scale value of an object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`minScaleLimit`](/api/classes/interactivefabricobject/#minscalelimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1209,16 +944,14 @@ null
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`moveCursor`](/api/classes/interactivefabricobject/#movecursor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1235,35 +968,14 @@ true
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`noScaleCache`](/api/classes/interactivefabricobject/#noscalecache)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`oCoords`](/api/classes/interactivefabricobject/#ocoords)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1282,9 +994,22 @@ true
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`objectCaching`](/api/classes/interactivefabricobject/#objectcaching)
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`oCoords`](/api/classes/interactivefabricobject/#ocoords)
***
@@ -1292,6 +1017,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1304,16 +1031,14 @@ Opacity of an object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`opacity`](/api/classes/interactivefabricobject/#opacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1322,16 +1047,14 @@ please use 'center' as value in new projects
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`originX`](/api/classes/interactivefabricobject/#originx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1340,32 +1063,28 @@ please use 'center' as value in new projects
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`originY`](/api/classes/interactivefabricobject/#originy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`ownMatrixCache`](/api/classes/interactivefabricobject/#ownmatrixcache)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1378,38 +1097,28 @@ Padding between object and its controlling borders (in pixels)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`padding`](/api/classes/interactivefabricobject/#padding)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`paintFirst`](/api/classes/interactivefabricobject/#paintfirst)
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1417,38 +1126,28 @@ Used to keep the original parent ref when the object has been added to an Active
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`parent`](/api/classes/interactivefabricobject/#parent)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`perPixelTargetFind`](/api/classes/interactivefabricobject/#perpixeltargetfind)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1461,16 +1160,14 @@ Object scale factor (horizontal)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`scaleX`](/api/classes/interactivefabricobject/#scalex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1483,48 +1180,32 @@ Object scale factor (vertical)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`scaleY`](/api/classes/interactivefabricobject/#scaley)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`selectable`](/api/classes/interactivefabricobject/#selectable)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1533,16 +1214,14 @@ This API is no longer supported and may be removed in a future release.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`selectionBackgroundColor`](/api/classes/interactivefabricobject/#selectionbackgroundcolor)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1555,16 +1234,14 @@ null
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`shadow`](/api/classes/interactivefabricobject/#shadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1577,16 +1254,14 @@ Angle of skew on x axes of an object (in degrees)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`skewX`](/api/classes/interactivefabricobject/#skewx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1599,32 +1274,28 @@ Angle of skew on y axes of an object (in degrees)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`skewY`](/api/classes/interactivefabricobject/#skewy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`snapAngle`](/api/classes/interactivefabricobject/#snapangle)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1632,16 +1303,14 @@ When undefined, the snapThreshold will default to the snapAngle.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`snapThreshold`](/api/classes/interactivefabricobject/#snapthreshold)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -1655,16 +1324,14 @@ null
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`stroke`](/api/classes/interactivefabricobject/#stroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -1677,16 +1344,14 @@ null;
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeDashArray`](/api/classes/interactivefabricobject/#strokedasharray)
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -1699,16 +1364,14 @@ Line offset of an object's stroke
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeDashOffset`](/api/classes/interactivefabricobject/#strokedashoffset)
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -1721,38 +1384,28 @@ butt
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeLineCap`](/api/classes/interactivefabricobject/#strokelinecap)
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeLineJoin`](/api/classes/interactivefabricobject/#strokelinejoin)
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -1765,16 +1418,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeMiterLimit`](/api/classes/interactivefabricobject/#strokemiterlimit)
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -1800,16 +1451,14 @@ false
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeUniform`](/api/classes/interactivefabricobject/#strokeuniform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -1822,19 +1471,17 @@ Width of a stroke used to render this object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeWidth`](/api/classes/interactivefabricobject/#strokewidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -1846,16 +1493,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`top`](/api/classes/interactivefabricobject/#top)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -1868,16 +1513,14 @@ Size of object's controlling corners when touch interaction is detected
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`touchCornerSize`](/api/classes/interactivefabricobject/#touchcornersize)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -1890,60 +1533,42 @@ true
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`transparentCorners`](/api/classes/interactivefabricobject/#transparentcorners)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### visible
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`visible`](/api/classes/interactivefabricobject/#visible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
***
### width
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`width`](/api/classes/interactivefabricobject/#width)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
-
***
### cacheProperties
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:234](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L234)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -1953,32 +1578,28 @@ and refreshed at the next render
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cacheProperties`](/api/classes/interactivefabricobject/#cacheproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L237)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`colorProperties`](/api/classes/interactivefabricobject/#colorproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -1986,30 +1607,26 @@ instance.toObject() gets called
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`customProperties`](/api/classes/interactivefabricobject/#customproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### ownDefaults
> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `interactiveObjectDefaultValues`
+Defined in: [src/shapes/Object/InteractiveObject.ts:138](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L138)
+
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`ownDefaults`](/api/classes/interactivefabricobject/#owndefaults)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L138)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2018,16 +1635,14 @@ needs its cache regenerated during a .set call
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`stateProperties`](/api/classes/interactivefabricobject/#stateproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'FabricObject'`
+Defined in: [src/shapes/Object/Object.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L343)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -2041,22 +1656,22 @@ We do not do that in fabricJS code because we want to try to have code splitting
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`type`](/api/classes/interactivefabricobject/#type)
-#### Defined in
-
-[src/shapes/Object/Object.ts:346](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L346)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2064,23 +1679,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`type`](/api/classes/interactivefabricobject/#type-1)
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`type`](/api/classes/interactivefabricobject/#type-1)
## Methods
@@ -2088,15 +1709,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
-• **context**: `DrawContext`
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2106,51 +1735,44 @@ Prepare clipPath state and cache and draw it on instance's cache
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_drawClipPath`](/api/classes/interactivefabricobject/#_drawclippath)
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_limitCacheSize`](/api/classes/interactivefabricobject/#_limitcachesize)
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2161,26 +1783,28 @@ Remove cacheCanvas and its dimensions from the objects
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_removeCacheCanvas`](/api/classes/interactivefabricobject/#_removecachecanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2196,19 +1820,19 @@ move to interactivity
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_renderControls`](/api/classes/interactivefabricobject/#_rendercontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2218,21 +1842,23 @@ move to interactivity
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_setClippingProperties`](/api/classes/interactivefabricobject/#_setclippingproperties)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **\_\_namedParameters**: `Pick`\<[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+##### \_\_namedParameters
+
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2242,21 +1868,23 @@ move to interactivity
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_setFillStyles`](/api/classes/interactivefabricobject/#_setfillstyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### decl
-• **decl**: `Pick`\<[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2266,22 +1894,22 @@ move to interactivity
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_setStrokeStyles`](/api/classes/interactivefabricobject/#_setstrokestyles)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2293,15 +1921,13 @@ Rendering canvas context
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_setupCompositeOperation`](/api/classes/interactivefabricobject/#_setupcompositeoperation)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_toSVG()
-> **\_toSVG**(`_reviver`?): `string`[]
+> **\_toSVG**(`_reviver?`): `string`[]
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L121)
Returns svg representation of an instance
This function is implemented in each subclass
@@ -2309,7 +1935,9 @@ This is just because typescript otherwise cryies all the time
#### Parameters
-• **\_reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### \_reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
#### Returns
@@ -2322,19 +1950,19 @@ of the instance
`FabricObjectSVGExportMixin._toSVG`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L120)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2344,33 +1972,37 @@ of the instance
`FabricObjectSVGExportMixin.addPaintOrder`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2379,24 +2011,22 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`animate`](/api/classes/interactivefabricobject/#animate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -2408,16 +2038,14 @@ those never change with zoom or viewport changes.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`calcACoords`](/api/classes/interactivefabricobject/#calcacoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -2431,16 +2059,14 @@ is a public api and should be done just if extremely necessary
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`calcOCoords`](/api/classes/interactivefabricobject/#calcocoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -2454,22 +2080,22 @@ transform matrix for the object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`calcOwnMatrix`](/api/classes/interactivefabricobject/#calcownmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -2484,21 +2110,21 @@ transform matrix for the object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`calcTransformMatrix`](/api/classes/interactivefabricobject/#calctransformmatrix)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -2510,15 +2136,13 @@ true if the object currently dragged can be dropped on the target
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`canDrop`](/api/classes/interactivefabricobject/#candrop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -2527,7 +2151,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -2546,41 +2172,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`clearContextTop`](/api/classes/interactivefabricobject/#clearcontexttop)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`FabricObject`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>\>
+`Promise`\<`FabricObject`\<`Props`, `SProps`, `EventSpec`\>\>
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`clone`](/api/classes/interactivefabricobject/#clone)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -2591,13 +2215,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -2609,16 +2235,14 @@ fix the export type, it could not be Image but the type that getClass return for
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`cloneAsImage`](/api/classes/interactivefabricobject/#cloneasimage)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:1426](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1426)
+
Returns complexity of an instance
#### Returns
@@ -2631,21 +2255,21 @@ complexity of this instance (is 1 unless subclassed)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`complexity`](/api/classes/interactivefabricobject/#complexity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1460](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1460)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -2659,16 +2283,14 @@ true if point is inside the object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`containsPoint`](/api/classes/interactivefabricobject/#containspoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1494)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -2680,15 +2302,13 @@ override if necessary to dispose artifacts such as `clipPath`
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`dispose`](/api/classes/interactivefabricobject/#dispose)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1528)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -2696,15 +2316,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -2716,23 +2342,25 @@ object to override the object style
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawBorders`](/api/classes/interactivefabricobject/#drawborders)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -2744,27 +2372,31 @@ Context to render on
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawCacheOnCanvas`](/api/classes/interactivefabricobject/#drawcacheoncanvas)
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
+
+[`BaseFabricObject`](/api/classes/basefabricobject/)
-• **canvasWithClipPath**: `HTMLCanvasElement`
+##### canvasWithClipPath
+
+`HTMLCanvasElement`
#### Returns
@@ -2774,16 +2406,14 @@ Context to render on
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawClipPathOnCache`](/api/classes/interactivefabricobject/#drawclippathoncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -2793,11 +2423,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -2809,27 +2443,29 @@ object to override the object style
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawControls`](/api/classes/interactivefabricobject/#drawcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -2841,29 +2477,33 @@ object size x = width, y = height
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawControlsConnectingLines`](/api/classes/interactivefabricobject/#drawcontrolsconnectinglines)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -2875,16 +2515,14 @@ additional context for rendering
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawObject`](/api/classes/interactivefabricobject/#drawobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -2892,7 +2530,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -2910,25 +2550,27 @@ it seemed a good option, now is an edge case
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`drawSelectionBackground`](/api/classes/interactivefabricobject/#drawselectionbackground)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -2940,29 +2582,33 @@ an object that represent the ancestry situation.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`findCommonAncestors`](/api/classes/interactivefabricobject/#findcommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -2974,22 +2620,22 @@ Options object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`fire`](/api/classes/interactivefabricobject/#fire)
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3001,21 +2647,21 @@ function to iterate over the controls over
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`forEachControl`](/api/classes/interactivefabricobject/#foreachcontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3029,34 +2675,30 @@ value of a property
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`get`](/api/classes/interactivefabricobject/#get)
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getActiveControl`](/api/classes/interactivefabricobject/#getactivecontrol)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3067,16 +2709,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getAncestors`](/api/classes/interactivefabricobject/#getancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3090,16 +2730,14 @@ Object with left, top, width, height properties
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getBoundingRect`](/api/classes/interactivefabricobject/#getboundingrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3108,16 +2746,14 @@ Object with left, top, width, height properties
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getCanvasRetinaScaling`](/api/classes/interactivefabricobject/#getcanvasretinascaling)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3128,16 +2764,14 @@ Returns the center coordinates of the object relative to canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getCenterPoint`](/api/classes/interactivefabricobject/#getcenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -3148,16 +2782,14 @@ Returns the center coordinates of the object relative to canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getCoords`](/api/classes/interactivefabricobject/#getcoords)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -3168,16 +2800,14 @@ Return the object opacity counting also the group property
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getObjectOpacity`](/api/classes/interactivefabricobject/#getobjectopacity)
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
@@ -3188,16 +2818,14 @@ Return the object scale factor counting also the group scaling
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getObjectScaling`](/api/classes/interactivefabricobject/#getobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -3207,11 +2835,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -3223,16 +2855,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getPointByOrigin`](/api/classes/interactivefabricobject/#getpointbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -3243,78 +2873,70 @@ Returns the center coordinates of the object relative to it's parent
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getRelativeCenterPoint`](/api/classes/interactivefabricobject/#getrelativecenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/fabricobject/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/fabricobject/#getx)
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getRelativeX`](/api/classes/interactivefabricobject/#getrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getRelativeXY`](/api/classes/interactivefabricobject/#getrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/fabricobject/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/fabricobject/#gety)
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getRelativeY`](/api/classes/interactivefabricobject/#getrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -3331,16 +2953,14 @@ shouldn't this account for group transform and return the actual size in canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getScaledHeight`](/api/classes/interactivefabricobject/#getscaledheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -3357,21 +2977,21 @@ shouldn't this account for group transform and return the actual size in canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getScaledWidth`](/api/classes/interactivefabricobject/#getscaledwidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -3381,21 +3001,21 @@ Returns id attribute for svg output
`FabricObjectSVGExportMixin.getSvgCommons`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3405,23 +3025,25 @@ Returns filter for svg shadow
`FabricObjectSVGExportMixin.getSvgFilter`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### getSvgStyles()
-> **getSvgStyles**(`this`, `skipShadow`?): `string`
+> **getSvgStyles**(`this`, `skipShadow?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L22)
Returns styles-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **skipShadow?**: `boolean`
+##### skipShadow?
+
+`boolean`
a boolean to skip shadow filter output
@@ -3433,25 +3055,29 @@ a boolean to skip shadow filter output
`FabricObjectSVGExportMixin.getSvgStyles`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L21)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **full?**: `boolean`
+##### full?
-• **additionalTransform?**: `string` = `''`
+`boolean`
+
+##### additionalTransform?
+
+`string` = `''`
#### Returns
@@ -3461,16 +3087,14 @@ Returns transform-string for svg-export
`FabricObjectSVGExportMixin.getSvgTransform`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -3481,16 +3105,14 @@ Returns the object angle relative to canvas counting also the group property
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getTotalAngle`](/api/classes/interactivefabricobject/#gettotalangle)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -3503,16 +3125,14 @@ object with scaleX and scaleY properties
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getTotalObjectScaling`](/api/classes/interactivefabricobject/#gettotalobjectscaling)
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -3523,83 +3143,79 @@ Retrieves viewportTransform from Object's canvas if available
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getViewportTransform`](/api/classes/interactivefabricobject/#getviewporttransform)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getX`](/api/classes/interactivefabricobject/#getx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getXY`](/api/classes/interactivefabricobject/#getxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getY`](/api/classes/interactivefabricobject/#gety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3609,15 +3225,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hasCommonAncestors`](/api/classes/interactivefabricobject/#hascommonancestors)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3628,7 +3242,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -3640,15 +3254,13 @@ Boolean
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hasFill`](/api/classes/interactivefabricobject/#hasfill)
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -3659,7 +3271,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -3671,21 +3283,21 @@ Boolean
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`hasStroke`](/api/classes/interactivefabricobject/#hasstroke)
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -3699,23 +3311,25 @@ true if object intersects with another object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`intersectsWithObject`](/api/classes/interactivefabricobject/#intersectswithobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -3725,21 +3339,24 @@ Checks if object intersects with the scene rect formed by tl and br
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`intersectsWithRect`](/api/classes/interactivefabricobject/#intersectswithrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -3752,21 +3369,21 @@ on parent canvas.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isCacheDirty`](/api/classes/interactivefabricobject/#iscachedirty)
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -3780,23 +3397,25 @@ true if object is fully contained within area of another object
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isContainedWithinObject`](/api/classes/interactivefabricobject/#iscontainedwithinobject)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
+
+##### br
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -3806,21 +3425,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isContainedWithinRect`](/api/classes/interactivefabricobject/#iscontainedwithinrect)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -3835,22 +3454,22 @@ true if the specified control is visible, false otherwise
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isControlVisible`](/api/classes/interactivefabricobject/#iscontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -3860,23 +3479,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isDescendantOf`](/api/classes/interactivefabricobject/#isdescendantof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -3890,16 +3511,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isInFrontOf`](/api/classes/interactivefabricobject/#isinfrontof)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -3908,16 +3529,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isNotVisible`](/api/classes/interactivefabricobject/#isnotvisible)
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -3931,23 +3550,25 @@ true if object is fully or partially contained within canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isOnScreen`](/api/classes/interactivefabricobject/#isonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3957,16 +3578,14 @@ true if object is fully or partially contained within canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isOverlapping`](/api/classes/interactivefabricobject/#isoverlapping)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -3979,41 +3598,51 @@ true if object is partially contained within canvas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isPartiallyOnScreen`](/api/classes/interactivefabricobject/#ispartiallyonscreen)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`isType`](/api/classes/interactivefabricobject/#istype)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -4029,18 +3658,16 @@ Boolean
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`needsItsOwnCache`](/api/classes/interactivefabricobject/#needsitsowncache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -4051,11 +3678,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -4067,27 +3698,31 @@ event name (eg. 'after:render')
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`off`](/api/classes/interactivefabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -4099,19 +3734,19 @@ event listener to unsubscribe
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`off`](/api/classes/interactivefabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -4123,14 +3758,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`off`](/api/classes/interactivefabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -4141,33 +3774,39 @@ unsubscribe all event listeners
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`off`](/api/classes/interactivefabricobject/#off)
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
+
+###### E
-• **E**
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -4185,106 +3824,140 @@ on
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`on`](/api/classes/interactivefabricobject/#on)
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
+disposer
+
+##### Alias
+
+on
+
##### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`on`](/api/classes/interactivefabricobject/#on)
-##### Defined in
+***
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+### once()
-***
+#### Call Signature
-### onDeselect()
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-> **onDeselect**(`_options`?): `boolean`
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to deselect this object. If the function returns true, the process is cancelled
+Observes specified event **once**
-#### Parameters
+##### Type Parameters
-• **\_options?**
+###### K
-options sent from the upper functions
+`K` *extends* `string` \| `number` \| `symbol`
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### E
-• **\_options.object?**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`E`
-#### Returns
+##### Parameters
-`boolean`
+###### eventName
-#### Inherited from
+`K`
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onDeselect`](/api/classes/interactivefabricobject/#ondeselect)
+Event name (eg. 'after:render')
-#### Defined in
+###### handler
-[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658)
+`TEventCallback`\<`E`\>
-***
+Function that receives a notification when an event of the specified type occurs
-### onDragStart()
+##### Returns
-> **onDragStart**(`_e`): `boolean`
+`VoidFunction`
-Override to customize Drag behavior\
-Fired once a drag session has started
+disposer
-#### Parameters
+##### Alias
-• **\_e**: `DragEvent`
+once
-#### Returns
+##### Inherited from
-`boolean`
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`once`](/api/classes/interactivefabricobject/#once)
-true to handle the drag event
+#### Call Signature
-#### Inherited from
+> **once**(`handlers`): `VoidFunction`
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onDragStart`](/api/classes/interactivefabricobject/#ondragstart)
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
+
+Observes specified event **once**
+
+##### Parameters
+
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
+
+##### Returns
+
+`VoidFunction`
+
+disposer
-#### Defined in
+##### Alias
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
+once
+
+##### Inherited from
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`once`](/api/classes/interactivefabricobject/#once)
***
-### onSelect()
+### onDeselect()
-> **onSelect**(`_options`?): `boolean`
+> **onDeselect**(`_options?`): `boolean`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658)
This callback function is called every time _discardActiveObject or _setActiveObject
-try to to select this object. If the function returns true, the process is cancelled
+try to to deselect this object. If the function returns true, the process is cancelled
#### Parameters
-• **\_options?**
+##### \_options?
options sent from the upper functions
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### e?
-event if the process is generated by an event
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+###### object?
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -4292,75 +3965,65 @@ event if the process is generated by an event
#### Inherited from
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onSelect`](/api/classes/interactivefabricobject/#onselect)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onDeselect`](/api/classes/interactivefabricobject/#ondeselect)
***
-### once()
-
-#### once(eventName, handler)
-
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-
-Observes specified event **once**
-
-##### Type Parameters
+### onDragStart()
-• **K** *extends* `string` \| `number` \| `symbol`
+> **onDragStart**(`_e`): `boolean`
-• **E**
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
-##### Parameters
+Override to customize Drag behavior\
+Fired once a drag session has started
-• **eventName**: `K`
+#### Parameters
-Event name (eg. 'after:render')
+##### \_e
-• **handler**: `TEventCallback`\<`E`\>
+`DragEvent`
-Function that receives a notification when an event of the specified type occurs
+#### Returns
-##### Returns
+`boolean`
-`VoidFunction`
+true to handle the drag event
-disposer
+#### Inherited from
-##### Alias
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onDragStart`](/api/classes/interactivefabricobject/#ondragstart)
-once
+***
-##### Inherited from
+### onSelect()
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`once`](/api/classes/interactivefabricobject/#once)
+> **onSelect**(`_options?`): `boolean`
-##### Defined in
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to select this object. If the function returns true, the process is cancelled
-#### once(handlers)
+#### Parameters
-> **once**(`handlers`): `VoidFunction`
+##### \_options?
-##### Parameters
+options sent from the upper functions
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### e?
-##### Returns
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
-`VoidFunction`
+event if the process is generated by an event
-##### Inherited from
+#### Returns
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`once`](/api/classes/interactivefabricobject/#once)
+`boolean`
-##### Defined in
+#### Inherited from
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`onSelect`](/api/classes/interactivefabricobject/#onselect)
***
@@ -4368,11 +4031,15 @@ once
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:649](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L649)
+
Renders an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -4384,21 +4051,23 @@ Context to render on
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`render`](/api/classes/interactivefabricobject/#render)
-#### Defined in
-
-[src/shapes/Object/Object.ts:698](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L698)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **options?**: `any`
+##### options?
+
+`any`
#### Returns
@@ -4408,23 +4077,23 @@ Context to render on
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`renderCache`](/api/classes/interactivefabricobject/#rendercache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4434,16 +4103,14 @@ example: render the selection status for the part of text that is being dragged
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`renderDragSourceEffect`](/api/classes/interactivefabricobject/#renderdragsourceeffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -4451,7 +4118,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -4461,21 +4130,21 @@ object will change when dropping. example: show the cursor where the text is abo
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`renderDropTargetEffect`](/api/classes/interactivefabricobject/#renderdroptargeteffect)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -4487,21 +4156,21 @@ Angle value (in degrees)
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`rotate`](/api/classes/interactivefabricobject/#rotate)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -4513,21 +4182,21 @@ Scale factor
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`scale`](/api/classes/interactivefabricobject/#scale)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -4539,21 +4208,21 @@ New height value
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`scaleToHeight`](/api/classes/interactivefabricobject/#scaletoheight)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -4565,39 +4234,64 @@ New width value
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`scaleToWidth`](/api/classes/interactivefabricobject/#scaletowidth)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L29)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `string` \| `Record`\<`string`, `any`\>
+##### key
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+`string` | `Record`\<`string`, `any`\>
+
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`set`](/api/classes/interactivefabricobject/#set)
-#### Defined in
+***
+
+### setControlsVisibility()
+
+> **setControlsVisibility**(`options?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
+
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+
+#### Parameters
+
+##### options?
+
+`Record`\<`string`, `boolean`\> = `{}`
+
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+
+#### Returns
+
+`void`
+
+#### Inherited from
-[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setControlsVisibility`](/api/classes/interactivefabricobject/#setcontrolsvisibility)
***
@@ -4605,17 +4299,23 @@ Property value (if function, the value is passed into it and its return value is
> **setControlVisible**(`controlKey`, `visible`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
+
Sets the visibility of the specified control.
please do not use.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
but since the control api allow for any control name, can be any string.
-• **visible**: `boolean`
+##### visible
+
+`boolean`
true to set the specified control visible, false otherwise
@@ -4631,45 +4331,16 @@ discuss this overlap of priority here with the team. Andrea Bogazzi for details
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setControlVisible`](/api/classes/interactivefabricobject/#setcontrolvisible)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
-
-***
-
-### setControlsVisibility()
-
-> **setControlsVisibility**(`options`?): `void`
-
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
-
-#### Parameters
-
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
-
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
-
-#### Returns
-
-`void`
-
-#### Inherited from
-
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setControlsVisibility`](/api/classes/interactivefabricobject/#setcontrolsvisibility)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
-
***
### setCoords()
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L343)
+
set controls' coordinates as well
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [https://fabric5.fabricjs.com/fabric-gotchas](https://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -4679,16 +4350,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setCoords`](/api/classes/interactivefabricobject/#setcoords)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -4702,29 +4371,33 @@ Travis build error about unused variables.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setOnGroup`](/api/classes/interactivefabricobject/#setongroup)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -4736,22 +4409,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setPositionByOrigin`](/api/classes/interactivefabricobject/#setpositionbyorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/fabricobject/#setx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/fabricobject/#setx)
#### Returns
@@ -4761,29 +4434,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setRelativeX`](/api/classes/interactivefabricobject/#setrelativex)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
-As [setXY](../../../../api/classes/fabricobject/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
+
+As [setXY](/api/classes/fabricobject/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -4795,22 +4472,22 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setRelativeXY`](/api/classes/interactivefabricobject/#setrelativexy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/fabricobject/#sety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/fabricobject/#sety)
#### Returns
@@ -4820,21 +4497,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setRelativeY`](/api/classes/interactivefabricobject/#setrelativey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -4844,15 +4521,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setX`](/api/classes/interactivefabricobject/#setx)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -4860,15 +4535,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -4886,21 +4567,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setXY`](/api/classes/interactivefabricobject/#setxy)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -4910,20 +4591,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`setY`](/api/classes/interactivefabricobject/#sety)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L775)
+
Decide if the object should cache or not. Create its own cache level
objectCaching is a global flag, wins over everything
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
Read as: cache if is needed, or if the feature is enabled but we are not already caching.
@@ -4935,22 +4614,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`shouldCache`](/api/classes/interactivefabricobject/#shouldcache)
-#### Defined in
-
-[src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L823)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -4962,25 +4641,27 @@ true in order for the window to start a drag session
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`shouldStartDragging`](/api/classes/interactivefabricobject/#shouldstartdragging)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -4992,9 +4673,27 @@ the control box size used
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`strokeBorders`](/api/classes/interactivefabricobject/#strokeborders)
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
+
+`toDataURLOptions` = `{}`
+
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toBlob`](/api/classes/interactivefabricobject/#toblob)
***
@@ -5002,11 +4701,15 @@ the control box size used
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -5020,23 +4723,25 @@ Returns DOM element with the FabricObject
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toCanvasElement`](/api/classes/interactivefabricobject/#tocanvaselement)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`this`, `reviver`?): `string`
+> **toClipPathSVG**(`this`, `reviver?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L144)
Returns svg clipPath representation of an instance
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -5050,9 +4755,33 @@ svg representation of an instance
`FabricObjectSVGExportMixin.toClipPathSVG`
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
+
+`any`[]
+
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toDatalessObject`](/api/classes/interactivefabricobject/#todatalessobject)
***
@@ -5060,11 +4789,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -5078,37 +4811,31 @@ Returns a data: URL containing a representation of the object in the format spec
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toDataURL`](/api/classes/interactivefabricobject/#todataurl)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `FabricObject`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`FabricObject`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toDatalessObject`](/api/classes/interactivefabricobject/#todatalessobject)
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toggle`](/api/classes/interactivefabricobject/#toggle)
***
@@ -5116,6 +4843,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -5128,21 +4857,21 @@ JSON
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toJSON`](/api/classes/interactivefabricobject/#tojson)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**(`propertiesToInclude`?): `any`
+> **toObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1757](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1757)
Returns an object representation of an instance
#### Parameters
-• **propertiesToInclude?**: `any`[] = `[]`
+##### propertiesToInclude?
+
+`any`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -5156,46 +4885,14 @@ Object representation of an instance
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toObject`](/api/classes/interactivefabricobject/#toobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1791](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1791)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-`FabricObjectSVGExportMixin.toSVG`
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Object/Object.ts:1890](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1890)
+
Returns a string representation of an instance
#### Returns
@@ -5206,35 +4903,37 @@ Returns a string representation of an instance
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toString`](/api/classes/interactivefabricobject/#tostring)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1924)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & `FabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`FabricObject`](/api/classes/fabricobject/)\<`Props`, `SProps`, `EventSpec`\>
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`toggle`](/api/classes/interactivefabricobject/#toggle)
+#### Returns
+
+`string`
-#### Defined in
+svg representation of an instance
+
+#### Inherited from
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+`FabricObjectSVGExportMixin.toSVG`
***
@@ -5242,11 +4941,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -5258,19 +4961,19 @@ Context
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`transform`](/api/classes/interactivefabricobject/#transform)
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -5280,29 +4983,33 @@ Context
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`transformMatrixKey`](/api/classes/interactivefabricobject/#transformmatrixkey)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5314,37 +5021,45 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`translateToCenterPoint`](/api/classes/interactivefabricobject/#translatetocenterpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5356,29 +5071,33 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`translateToGivenOrigin`](/api/classes/interactivefabricobject/#translatetogivenorigin)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5390,16 +5109,14 @@ Vertical origin: 'top', 'center' or 'bottom'
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`translateToOriginPoint`](/api/classes/interactivefabricobject/#translatetooriginpoint)
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -5415,25 +5132,29 @@ This API is no longer supported and may be removed in a future release.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`willDrawShadow`](/api/classes/interactivefabricobject/#willdrawshadow)
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+`Record`\<`string`, `unknown`\>
+
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -5443,16 +5164,14 @@ This API is no longer supported and may be removed in a future release.
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`_fromObject`](/api/classes/interactivefabricobject/#_fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -5469,25 +5188,29 @@ make this function return an empty object and add controls to the ownDefaults
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`createControls`](/api/classes/interactivefabricobject/#createcontrols)
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### fromObject()
-> `static` **fromObject**\<`T`\>(`object`, `options`?): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromObject**\<`T`\>(`object`, `options?`): `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1932](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1932)
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
+##### T
+
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)\>
#### Parameters
-• **object**: `T`
+##### object
+
+`T`
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
+##### options?
+
+[`Abortable`](/api/type-aliases/abortable/)
#### Returns
@@ -5497,16 +5220,14 @@ make this function return an empty object and add controls to the ownDefaults
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`fromObject`](/api/classes/interactivefabricobject/#fromobject)
-#### Defined in
-
-[src/shapes/Object/Object.ts:1966](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1966)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L140)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -5514,7 +5235,3 @@ make this function return an empty object and add controls to the ownDefaults
#### Inherited from
[`InteractiveFabricObject`](/api/classes/interactivefabricobject/).[`getDefaults`](/api/classes/interactivefabricobject/#getdefaults)
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:140](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L140)
diff --git a/src/content/docs/api/classes/FabricText.md b/src/content/docs/api/classes/FabricText.md
index d957a8b19..104e05f8f 100644
--- a/src/content/docs/api/classes/FabricText.md
+++ b/src/content/docs/api/classes/FabricText.md
@@ -5,11 +5,13 @@ prev: false
title: "FabricText"
---
+Defined in: [src/shapes/Text/Text.ts:129](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L129)
+
Text class
-## Tutorial
+## See
-[http://fabricjs.com/fabric-intro-part-2#text](http://fabricjs.com/fabric-intro-part-2#text)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#text](http://fabric5.fabricjs.com/fabric-intro-part-2#text)
## Extends
@@ -17,11 +19,17 @@ Text class
## Type Parameters
-• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`TextProps`](/api/interfaces/textprops/)\> = `Partial`\<[`TextProps`](/api/interfaces/textprops/)\>
+### Props
+
+`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`TextProps`](/api/interfaces/textprops/)\> = `Partial`\<[`TextProps`](/api/interfaces/textprops/)\>
+
+### SProps
+
+`SProps` *extends* [`SerializedTextProps`](/api/interfaces/serializedtextprops/) = [`SerializedTextProps`](/api/interfaces/serializedtextprops/)
-• **SProps** *extends* [`SerializedTextProps`](/api/interfaces/serializedtextprops/) = [`SerializedTextProps`](/api/interfaces/serializedtextprops/)
+### EventSpec
-• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
+`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/)
## Implements
@@ -29,52 +37,38 @@ Text class
## Constructors
-### new FabricText()
+### Constructor
-> **new FabricText**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options`?): [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+> **new FabricText**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options?`): `FabricText`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Text/Text.ts:419](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L419)
#### Parameters
-• **text**: `string`
+##### text
+
+`string`
+
+##### options?
-• **options?**: `Props`
+`Props`
#### Returns
-[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
`StyledText.constructor`
-#### Defined in
-
-[src/shapes/Text/Text.ts:425](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L425)
-
## Properties
-### MIN\_TEXT\_WIDTH
-
-> **MIN\_TEXT\_WIDTH**: `number`
-
-contains the min text width to avoid getting 0
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/shapes/Text/Text.ts:391](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L391)
-
-***
-
### \_\_corner?
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -85,19 +79,13 @@ this isn't cleaned automatically. Non selected objects may have wrong values
`StyledText.__corner`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
-
***
### \_\_lineHeights
> **\_\_lineHeights**: `number`[]
-#### Defined in
-
-[src/shapes/Text/Text.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L411)
+Defined in: [src/shapes/Text/Text.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L405)
***
@@ -105,9 +93,7 @@ this isn't cleaned automatically. Non selected objects may have wrong values
> **\_\_lineWidths**: `number`[]
-#### Defined in
-
-[src/shapes/Text/Text.ts:412](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L412)
+Defined in: [src/shapes/Text/Text.ts:406](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L406)
***
@@ -115,6 +101,8 @@ this isn't cleaned automatically. Non selected objects may have wrong values
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
@@ -123,27 +111,15 @@ this takes priority over the generic control visibility
`StyledText._controlsVisibility`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
-
***
### \_fontSizeMult
> **\_fontSizeMult**: `number`
-Text Line proportion to font Size (in pixels)
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
+Defined in: [src/shapes/Text/Text.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L340)
-[src/shapes/Text/Text.ts:339](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L339)
+Text Line proportion to font Size (in pixels)
***
@@ -151,6 +127,8 @@ Text Line proportion to font Size (in pixels)
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -165,19 +143,13 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
`StyledText._scaling`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
***
### \_text
> **\_text**: `string`[]
-#### Defined in
-
-[src/shapes/Text/Text.ts:409](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L409)
+Defined in: [src/shapes/Text/Text.ts:403](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L403)
***
@@ -185,52 +157,21 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
> **\_textLines**: `string`[][]
-same as textlines, but each line is an array of graphemes as split by splitByGrapheme
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Text/Text.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L400)
-```
+same as textlines, but each line is an array of graphemes as split by splitByGrapheme
#### Overrides
`StyledText._textLines`
-#### Defined in
-
-[src/shapes/Text/Text.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L406)
-
***
### \_unwrappedTextLines
> **\_unwrappedTextLines**: `string`[][]
-#### Defined in
-
-[src/shapes/Text/Text.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L408)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/fabrictext/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/fabrictext/#calcacoords)
-
-#### Inherited from
-
-`StyledText.aCoords`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
+Defined in: [src/shapes/Text/Text.ts:402](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L402)
***
@@ -238,6 +179,8 @@ You can calculate them without updating with [()](../../../../api/classes/fabric
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -255,9 +198,24 @@ false
`StyledText.absolutePositioned`
-#### Defined in
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/fabrictext/#setcoords).
+You can calculate them without updating with [()](/api/classes/fabrictext/#calcacoords)
+
+#### Inherited from
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+`StyledText.aCoords`
***
@@ -265,6 +223,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -277,39 +237,29 @@ Angle of rotation of an object (in degrees)
`StyledText.angle`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
-
***
### backgroundColor
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Inherited from
`StyledText.backgroundColor`
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
-
***
### borderColor
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -322,16 +272,14 @@ rgb(178,204,255)
`StyledText.borderColor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
-
***
### borderDashArray
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -342,16 +290,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
`StyledText.borderDashArray`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
-
***
### borderOpacityWhenMoving
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -364,20 +310,19 @@ Opacity of object's controlling borders when object is active and moving
`StyledText.borderOpacityWhenMoving`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
-
***
### borderScaleFactor
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -389,16 +334,14 @@ since there is no way to change the border itself.
`StyledText.borderScaleFactor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
-
***
### centeredRotation
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -409,26 +352,18 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
`StyledText.centeredRotation`
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
-
***
### centeredScaling
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -436,63 +371,30 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Inherited from
`StyledText.centeredScaling`
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
-
-***
-
-### charSpacing
-
-> **charSpacing**: `number`
-
-additional space between characters
-expressed in thousands of em unit
-
-#### Default
-
-```ts
-
-```
-
-#### Implementation of
-
-`UniqueTextProps.charSpacing`
-
-#### Defined in
-
-[src/shapes/Text/Text.ts:347](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L347)
-
***
### clipPath?
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
#### Inherited from
`StyledText.clipPath`
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
-
***
### clipPathId?
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
@@ -500,16 +402,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
`StyledText.clipPathId`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
-
***
### controls
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
@@ -517,16 +417,14 @@ controls are added by default_controls.js
`StyledText.controls`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
-
***
### cornerColor
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -539,16 +437,14 @@ rgb(178,204,255)
`StyledText.cornerColor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
-
***
### cornerDashArray
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -565,16 +461,14 @@ null
`StyledText.cornerDashArray`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
-
***
### cornerSize
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -587,16 +481,14 @@ Size of object's controlling corners (in pixels)
`StyledText.cornerSize`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
-
***
### cornerStrokeColor
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -613,20 +505,22 @@ Color of controlling corners of an object (when it's active and transparentCorne
`StyledText.cornerStrokeColor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
-
***
### ~~cornerStyle~~
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -637,27 +531,17 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Inherited from
`StyledText.cornerStyle`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
-
***
### cursorWidth
> **cursorWidth**: `number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:410](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L410)
+Defined in: [src/shapes/Text/Text.ts:404](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L404)
***
@@ -665,17 +549,9 @@ This API is no longer supported and may be removed in a future release.
> **deltaY**: `number`
-Baseline shift, styles only, keep at 0 for the main text object
-
-#### Default
-
-```ts
-
-```
-
-#### Defined in
+Defined in: [src/shapes/Text/Text.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L353)
-[src/shapes/Text/Text.ts:354](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L354)
+Baseline shift, styles only, keep at 0 for the main text object
***
@@ -683,6 +559,8 @@ Baseline shift, styles only, keep at 0 for the main text object
> **direction**: `CanvasDirection`
+Defined in: [src/shapes/Text/Text.ts:365](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L365)
+
WARNING: EXPERIMENTAL. NOT SUPPORTED YET
determine the direction of the text.
This has to be set manually together with textAlign and originX for proper
@@ -694,26 +572,18 @@ https://www.w3.org/International/questions/qa-bidi-unicode-controls
4.5.0
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.direction`
-#### Defined in
-
-[src/shapes/Text/Text.ts:367](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L367)
-
***
### dirty
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -727,78 +597,58 @@ true
`StyledText.dirty`
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
-
***
### evented
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Inherited from
`StyledText.evented`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
-
***
### excludeFromExport
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Inherited from
`StyledText.excludeFromExport`
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
-
***
### fill
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
#### Inherited from
`StyledText.fill`
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
-
***
### fillRule
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -813,16 +663,14 @@ nonzero
`StyledText.fillRule`
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
-
***
### flipX
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -835,16 +683,14 @@ false
`StyledText.flipX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
-
***
### flipY
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -857,148 +703,98 @@ false
`StyledText.flipY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
-
***
### fontFamily
> **fontFamily**: `string`
-Font family
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Text/Text.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L188)
-```
+Font family
#### Implementation of
`UniqueTextProps.fontFamily`
-#### Defined in
-
-[src/shapes/Text/Text.ts:188](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L188)
-
***
### fontSize
> **fontSize**: `number`
-Font size (in pixels)
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Text/Text.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L176)
-```
+Font size (in pixels)
#### Implementation of
`UniqueTextProps.fontSize`
-#### Defined in
-
-[src/shapes/Text/Text.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L174)
-
***
### fontStyle
> **fontStyle**: `string`
+Defined in: [src/shapes/Text/Text.ts:219](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L219)
+
Font style . Possible values: "", "normal", "italic" or "oblique".
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.fontStyle`
-#### Defined in
-
-[src/shapes/Text/Text.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L224)
-
***
### fontWeight
> **fontWeight**: `string` \| `number`
-Font weight (e.g. bold, normal, 400, 600, 800)
+Defined in: [src/shapes/Text/Text.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L182)
-#### Default
-
-```ts
-
-```
+Font weight (e.g. bold, normal, 400, 600, 800)
#### Implementation of
`UniqueTextProps.fontWeight`
-#### Defined in
-
-[src/shapes/Text/Text.ts:181](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L181)
-
***
### globalCompositeOperation
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```ts
-
-```
+Composite rule used for canvas globalCompositeOperation
#### Inherited from
`StyledText.globalCompositeOperation`
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
-
***
### hasBorders
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-#### Default
-
-```ts
-
-```
+When set to `false`, object's controlling borders are not rendered
#### Inherited from
`StyledText.hasBorders`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
-
***
### hasControls
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -1011,38 +807,28 @@ true
`StyledText.hasControls`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
-
***
### height
> **height**: `number`
-Object height
-
-#### Default
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```ts
-
-```
+Object height
#### Inherited from
`StyledText.height`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
-
***
### hoverCursor
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -1055,9 +841,20 @@ null
`StyledText.hoverCursor`
-#### Defined in
+***
+
+### charSpacing
+
+> **charSpacing**: `number`
+
+Defined in: [src/shapes/Text/Text.ts:347](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L347)
+
+additional space between characters
+expressed in thousands of em unit
+
+#### Implementation of
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
+`UniqueTextProps.charSpacing`
***
@@ -1065,31 +862,21 @@ null
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Inherited from
`StyledText.includeDefaultValues`
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
-
***
### initialized?
> `optional` **initialized**: `true`
-#### Defined in
-
-[src/shapes/Text/Text.ts:413](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L413)
+Defined in: [src/shapes/Text/Text.ts:407](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L407)
***
@@ -1097,6 +884,8 @@ When `false`, default object's values are not included in its serialization
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -1111,16 +900,14 @@ false
`StyledText.inverted`
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
-
***
### isMoving?
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
@@ -1128,19 +915,17 @@ part of the move action.
`StyledText.isMoving`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -1152,245 +937,169 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
`StyledText.left`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
-
***
### lineHeight
> **lineHeight**: `number`
-Line height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Text/Text.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L225)
-```
+Line height
#### Implementation of
`UniqueTextProps.lineHeight`
-#### Defined in
-
-[src/shapes/Text/Text.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L231)
-
***
### linethrough
> **linethrough**: `boolean`
-Text decoration linethrough.
-
-#### Default
+Defined in: [src/shapes/Text/Text.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L206)
-```ts
-
-```
+Text decoration linethrough.
#### Implementation of
`UniqueTextProps.linethrough`
-#### Defined in
-
-[src/shapes/Text/Text.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L209)
-
***
### lockMovementX
> **lockMovementX**: `boolean`
-When `true`, object horizontal movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
-```
+When `true`, object horizontal movement is locked
#### Inherited from
`StyledText.lockMovementX`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
-
***
### lockMovementY
> **lockMovementY**: `boolean`
-When `true`, object vertical movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
-```
+When `true`, object vertical movement is locked
#### Inherited from
`StyledText.lockMovementY`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
-
***
### lockRotation
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Inherited from
`StyledText.lockRotation`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
-
***
### lockScalingFlip
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```ts
-
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Inherited from
`StyledText.lockScalingFlip`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
-
***
### lockScalingX
> **lockScalingX**: `boolean`
-When `true`, object horizontal scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
-```
+When `true`, object horizontal scaling is locked
#### Inherited from
`StyledText.lockScalingX`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
-
***
### lockScalingY
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-#### Default
-
-```ts
-
-```
+When `true`, object vertical scaling is locked
#### Inherited from
`StyledText.lockScalingY`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
-
***
### lockSkewingX
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```ts
-
-```
+When `true`, object horizontal skewing is locked
#### Inherited from
`StyledText.lockSkewingX`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
-
***
### lockSkewingY
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Inherited from
`StyledText.lockSkewingY`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
-
***
### matrixCache?
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
`StyledText.matrixCache`
-#### Defined in
+***
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
+### MIN\_TEXT\_WIDTH
+
+> **MIN\_TEXT\_WIDTH**: `number`
+
+Defined in: [src/shapes/Text/Text.ts:387](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L387)
+
+contains the min text width to avoid getting 0
***
@@ -1398,6 +1107,8 @@ storage cache for object full transform matrix
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1410,16 +1121,14 @@ Minimum allowed scale value of an object
`StyledText.minScaleLimit`
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
-
***
### moveCursor
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1432,16 +1141,14 @@ null
`StyledText.moveCursor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
-
***
### noScaleCache
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1458,35 +1165,14 @@ true
`StyledText.noScaleCache`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-`StyledText.oCoords`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
-
***
### objectCaching
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1505,9 +1191,22 @@ true
`StyledText.objectCaching`
-#### Defined in
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
+
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
+
+#### Inherited from
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+`StyledText.oCoords`
***
@@ -1515,6 +1214,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1527,16 +1228,14 @@ Opacity of an object
`StyledText.opacity`
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
-
***
### ~~originX~~
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1545,16 +1244,14 @@ please use 'center' as value in new projects
`StyledText.originX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
-
***
### ~~originY~~
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1563,54 +1260,42 @@ please use 'center' as value in new projects
`StyledText.originY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
-
***
### overline
> **overline**: `boolean`
-Text decoration overline.
-
-#### Default
+Defined in: [src/shapes/Text/Text.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L200)
-```ts
-
-```
+Text decoration overline.
#### Implementation of
`UniqueTextProps.overline`
-#### Defined in
-
-[src/shapes/Text/Text.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L202)
-
***
### ownMatrixCache?
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
`StyledText.ownMatrixCache`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
-
***
### padding
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1623,38 +1308,28 @@ Padding between object and its controlling borders (in pixels)
`StyledText.padding`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
-
***
### paintFirst
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```ts
-
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Inherited from
`StyledText.paintFirst`
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
-
***
### parent?
> `optional` **parent**: [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
+
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
@@ -1662,16 +1337,14 @@ Used to keep the original parent ref when the object has been added to an Active
`StyledText.parent`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
-
***
### path?
> `optional` **path**: [`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Text/Text.ts:288](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L288)
+
Path that the text should follow.
since 4.6.0 the path will be drawn automatically.
if you want to make the path visible, give it a stroke and strokeWidth or fill value
@@ -1695,115 +1368,75 @@ const textPath = new Text('Text on a path', {
});
```
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.path`
-#### Defined in
-
-[src/shapes/Text/Text.ts:296](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L296)
-
***
### pathAlign
> **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/)
+Defined in: [src/shapes/Text/Text.ts:324](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L324)
+
How text is aligned to the path. This property determines
the perpendicular position of each character relative to the path.
(one of "baseline", "center", "ascender", "descender")
This feature is in BETA, and its behavior may change
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.pathAlign`
-#### Defined in
-
-[src/shapes/Text/Text.ts:322](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L322)
-
***
### pathSide
> **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/)
+Defined in: [src/shapes/Text/Text.ts:315](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L315)
+
Which side of the path the text should be drawn on.
Only used when text has a path
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.pathSide`
-#### Defined in
-
-[src/shapes/Text/Text.ts:312](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L312)
-
***
### pathStartOffset
> **pathStartOffset**: `number`
+Defined in: [src/shapes/Text/Text.ts:308](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L308)
+
Offset amount for text path starting position
Only used when text has a path
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/shapes/Text/Text.ts:304](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L304)
-
***
### perPixelTargetFind
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Inherited from
`StyledText.perPixelTargetFind`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
-
***
### scaleX
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1816,16 +1449,14 @@ Object scale factor (horizontal)
`StyledText.scaleX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
-
***
### scaleY
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1838,48 +1469,32 @@ Object scale factor (vertical)
`StyledText.scaleY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
-
***
### selectable
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Inherited from
`StyledText.selectable`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
-
***
### ~~selectionBackgroundColor~~
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1888,30 +1503,26 @@ This API is no longer supported and may be removed in a future release.
`StyledText.selectionBackgroundColor`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
-
***
### shadow
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
#### Inherited from
`StyledText.shadow`
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
-
***
### skewX
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1924,16 +1535,14 @@ Angle of skew on x axes of an object (in degrees)
`StyledText.skewX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
-
***
### skewY
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1946,32 +1555,28 @@ Angle of skew on y axes of an object (in degrees)
`StyledText.skewY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
-
***
### snapAngle?
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Inherited from
`StyledText.snapAngle`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
-
***
### snapThreshold?
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1979,30 +1584,26 @@ When undefined, the snapThreshold will default to the snapAngle.
`StyledText.snapThreshold`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
-
***
### stroke
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
#### Inherited from
`StyledText.stroke`
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
-
***
### strokeDashArray
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -2015,16 +1616,14 @@ null;
`StyledText.strokeDashArray`
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
-
***
### strokeDashOffset
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -2037,16 +1636,14 @@ Line offset of an object's stroke
`StyledText.strokeDashOffset`
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
-
***
### strokeLineCap
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -2059,38 +1656,28 @@ butt
`StyledText.strokeLineCap`
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
-
***
### strokeLineJoin
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-#### Default
-
-```ts
-
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Inherited from
`StyledText.strokeLineJoin`
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
-
***
### strokeMiterLimit
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -2103,16 +1690,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
`StyledText.strokeMiterLimit`
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
-
***
### strokeUniform
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -2138,16 +1723,14 @@ false
`StyledText.strokeUniform`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
-
***
### strokeWidth
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -2160,30 +1743,26 @@ Width of a stroke used to render this object
`StyledText.strokeWidth`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
-
***
### styles
> **styles**: [`TextStyle`](/api/type-aliases/textstyle/)
+Defined in: [src/shapes/Text/Text.ts:265](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L265)
+
#### Overrides
`StyledText.styles`
-#### Defined in
-
-[src/shapes/Text/Text.ts:272](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L272)
-
***
### subscript
> **subscript**: `object`
+Defined in: [src/shapes/Text/Text.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L246)
+
Subscript schema object (minimum overlap)
#### baseline
@@ -2210,16 +1789,14 @@ fontSize factor
0.6
```
-#### Defined in
-
-[src/shapes/Text/Text.ts:252](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L252)
-
***
### superscript
> **superscript**: `object`
+Defined in: [src/shapes/Text/Text.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L230)
+
Superscript schema object (minimum overlap)
#### baseline
@@ -2246,19 +1823,13 @@ fontSize factor
0.6
```
-#### Defined in
-
-[src/shapes/Text/Text.ts:236](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L236)
-
***
### text
> **text**: `string`
-#### Defined in
-
-[src/shapes/Text/Text.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L167)
+Defined in: [src/shapes/Text/Text.ts:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L170)
***
@@ -2266,40 +1837,52 @@ fontSize factor
> **textAlign**: `string`
+Defined in: [src/shapes/Text/Text.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L213)
+
Text alignment. Possible values: "left", "center", "right", "justify",
"justify-left", "justify-center" or "justify-right".
-#### Default
-
-```ts
-
-```
-
#### Implementation of
`UniqueTextProps.textAlign`
-#### Defined in
-
-[src/shapes/Text/Text.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L217)
-
***
### textBackgroundColor
> **textBackgroundColor**: `string`
+Defined in: [src/shapes/Text/Text.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L263)
+
Background color of text lines
+***
+
+### textDecorationThickness
+
+> **textDecorationThickness**: `number`
+
+Defined in: [src/shapes/Text/Text.ts:302](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L302)
+
+The text decoration tickness for underline, overline and strikethrough
+The tickness is expressed in thousandths of fontSize ( em ).
+The original value was 1/15 that translates to 66.6667 thousandths.
+The choice of unit of measure is to align with charSpacing.
+You can slim the tickness without issues, while large underline or overline may end up
+outside the bounding box of the text. In order to fix that a bigger refactor of the code
+is needed and is out of scope for now. If you need such large overline on the first line
+of text or large underline on the last line of text, consider disabling caching as a
+workaround
+
#### Default
```ts
-
+66.667
```
-#### Defined in
+#### Implementation of
-[src/shapes/Text/Text.ts:270](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L270)
+`UniqueTextProps.textDecorationThickness`
***
@@ -2307,28 +1890,22 @@ Background color of text lines
> **textLines**: `string`[]
+Defined in: [src/shapes/Text/Text.ts:394](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L394)
+
contains the the text of the object, divided in lines as they are displayed
on screen. Wrapping will divide the text independently of line breaks
-#### Default
-
-```ts
-
-```
-
-#### Defined in
-
-[src/shapes/Text/Text.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L399)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -2340,16 +1917,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
`StyledText.top`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
-
***
### touchCornerSize
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -2362,16 +1937,14 @@ Size of object's controlling corners when touch interaction is detected
`StyledText.touchCornerSize`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
-
***
### transparentCorners
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -2384,94 +1957,47 @@ true
`StyledText.transparentCorners`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
-
***
### underline
> **underline**: `boolean`
-Text decoration underline.
-
-#### Default
+Defined in: [src/shapes/Text/Text.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L194)
-```ts
-
-```
+Text decoration underline.
#### Implementation of
`UniqueTextProps.underline`
-#### Defined in
-
-[src/shapes/Text/Text.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L195)
-
-***
-
-### visible
-
-> **visible**: `boolean`
-
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
-
-```
-
-#### Inherited from
-
-`StyledText.visible`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
-
-***
-
-### width
-
-> **width**: `number`
-
-Object width
-
-#### Default
-
-```ts
-
-```
+***
-#### Inherited from
+### visible
-`StyledText.width`
+> **visible**: `boolean`
-#### Defined in
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
+When set to `false`, an object is not rendered on canvas
-***
+#### Inherited from
-### ATTRIBUTE\_NAMES
+`StyledText.visible`
-> `static` **ATTRIBUTE\_NAMES**: `string`[]
+***
-List of attribute names to account for when parsing SVG element (used by [FabricText.fromElement](../../../../api/classes/fabrictext/#fromelement))
+### width
-#### Static
+> **width**: `number`
-#### Member Of
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-Text
-@see: http://www.w3.org/TR/SVG/text.html#TextElement
+Object width
-#### Defined in
+#### Inherited from
-[src/shapes/Text/Text.ts:1826](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1826)
+`StyledText.width`
***
@@ -2479,13 +2005,22 @@ Text
> `static` **\_styleProperties**: readonly `StylePropertiesType`[] = `styleProperties`
+Defined in: [src/shapes/Text/StyledText.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L30)
+
#### Inherited from
`StyledText._styleProperties`
-#### Defined in
+***
+
+### ATTRIBUTE\_NAMES
+
+> `static` **ATTRIBUTE\_NAMES**: `string`[]
+
+Defined in: [src/shapes/Text/Text.ts:1836](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1836)
-[src/shapes/Text/StyledText.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L30)
+List of attribute names to account for when parsing SVG element (used by [FabricText.fromElement](/api/classes/fabrictext/#fromelement))
+@see: http://www.w3.org/TR/SVG/text.html#TextElement
***
@@ -2493,6 +2028,8 @@ Text
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Text/Text.ts:409](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L409)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -2502,32 +2039,28 @@ and refreshed at the next render
`StyledText.cacheProperties`
-#### Defined in
-
-[src/shapes/Text/Text.ts:415](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L415)
-
***
### colorProperties
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
`StyledText.colorProperties`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
-
***
### customProperties
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
@@ -2535,46 +2068,40 @@ instance.toObject() gets called
`StyledText.customProperties`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
-
***
### genericFonts
> `static` **genericFonts**: `string`[]
+Defined in: [src/shapes/Text/Text.ts:1814](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1814)
+
List of generic font families
#### See
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
-#### Defined in
-
-[src/shapes/Text/Text.ts:1802](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1802)
-
***
### ownDefaults
-> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`FabricText`](/api/classes/fabrictext/)\<`Partial`\<[`TextProps`](/api/interfaces/textprops/)\>, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `textDefaultValues`
+> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`FabricText`\<`Partial`\<[`TextProps`](/api/interfaces/textprops/)\>, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `textDefaultValues`
+
+Defined in: [src/shapes/Text/Text.ts:411](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L411)
#### Overrides
`StyledText.ownDefaults`
-#### Defined in
-
-[src/shapes/Text/Text.ts:417](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L417)
-
***
### stateProperties
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
@@ -2583,16 +2110,14 @@ needs its cache regenerated during a .set call
`StyledText.stateProperties`
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
-
***
### type
> `static` **type**: `string` = `'Text'`
+Defined in: [src/shapes/Text/Text.ts:413](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L413)
+
The class type.
This is used for serialization and deserialization purposes and internally it can be used
to identify classes.
@@ -2606,22 +2131,22 @@ We do not do that in fabricJS code because we want to try to have code splitting
`StyledText.type`
-#### Defined in
-
-[src/shapes/Text/Text.ts:419](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L419)
-
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2629,23 +2154,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-`StyledText.type`
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#type-1)
## Methods
@@ -2653,15 +2184,23 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`CanvasRenderingContext2D`
-• **context**: `DrawContext`
+##### clipPath
+
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
#### Returns
@@ -2671,23 +2210,25 @@ Prepare clipPath state and cache and draw it on instance's cache
`StyledText._drawClipPath`
-#### Defined in
-
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
-
***
### \_getFontDeclaration()
-> **\_getFontDeclaration**(`__namedParameters`?, `forMeasuring`?): `string`
+> **\_getFontDeclaration**(`__namedParameters?`, `forMeasuring?`): `string`
+
+Defined in: [src/shapes/Text/Text.ts:1673](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1673)
return font declaration string for canvas context
#### Parameters
-• **\_\_namedParameters?**: `Partial`\<`Pick`\<`Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>, `"fontFamily"` \| `"fontSize"` \| `"fontStyle"` \| `"fontWeight"`\>\> = `{}`
+##### \_\_namedParameters?
+
+`Partial`\<`Pick`\<[`TextStyleDeclaration`](/api/type-aliases/textstyledeclaration/), `"fontFamily"` \| `"fontStyle"` \| `"fontWeight"` \| `"fontSize"`\>\> = `{}`
+
+##### forMeasuring?
-• **forMeasuring?**: `boolean`
+`boolean`
#### Returns
@@ -2695,35 +2236,43 @@ return font declaration string for canvas context
font declaration formatted for canvas context.
-#### Defined in
-
-[src/shapes/Text/Text.ts:1661](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1661)
-
***
### \_getGraphemeBox()
-> **\_getGraphemeBox**(`grapheme`, `lineIndex`, `charIndex`, `prevGrapheme`?, `skipLeft`?): [`GraphemeBBox`](/api/type-aliases/graphemebbox/)
+> **\_getGraphemeBox**(`grapheme`, `lineIndex`, `charIndex`, `prevGrapheme?`, `skipLeft?`): [`GraphemeBBox`](/api/type-aliases/graphemebbox/)
+
+Defined in: [src/shapes/Text/Text.ts:977](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L977)
#### Parameters
-• **grapheme**: `string`
+##### grapheme
+
+`string`
to be measured
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
index of the line where the char is
-• **charIndex**: `number`
+##### charIndex
+
+`number`
position in the line
-• **prevGrapheme?**: `string`
+##### prevGrapheme?
+
+`string`
character preceding the one to be measured
-• **skipLeft?**: `boolean`
+##### skipLeft?
+
+`boolean`
#### Returns
@@ -2731,70 +2280,63 @@ character preceding the one to be measured
grapheme bbox
-#### Defined in
-
-[src/shapes/Text/Text.ts:983](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L983)
-
***
### \_getWidthOfCharSpacing()
> **\_getWidthOfCharSpacing**(): `number`
+Defined in: [src/shapes/Text/Text.ts:1522](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1522)
+
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1528)
-
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
`StyledText._limitCacheSize`
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
-
***
### \_measureLine()
> **\_measureLine**(`lineIndex`): `object`
+Defined in: [src/shapes/Text/Text.ts:885](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L885)
+
measure every grapheme of a line, populating __charBounds
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
#### Returns
@@ -2802,8 +2344,6 @@ measure every grapheme of a line, populating __charBounds
object.width total width of characters
-object.numOfSpaces length of chars that match this._reSpacesAndTabs
-
##### numOfSpaces
> **numOfSpaces**: `number` = `0`
@@ -2812,16 +2352,14 @@ object.numOfSpaces length of chars that match this._reSpacesAndTabs
> **width**: `number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:891](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L891)
-
***
### \_removeCacheCanvas()
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2832,26 +2370,28 @@ Remove cacheCanvas and its dimensions from the objects
`StyledText._removeCacheCanvas`
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
-
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2867,19 +2407,19 @@ move to interactivity
`StyledText._renderControls`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
-
***
### \_setClippingProperties()
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2889,24 +2429,26 @@ move to interactivity
`StyledText._setClippingProperties`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
-
***
### \_setFillStyles()
> **\_setFillStyles**(`ctx`, `style`): `object`
+Defined in: [src/shapes/Text/Text.ts:1335](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1335)
+
This function prepare the canvas for a ill style, and fill
need to be sent in as defined
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **style**: `Pick`\<[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\>
+##### style
+
+`Pick`\<`this`, `"fill"`\>
with ill defined
@@ -2926,24 +2468,26 @@ with ill defined
`StyledText._setFillStyles`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1341](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1341)
-
***
### \_setStrokeStyles()
> **\_setStrokeStyles**(`ctx`, `style`): `object`
+Defined in: [src/shapes/Text/Text.ts:1313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1313)
+
This function prepare the canvas for a stroke style, and stroke and strokeWidth
need to be sent in as defined
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### style
-• **style**: `Pick`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/), `"stroke"` \| `"strokeWidth"`\>
+`Pick`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/), `"stroke"` \| `"strokeWidth"`\>
with stroke and strokeWidth defined
@@ -2963,22 +2507,22 @@ with stroke and strokeWidth defined
`StyledText._setStrokeStyles`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1319](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1319)
-
***
### \_setupCompositeOperation()
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2990,21 +2534,21 @@ Rendering canvas context
`StyledText._setupCompositeOperation`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
-
***
### \_splitTextIntoLines()
> **\_splitTextIntoLines**(`text`): `TextLinesInfo`
+Defined in: [src/shapes/Text/Text.ts:1741](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1741)
+
Returns the text as an array of lines.
#### Parameters
-• **text**: `string`
+##### text
+
+`string`
text to split
@@ -3014,15 +2558,13 @@ text to split
Lines in the text
-#### Defined in
-
-[src/shapes/Text/Text.ts:1729](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1729)
-
***
### \_toSVG()
-> **\_toSVG**(`_reviver`?): `string`[]
+> **\_toSVG**(`_reviver?`): `string`[]
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L121)
Returns svg representation of an instance
This function is implemented in each subclass
@@ -3030,7 +2572,9 @@ This is just because typescript otherwise cryies all the time
#### Parameters
-• **\_reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### \_reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
#### Returns
@@ -3043,19 +2587,19 @@ of the instance
`StyledText._toSVG`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L120)
-
***
### addPaintOrder()
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -3065,33 +2609,37 @@ of the instance
`StyledText.addPaintOrder`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
-
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -3100,24 +2648,22 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
`StyledText.animate`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
-
***
### calcACoords()
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -3129,16 +2675,14 @@ those never change with zoom or viewport changes.
`StyledText.calcACoords`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
-
***
### calcOCoords()
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -3152,16 +2696,14 @@ is a public api and should be done just if extremely necessary
`StyledText.calcOCoords`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
-
***
### calcOwnMatrix()
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -3175,38 +2717,36 @@ transform matrix for the object
`StyledText.calcOwnMatrix`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
-
***
### calcTextHeight()
> **calcTextHeight**(): `number`
+Defined in: [src/shapes/Text/Text.ts:1038](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1038)
+
Calculate text box height
#### Returns
`number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1044](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1044)
-
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -3221,21 +2761,21 @@ transform matrix for the object
`StyledText.calcTransformMatrix`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
-
***
### canDrop()
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -3247,16 +2787,14 @@ true if the object currently dragged can be dropped on the target
`StyledText.canDrop`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
-
***
### cleanStyle()
> **cleanStyle**(`property`): `undefined` \| `false`
+Defined in: [src/shapes/Text/StyledText.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L101)
+
Check if characters in a text have a value for a property
whose value matches the textbox's value for that property. If so,
the character-level property is deleted. If the character
@@ -3266,9 +2804,9 @@ then it also is deleted.
#### Parameters
-• **property**: `StylePropertiesType`
+##### property
-The property to compare between characters and text.
+`StylePropertiesType`
#### Returns
@@ -3278,15 +2816,13 @@ The property to compare between characters and text.
`StyledText.cleanStyle`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L103)
-
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -3295,7 +2831,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -3314,41 +2852,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
`StyledText.clearContextTop`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
-
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`FabricText`\<`Props`, `SProps`, `EventSpec`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>\>
+`Promise`\<`FabricText`\<`Props`, `SProps`, `EventSpec`\>\>
#### Inherited from
`StyledText.clone`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
-
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -3359,13 +2895,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -3377,16 +2915,14 @@ fix the export type, it could not be Image but the type that getClass return for
`StyledText.cloneAsImage`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
-
***
### complexity()
> **complexity**(): `number`
+Defined in: [src/shapes/Text/Text.ts:1806](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1806)
+
Returns complexity of an instance
#### Returns
@@ -3399,21 +2935,21 @@ complexity
`StyledText.complexity`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1794](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1794)
-
***
### containsPoint()
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -3427,16 +2963,14 @@ true if point is inside the object
`StyledText.containsPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
-
***
### dispose()
> **dispose**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1494](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1494)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -3448,15 +2982,13 @@ override if necessary to dispose artifacts such as `clipPath`
`StyledText.dispose`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1528](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1528)
-
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -3464,15 +2996,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -3484,23 +3022,25 @@ object to override the object style
`StyledText.drawBorders`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
-
***
### drawCacheOnCanvas()
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
+
+`TCachedFabricObject`
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -3512,27 +3052,31 @@ Context to render on
`StyledText.drawCacheOnCanvas`
-#### Defined in
-
-[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942)
-
***
### drawClipPathOnCache()
> **drawClipPathOnCache**(`ctx`, `clipPath`, `canvasWithClipPath`): `void`
+Defined in: [src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L799)
+
Execute the drawing operation for an object clipPath
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### clipPath
+
+[`BaseFabricObject`](/api/classes/basefabricobject/)
-• **canvasWithClipPath**: `HTMLCanvasElement`
+##### canvasWithClipPath
+
+`HTMLCanvasElement`
#### Returns
@@ -3542,16 +3086,14 @@ Context to render on
`StyledText.drawClipPathOnCache`
-#### Defined in
-
-[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847)
-
***
### drawControls()
> **drawControls**(`ctx`, `styleOverride`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L550)
+
Draws corners of an object's bounding box.
Requires public properties: width, height
Requires public options: cornerSize, padding
@@ -3561,11 +3103,15 @@ is outside the standard selection and transform process.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **styleOverride**: `Partial`\<`Pick`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>, `"cornerStyle"` \| `"cornerSize"` \| `"cornerColor"` \| `"cornerStrokeColor"` \| `"cornerDashArray"` \| `"transparentCorners"`\>\> = `{}`
+##### styleOverride
+
+`ControlRenderingStyleOverride` = `{}`
object to override the object style
@@ -3577,27 +3123,29 @@ object to override the object style
`StyledText.drawControls`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550)
-
***
### drawControlsConnectingLines()
> **drawControlsConnectingLines**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L517)
+
Draws lines from a borders of an object's bounding box to controls that have `withConnection` property set.
Requires public properties: width, height
Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
object size x = width, y = height
@@ -3609,29 +3157,33 @@ object size x = width, y = height
`StyledText.drawControlsConnectingLines`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517)
-
***
### drawObject()
> **drawObject**(`ctx`, `forClipping`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L823)
+
Execute the drawing operation for an object on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **forClipping**: `undefined` \| `boolean`
+##### forClipping
apply clipping styles
-• **context**: `DrawContext`
+`undefined` | `boolean`
+
+##### context
+
+[`DrawContext`](/api/type-aliases/drawcontext/)
additional context for rendering
@@ -3643,16 +3195,14 @@ additional context for rendering
`StyledText.drawObject`
-#### Defined in
-
-[src/shapes/Object/Object.ts:872](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L872)
-
***
### drawSelectionBackground()
> **drawSelectionBackground**(`ctx`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L375)
+
Draws a colored layer behind the object, inside its selection borders.
Requires public options: padding, selectionBackgroundColor
this function is called when the context is transformed
@@ -3660,7 +3210,9 @@ has checks to be skipped when the object is on a staticCanvas
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
@@ -3678,41 +3230,41 @@ it seemed a good option, now is an edge case
`StyledText.drawSelectionBackground`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375)
-
***
### enlargeSpaces()
> **enlargeSpaces**(): `void`
+Defined in: [src/shapes/Text/Text.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L485)
+
Enlarge space boxes and shift the others
#### Returns
`void`
-#### Defined in
-
-[src/shapes/Text/Text.ts:491](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L491)
-
***
### findCommonAncestors()
> **findCommonAncestors**\<`T`\>(`other`): `AncestryComparison`
+Defined in: [src/shapes/Object/Object.ts:1641](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1641)
+
Compare ancestors
#### Type Parameters
-• **T** *extends* [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -3724,29 +3276,33 @@ an object that represent the ancestry situation.
`StyledText.findCommonAncestors`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675)
-
***
### fire()
-> **fire**\<`K`\>(`eventName`, `options`?): `void`
+> **fire**\<`K`\>(`eventName`, `options?`): `void`
+
+Defined in: [src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L167)
Fires event with an optional options object
#### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol`
#### Parameters
-• **eventName**: `K`
+##### eventName
+
+`K`
Event name to fire
-• **options?**: `EventSpec`\[`K`\]
+##### options?
+
+`EventSpec`\[`K`\]
Options object
@@ -3758,22 +3314,22 @@ Options object
`StyledText.fire`
-#### Defined in
-
-[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167)
-
***
### forEachControl()
> **forEachControl**(`fn`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L353)
+
Calls a function for each control. The function gets called,
with the control, the control's key and the object that is calling the iterator
#### Parameters
-• **fn**
+##### fn
+
+(`control`, `key`, `fabricObject`) => `any`
function to iterate over the controls over
@@ -3785,21 +3341,21 @@ function to iterate over the controls over
`StyledText.forEachControl`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353)
-
***
### get()
> **get**(`property`): `any`
+Defined in: [src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L59)
+
Basic getter
#### Parameters
-• **property**: `string`
+##### property
+
+`string`
Property name
@@ -3813,23 +3369,25 @@ value of a property
`StyledText.get`
-#### Defined in
-
-[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59)
-
***
### get2DCursorLocation()
-> **get2DCursorLocation**(`selectionStart`, `skipWrapping`?): `object`
+> **get2DCursorLocation**(`selectionStart`, `skipWrapping?`): `object`
+
+Defined in: [src/shapes/Text/Text.ts:549](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L549)
Returns 2d representation (lineIndex and charIndex) of cursor
#### Parameters
-• **selectionStart**: `number`
+##### selectionStart
+
+`number`
+
+##### skipWrapping?
-• **skipWrapping?**: `boolean`
+`boolean`
consider the location for unwrapped lines. useful to manage styles.
@@ -3849,34 +3407,30 @@ consider the location for unwrapped lines. useful to manage styles.
`StyledText.get2DCursorLocation`
-#### Defined in
-
-[src/shapes/Text/Text.ts:555](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L555)
-
***
### getActiveControl()
-> **getActiveControl**(): `undefined` \| `object`
+> **getActiveControl**(): `undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194)
#### Returns
-`undefined` \| `object`
+`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \}
#### Inherited from
`StyledText.getActiveControl`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194)
-
***
### getAncestors()
> **getAncestors**(): `Ancestors`
+Defined in: [src/shapes/Object/Object.ts:1624](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1624)
+
#### Returns
`Ancestors`
@@ -3887,16 +3441,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top
`StyledText.getAncestors`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658)
-
***
### getBoundingRect()
> **getBoundingRect**(): [`TBBox`](/api/type-aliases/tbbox/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L343)
+
Returns coordinates of object's bounding rectangle (left, top, width, height)
the box is intended as aligned to axis of canvas.
@@ -3910,16 +3462,14 @@ Object with left, top, width, height properties
`StyledText.getBoundingRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343)
-
***
### getCanvasRetinaScaling()
> **getCanvasRetinaScaling**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L400)
+
#### Returns
`number`
@@ -3928,16 +3478,14 @@ Object with left, top, width, height properties
`StyledText.getCanvasRetinaScaling`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400)
-
***
### getCenterPoint()
> **getCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:733](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L733)
+
Returns the center coordinates of the object relative to canvas
#### Returns
@@ -3948,26 +3496,28 @@ Returns the center coordinates of the object relative to canvas
`StyledText.getCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732)
-
***
### getCompleteStyleDeclaration()
> **getCompleteStyleDeclaration**(`lineIndex`, `charIndex`): [`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)
+Defined in: [src/shapes/Text/StyledText.ts:276](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L276)
+
return a new object that contains all the style property for a character
the object returned is newly created
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
of the line where the character is
-• **charIndex**: `number`
+##### charIndex
+
+`number`
position of the character on the line
@@ -3981,16 +3531,14 @@ style object
`StyledText.getCompleteStyleDeclaration`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:279](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L279)
-
***
### getCoords()
> **getCoords**(): [`Point`](/api/classes/point/)[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L204)
+
#### Returns
[`Point`](/api/classes/point/)[]
@@ -4001,25 +3549,27 @@ style object
`StyledText.getCoords`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204)
-
***
### getHeightOfChar()
> **getHeightOfChar**(`line`, `_char`): `number`
+Defined in: [src/shapes/Text/Text.ts:860](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L860)
+
Computes height of character at given position
#### Parameters
-• **line**: `number`
+##### line
+
+`number`
the line index number
-• **\_char**: `number`
+##### \_char
+
+`number`
the character index number
@@ -4029,21 +3579,21 @@ the character index number
fontSize of the character
-#### Defined in
-
-[src/shapes/Text/Text.ts:866](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L866)
-
***
### getHeightOfLine()
> **getHeightOfLine**(`lineIndex`): `number`
+Defined in: [src/shapes/Text/Text.ts:1019](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1019)
+
Calculate height of line at 'lineIndex'
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
index of line to calculate
@@ -4051,16 +3601,14 @@ index of line to calculate
`number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1025](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1025)
-
***
### getObjectOpacity()
> **getObjectOpacity**(): `number`
+Defined in: [src/shapes/Object/Object.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L560)
+
Return the object opacity counting also the group property
#### Returns
@@ -4071,16 +3619,14 @@ Return the object opacity counting also the group property
`StyledText.getObjectOpacity`
-#### Defined in
-
-[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607)
-
***
### getObjectScaling()
> **getObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529)
+
Return the object scale factor counting also the group scaling
#### Returns
@@ -4091,16 +3637,14 @@ Return the object scale factor counting also the group scaling
`StyledText.getObjectScaling`
-#### Defined in
-
-[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576)
-
***
### getPointByOrigin()
> **getPointByOrigin**(`originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:763](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L763)
+
Returns the position of the object as if it has a different origin.
Take an object that has left, top set to 100, 100 with origin 'left', 'top'.
Return the values of left top ( wrapped in a point ) that you would need to keep
@@ -4110,11 +3654,15 @@ Alternatively you can use this to also find which point in the parent plane is a
#### Parameters
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -4126,16 +3674,14 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.getPointByOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762)
-
***
### getRelativeCenterPoint()
> **getRelativeCenterPoint**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:744](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L744)
+
Returns the center coordinates of the object relative to it's parent
#### Returns
@@ -4146,78 +3692,70 @@ Returns the center coordinates of the object relative to it's parent
`StyledText.getRelativeCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743)
-
***
### getRelativeX()
> **getRelativeX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L115)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getX](/api/api/classes/fabrictext/getx/#getx)
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getX](/api/classes/fabrictext/#getx)
#### Inherited from
`StyledText.getRelativeX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115)
-
***
### getRelativeXY()
> **getRelativeXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L176)
+
#### Returns
[`Point`](/api/classes/point/)
-x,y position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in parent's coordinate plane
+x,y position according to object's originX originY properties in parent's coordinate plane
#### Inherited from
`StyledText.getRelativeXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176)
-
***
### getRelativeY()
> **getRelativeY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L131)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [getY](/api/api/classes/fabrictext/gety/#gety)
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [getY](/api/classes/fabrictext/#gety)
#### Inherited from
`StyledText.getRelativeY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131)
-
***
### getScaledHeight()
> **getScaledHeight**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L361)
+
Returns height of an object bounding box counting transformations
#### Returns
@@ -4234,16 +3772,14 @@ shouldn't this account for group transform and return the actual size in canvas
`StyledText.getScaledHeight`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361)
-
***
### getScaledWidth()
> **getScaledWidth**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L352)
+
Returns width of an object's bounding box counting transformations
#### Returns
@@ -4260,29 +3796,33 @@ shouldn't this account for group transform and return the actual size in canvas
`StyledText.getScaledWidth`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352)
-
***
### getSelectionStyles()
-> **getSelectionStyles**(`startIndex`, `endIndex`?, `complete`?): `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[]
+> **getSelectionStyles**(`startIndex`, `endIndex?`, `complete?`): `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[]
+
+Defined in: [src/shapes/Text/StyledText.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L210)
Gets style of a current selection/cursor (at the start position)
#### Parameters
-• **startIndex**: `number`
+##### startIndex
+
+`number`
Start index to get styles at
-• **endIndex?**: `number`
+##### endIndex?
+
+`number`
End index to get styles at, if not specified startIndex + 1
-• **complete?**: `boolean`
+##### complete?
+
+`boolean`
get full style or not
@@ -4296,21 +3836,21 @@ styles an array with one, zero or more Style objects
`StyledText.getSelectionStyles`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:213](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L213)
-
***
### getSvgCommons()
> **getSvgCommons**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L85)
+
Returns id attribute for svg output
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> & `object`
#### Returns
@@ -4320,21 +3860,21 @@ Returns id attribute for svg output
`StyledText.getSvgCommons`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84)
-
***
### getSvgFilter()
> **getSvgFilter**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L77)
+
Returns filter for svg shadow
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -4344,23 +3884,25 @@ Returns filter for svg shadow
`StyledText.getSvgFilter`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76)
-
***
### getSvgStyles()
-> **getSvgStyles**(`this`, `skipShadow`?): `string`
+> **getSvgStyles**(`this`, `skipShadow?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L22)
Returns styles-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### skipShadow?
-• **skipShadow?**: `boolean`
+`boolean`
a boolean to skip shadow filter output
@@ -4372,25 +3914,29 @@ a boolean to skip shadow filter output
`StyledText.getSvgStyles`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L21)
-
***
### getSvgTransform()
-> **getSvgTransform**(`this`, `full`?, `additionalTransform`?): `string`
+> **getSvgTransform**(`this`, `full?`, `additionalTransform?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L104)
Returns transform-string for svg-export
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+
+##### full?
+
+`boolean`
-• **full?**: `boolean`
+##### additionalTransform?
-• **additionalTransform?**: `string` = `''`
+`string` = `''`
#### Returns
@@ -4400,16 +3946,14 @@ Returns transform-string for svg-export
`StyledText.getSvgTransform`
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103)
-
***
### getTotalAngle()
> **getTotalAngle**(): [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L408)
+
Returns the object angle relative to canvas counting also the group property
#### Returns
@@ -4420,16 +3964,14 @@ Returns the object angle relative to canvas counting also the group property
`StyledText.getTotalAngle`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408)
-
***
### getTotalObjectScaling()
> **getTotalObjectScaling**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/Object.ts:546](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L546)
+
Return the object scale factor counting also the group scaling, zoom and retina
#### Returns
@@ -4442,52 +3984,56 @@ object with scaleX and scaleY properties
`StyledText.getTotalObjectScaling`
-#### Defined in
-
-[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593)
-
***
### getValueOfPropertyAt()
-> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\]
+> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): `FabricText`\<`Props`, `SProps`, `EventSpec`\>\[`T`\]
+
+Defined in: [src/shapes/Text/Text.ts:1536](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1536)
Retrieves the value of property at given character position
#### Type Parameters
-• **T** *extends* `StylePropertiesType`
+##### T
+
+`T` *extends* `StylePropertiesType`
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
the line number
-• **charIndex**: `number`
+##### charIndex
+
+`number`
the character number
-• **property**: `T`
+##### property
+
+`T`
the property name
#### Returns
-[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\]
+`FabricText`\<`Props`, `SProps`, `EventSpec`\>\[`T`\]
the value of 'property'
-#### Defined in
-
-[src/shapes/Text/Text.ts:1542](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1542)
-
***
### getViewportTransform()
> **getViewportTransform**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L418)
+
Retrieves viewportTransform from Object's canvas if available
#### Returns
@@ -4498,81 +4044,75 @@ Retrieves viewportTransform from Object's canvas if available
`StyledText.getViewportTransform`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418)
-
***
### getX()
> **getX**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L86)
+
#### Returns
`number`
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) property in canvas coordinate plane
+x position according to object's originX property in canvas coordinate plane
#### Inherited from
`StyledText.getX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86)
-
***
### getXY()
> **getXY**(): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L146)
+
#### Returns
[`Point`](/api/classes/point/)
-x position according to object's [originX](/api/api/classes/fabricobject/originx/#originx) [originY](/api/api/classes/fabricobject/originy/#originy) properties in canvas coordinate plane
+x position according to object's originX originY properties in canvas coordinate plane
#### Inherited from
`StyledText.getXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146)
-
***
### getY()
> **getY**(): `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L100)
+
#### Returns
`number`
-y position according to object's [originY](/api/api/classes/fabricobject/originy/#originy) property in canvas coordinate plane
+y position according to object's originY property in canvas coordinate plane
#### Inherited from
`StyledText.getY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100)
-
***
### graphemeSplit()
> **graphemeSplit**(`value`): `string`[]
+Defined in: [src/shapes/Text/Text.ts:1732](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1732)
+
Override this method to customize grapheme splitting
#### Parameters
-• **value**: `string`
+##### value
+
+`string`
#### Returns
@@ -4586,27 +4126,33 @@ the util `graphemeSplit` needs to be injectable in some way.
is more comfortable to inject the correct util rather than having to override text
in the middle of the prototype chain
-#### Defined in
-
-[src/shapes/Text/Text.ts:1720](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1720)
-
***
### handleFiller()
> **handleFiller**\<`T`\>(`ctx`, `property`, `filler`): `object`
+Defined in: [src/shapes/Text/Text.ts:1273](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1273)
+
#### Type Parameters
-• **T** *extends* `"fill"` \| `"stroke"`
+##### T
+
+`T` *extends* `"fill"` \| `"stroke"`
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### property
-• **property**: \`$\{T\}Style\`
+`` `${T}Style` ``
-• **filler**: `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+##### filler
+
+`string` | [`TFiller`](/api/type-aliases/tfiller/)
#### Returns
@@ -4620,23 +4166,25 @@ in the middle of the prototype chain
> **offsetY**: `number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1279](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1279)
-
***
### hasCommonAncestors()
> **hasCommonAncestors**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1706)
+
#### Type Parameters
-• **T** *extends* [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -4646,15 +4194,13 @@ in the middle of the prototype chain
`StyledText.hasCommonAncestors`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740)
-
***
### hasFill()
-> **hasFill**(): `null` \| `boolean` \| `""`
+> **hasFill**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:738](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L738)
return true if the object will draw a fill
Does not consider text styles. This is just a shortcut used at rendering time
@@ -4665,7 +4211,7 @@ some use case where the fill is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4677,15 +4223,13 @@ Boolean
`StyledText.hasFill`
-#### Defined in
-
-[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787)
-
***
### hasStroke()
-> **hasStroke**(): `null` \| `boolean` \| `""`
+> **hasStroke**(): `boolean`
+
+Defined in: [src/shapes/Object/Object.ts:722](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L722)
return true if the object will draw a stroke
Does not consider text styles. This is just a shortcut used at rendering time
@@ -4696,7 +4240,7 @@ some use case where the stroke is invisible.
#### Returns
-`null` \| `boolean` \| `""`
+`boolean`
Boolean
@@ -4708,16 +4252,14 @@ Boolean
`StyledText.hasStroke`
-#### Defined in
-
-[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771)
-
***
### initDimensions()
> **initDimensions**(): `void`
+Defined in: [src/shapes/Text/Text.ts:464](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L464)
+
Initialize or update text dimensions.
Updates this.width and this.height with the proper values.
Does not return dimensions.
@@ -4726,21 +4268,21 @@ Does not return dimensions.
`void`
-#### Defined in
-
-[src/shapes/Text/Text.ts:470](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L470)
-
***
### intersectsWithObject()
> **intersectsWithObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L232)
+
Checks if object intersects with another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4754,23 +4296,25 @@ true if object intersects with another object
`StyledText.intersectsWithObject`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232)
-
***
### intersectsWithRect()
> **intersectsWithRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L218)
+
Checks if object intersects with the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
+
+##### br
+
+[`Point`](/api/classes/point/)
#### Returns
@@ -4780,21 +4324,24 @@ Checks if object intersects with the scene rect formed by tl and br
`StyledText.intersectsWithRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218)
-
***
### isCacheDirty()
> **isCacheDirty**(`skipCanvas`): `boolean`
-Check if cache is dirty
+Defined in: [src/shapes/Object/Object.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L910)
+
+Check if cache is dirty and if is dirty clear the context.
+This check has a big side effect, it changes the underlying cache canvas if necessary.
+Do not call this method on your own to check if the cache is dirty, because if it is,
+it is also going to wipe the cache. This is badly designed and needs to be fixed.
#### Parameters
-• **skipCanvas**: `boolean` = `false`
+##### skipCanvas
+
+`boolean` = `false`
skip canvas checks because this object is painted
on parent canvas.
@@ -4807,21 +4354,21 @@ on parent canvas.
`StyledText.isCacheDirty`
-#### Defined in
-
-[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956)
-
***
### isContainedWithinObject()
> **isContainedWithinObject**(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L251)
+
Checks if object is fully contained within area of another object
#### Parameters
-• **other**: `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### other
+
+`ObjectGeometry`
Object to test
@@ -4835,23 +4382,25 @@ true if object is fully contained within area of another object
`StyledText.isContainedWithinObject`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251)
-
***
### isContainedWithinRect()
> **isContainedWithinRect**(`tl`, `br`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L259)
+
Checks if object is fully contained within the scene rect formed by tl and br
#### Parameters
-• **tl**: [`Point`](/api/classes/point/)
+##### tl
+
+[`Point`](/api/classes/point/)
+
+##### br
-• **br**: [`Point`](/api/classes/point/)
+[`Point`](/api/classes/point/)
#### Returns
@@ -4861,21 +4410,21 @@ Checks if object is fully contained within the scene rect formed by tl and br
`StyledText.isContainedWithinRect`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259)
-
***
### isControlVisible()
> **isControlVisible**(`controlKey`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L584)
+
Returns true if the specified control is visible, false otherwise.
#### Parameters
-• **controlKey**: `string`
+##### controlKey
+
+`string`
The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr',
but since the control api allow for any control name, can be any string.
@@ -4890,22 +4439,22 @@ true if the specified control is visible, false otherwise
`StyledText.isControlVisible`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584)
-
***
### isDescendantOf()
> **isDescendantOf**(`target`): `boolean`
+Defined in: [src/shapes/Object/Object.ts:1610](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1610)
+
Checks if object is descendant of target
-Should be used instead of [Group.contains](../../../../api/classes/group/#contains) or [StaticCanvas.contains](../../../../api/classes/staticcanvas/#contains) for performance reasons
+Should be used instead of [Group.contains](/api/classes/group/#contains) or [StaticCanvas.contains](/api/classes/staticcanvas/#contains) for performance reasons
#### Parameters
-• **target**: `TAncestor`
+##### target
+
+`TAncestor`
#### Returns
@@ -4915,21 +4464,21 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai
`StyledText.isDescendantOf`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644)
-
***
### isEmptyStyles()
-> **isEmptyStyles**(`lineIndex`?): `boolean`
+> **isEmptyStyles**(`lineIndex?`): `boolean`
+
+Defined in: [src/shapes/Text/StyledText.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L41)
Returns true if object has no styling or no styling in a line
#### Parameters
-• **lineIndex?**: `number`
+##### lineIndex?
+
+`number`
, lineIndex is on wrapped lines.
@@ -4941,44 +4490,46 @@ Returns true if object has no styling or no styling in a line
`StyledText.isEmptyStyles`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L41)
-
***
### isEndOfWrapping()
> **isEndOfWrapping**(`lineIndex`): `boolean`
+Defined in: [src/shapes/Text/Text.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L529)
+
Detect if the text line is ended with an hard break
text and itext do not have wrapping, return false
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
#### Returns
`boolean`
-#### Defined in
-
-[src/shapes/Text/Text.ts:535](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L535)
-
***
### isInFrontOf()
> **isInFrontOf**\<`T`\>(`other`): `undefined` \| `boolean`
+Defined in: [src/shapes/Object/Object.ts:1716](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1716)
+
#### Type Parameters
-• **T** *extends* [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+##### T
+
+`T` *extends* `FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
object to compare against
@@ -4992,16 +4543,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos
`StyledText.isInFrontOf`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750)
-
***
### isNotVisible()
> **isNotVisible**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:637](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L637)
+
+return if the object would be visible in rendering
+
#### Returns
`boolean`
@@ -5010,16 +4561,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos
`StyledText.isNotVisible`
-#### Defined in
-
-[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686)
-
***
### isOnScreen()
> **isOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L291)
+
Checks if object is contained within the canvas with current viewportTransform
the check is done stopping at first point that appears on screen
@@ -5033,23 +4582,25 @@ true if object is fully or partially contained within canvas
`StyledText.isOnScreen`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291)
-
***
### isOverlapping()
> **isOverlapping**\<`T`\>(`other`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269)
+
#### Type Parameters
-• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### T
+
+`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **other**: `T`
+##### other
+
+`T`
#### Returns
@@ -5059,16 +4610,14 @@ true if object is fully or partially contained within canvas
`StyledText.isOverlapping`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269)
-
***
### isPartiallyOnScreen()
> **isPartiallyOnScreen**(): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321)
+
Checks if object is partially contained within the canvas with current viewportTransform
#### Returns
@@ -5081,45 +4630,57 @@ true if object is partially contained within canvas
`StyledText.isPartiallyOnScreen`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321)
-
***
### isType()
> **isType**(...`types`): `boolean`
-Returns true if any of the specified types is identical to the type of an instance
+Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415)
+
+Checks if the instance is of any of the specified types.
+We use this to filter a list of objects for the `getObjects` function.
+
+For detecting an instance type `instanceOf` is a better check,
+but to avoid to make specific classes a dependency of generic code
+internally we use this.
+
+This compares both the static class `type` and the instance's own `type` property
+against the provided list of types.
#### Parameters
-• ...**types**: `string`[]
+##### types
+
+...`string`[]
+
+A list of type strings to check against.
#### Returns
`boolean`
+`true` if the object's type or class type matches any in the list, otherwise `false`.
+
#### Inherited from
`StyledText.isType`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449)
-
***
### measureLine()
> **measureLine**(`lineIndex`): `object`
+Defined in: [src/shapes/Text/Text.ts:868](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L868)
+
measure a text line measuring all characters.
#### Parameters
-• **lineIndex**: `number`
+##### lineIndex
+
+`number`
line number
@@ -5135,25 +4696,27 @@ line number
> **width**: `number`
-#### Defined in
-
-[src/shapes/Text/Text.ts:874](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L874)
-
***
### missingNewlineOffset()
-> **missingNewlineOffset**(`lineIndex`, `skipWrapping`?): `0` \| `1`
+> **missingNewlineOffset**(`lineIndex`, `skipWrapping?`): `0` \| `1`
+
+Defined in: [src/shapes/Text/Text.ts:539](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L539)
Detect if a line has a linebreak and so we need to account for it when moving
and counting style.
It return always 1 for text and Itext. Textbox has its own implementation
-#### Parameters
+#### Parameters
+
+##### lineIndex
+
+`number`
-• **lineIndex**: `number`
+##### skipWrapping?
-• **skipWrapping?**: `boolean`
+`boolean`
#### Returns
@@ -5161,17 +4724,15 @@ It return always 1 for text and Itext. Textbox has its own implementation
Number
-#### Defined in
-
-[src/shapes/Text/Text.ts:545](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L545)
-
***
### needsItsOwnCache()
> **needsItsOwnCache**(): `boolean`
-When set to `true`, force the object to have its own cache, even if it is inside a group
+Defined in: [src/shapes/Object/Object.ts:750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L750)
+
+When returns `true`, force the object to have its own cache, even if it is inside a group
it may be needed when your object behave in a particular way on the cache and always needs
its own isolated canvas to render correctly.
Created to be overridden
@@ -5187,18 +4748,16 @@ Boolean
`StyledText.needsItsOwnCache`
-#### Defined in
-
-[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799)
-
***
### off()
-#### off(eventName)
+#### Call Signature
> **off**\<`K`\>(`eventName`): `void`
+Defined in: [src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L122)
+
Unsubscribe all event listeners for eventname.
Do not use this pattern. You could kill internal fabricJS events.
We know we should have protected events for internal flows, but we don't have yet
@@ -5209,11 +4768,15 @@ This API is no longer supported and may be removed in a future release.
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
@@ -5225,27 +4788,31 @@ event name (eg. 'after:render')
`StyledText.off`
-##### Defined in
-
-[src/Observable.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L122)
-
-#### off(eventName, handler)
+#### Call Signature
> **off**\<`K`\>(`eventName`, `handler`): `void`
+Defined in: [src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L128)
+
unsubscribe an event listener
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`any`\>
+###### handler
+
+`TEventCallback`
event listener to unsubscribe
@@ -5257,19 +4824,19 @@ event listener to unsubscribe
`StyledText.off`
-##### Defined in
-
-[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128)
-
-#### off(handlers)
+#### Call Signature
> **off**(`handlers`): `void`
+Defined in: [src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L133)
+
unsubscribe event listeners
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
@@ -5281,14 +4848,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han
`StyledText.off`
-##### Defined in
-
-[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133)
-
-#### off()
+#### Call Signature
> **off**(): `void`
+Defined in: [src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L137)
+
unsubscribe all event listeners
##### Returns
@@ -5299,33 +4864,39 @@ unsubscribe all event listeners
`StyledText.off`
-##### Defined in
-
-[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137)
-
***
### on()
-#### on(eventName, handler)
+#### Call Signature
> **on**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
+Defined in: [src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L23)
+
Observes specified event
##### Type Parameters
-• **K** *extends* `string` \| `number` \| `symbol`
+###### K
+
+`K` *extends* `string` \| `number` \| `symbol`
-• **E**
+###### E
+
+`E`
##### Parameters
-• **eventName**: `K`
+###### eventName
+
+`K`
Event name (eg. 'after:render')
-• **handler**: `TEventCallback`\<`E`\>
+###### handler
+
+`TEventCallback`\<`E`\>
Function that receives a notification when an event of the specified type occurs
@@ -5343,106 +4914,140 @@ on
`StyledText.on`
-##### Defined in
+#### Call Signature
-[src/Observable.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L23)
+> **on**(`handlers`): `VoidFunction`
-#### on(handlers)
+Defined in: [src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L27)
-> **on**(`handlers`): `VoidFunction`
+Observes specified event
##### Parameters
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
##### Returns
`VoidFunction`
+disposer
+
+##### Alias
+
+on
+
##### Inherited from
`StyledText.on`
-##### Defined in
+***
-[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27)
+### once()
-***
+#### Call Signature
-### onDeselect()
+> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-> **onDeselect**(`_options`?): `boolean`
+Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62)
-This callback function is called every time _discardActiveObject or _setActiveObject
-try to to deselect this object. If the function returns true, the process is cancelled
+Observes specified event **once**
-#### Parameters
+##### Type Parameters
-• **\_options?**
+###### K
-options sent from the upper functions
+`K` *extends* `string` \| `number` \| `symbol`
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### E
-• **\_options.object?**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`E`
-#### Returns
+##### Parameters
-`boolean`
+###### eventName
-#### Inherited from
+`K`
-`StyledText.onDeselect`
+Event name (eg. 'after:render')
-#### Defined in
+###### handler
-[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658)
+`TEventCallback`\<`E`\>
-***
+Function that receives a notification when an event of the specified type occurs
-### onDragStart()
+##### Returns
-> **onDragStart**(`_e`): `boolean`
+`VoidFunction`
-Override to customize Drag behavior\
-Fired once a drag session has started
+disposer
-#### Parameters
+##### Alias
-• **\_e**: `DragEvent`
+once
-#### Returns
+##### Inherited from
-`boolean`
+`StyledText.once`
-true to handle the drag event
+#### Call Signature
-#### Inherited from
+> **once**(`handlers`): `VoidFunction`
-`StyledText.onDragStart`
+Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66)
+
+Observes specified event **once**
+
+##### Parameters
+
+###### handlers
+
+`EventRegistryObject`\<`EventSpec`\>
+
+key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
+
+##### Returns
+
+`VoidFunction`
+
+disposer
+
+##### Alias
+
+once
-#### Defined in
+##### Inherited from
-[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691)
+`StyledText.once`
***
-### onSelect()
+### onDeselect()
-> **onSelect**(`_options`?): `boolean`
+> **onDeselect**(`_options?`): `boolean`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658)
This callback function is called every time _discardActiveObject or _setActiveObject
-try to to select this object. If the function returns true, the process is cancelled
+try to to deselect this object. If the function returns true, the process is cancelled
#### Parameters
-• **\_options?**
+##### \_options?
options sent from the upper functions
-• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+###### e?
-event if the process is generated by an event
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
+
+###### object?
+
+[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -5450,75 +5055,65 @@ event if the process is generated by an event
#### Inherited from
-`StyledText.onSelect`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672)
+`StyledText.onDeselect`
***
-### once()
-
-#### once(eventName, handler)
-
-> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction`
-
-Observes specified event **once**
-
-##### Type Parameters
+### onDragStart()
-• **K** *extends* `string` \| `number` \| `symbol`
+> **onDragStart**(`_e`): `boolean`
-• **E**
+Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691)
-##### Parameters
+Override to customize Drag behavior\
+Fired once a drag session has started
-• **eventName**: `K`
+#### Parameters
-Event name (eg. 'after:render')
+##### \_e
-• **handler**: `TEventCallback`\<`E`\>
+`DragEvent`
-Function that receives a notification when an event of the specified type occurs
+#### Returns
-##### Returns
+`boolean`
-`VoidFunction`
+true to handle the drag event
-disposer
+#### Inherited from
-##### Alias
+`StyledText.onDragStart`
-once
+***
-##### Inherited from
+### onSelect()
-`StyledText.once`
+> **onSelect**(`_options?`): `boolean`
-##### Defined in
+Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672)
-[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62)
+This callback function is called every time _discardActiveObject or _setActiveObject
+try to to select this object. If the function returns true, the process is cancelled
-#### once(handlers)
+#### Parameters
-> **once**(`handlers`): `VoidFunction`
+##### \_options?
-##### Parameters
+options sent from the upper functions
-• **handlers**: `EventRegistryObject`\<`EventSpec`\>
+###### e?
-##### Returns
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
-`VoidFunction`
+event if the process is generated by an event
-##### Inherited from
+#### Returns
-`StyledText.once`
+`boolean`
-##### Defined in
+#### Inherited from
-[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66)
+`StyledText.onSelect`
***
@@ -5526,13 +5121,17 @@ once
> **removeStyle**(`property`): `void`
+Defined in: [src/shapes/Text/StyledText.ts:162](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L162)
+
Remove a style property or properties from all individual character styles
in a text object. Deletes the character style object if it contains no other style
props. Deletes a line style object if it contains no other character styles.
#### Parameters
-• **property**: `StylePropertiesType`
+##### property
+
+`StylePropertiesType`
#### Returns
@@ -5542,21 +5141,21 @@ props. Deletes a line style object if it contains no other character styles.
`StyledText.removeStyle`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L165)
-
***
### render()
> **render**(`ctx`): `void`
+Defined in: [src/shapes/Text/Text.ts:1706](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1706)
+
Renders text instance on a specified context
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -5568,21 +5167,23 @@ Context to render on
`StyledText.render`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1694](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1694)
-
***
### renderCache()
-> **renderCache**(`this`, `options`?): `void`
+> **renderCache**(`this`, `options?`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L683)
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **options?**: `any`
+`TCachedFabricObject`
+
+##### options?
+
+`any`
#### Returns
@@ -5592,23 +5193,23 @@ Context to render on
`StyledText.renderCache`
-#### Defined in
-
-[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732)
-
***
### renderDragSourceEffect()
> **renderDragSourceEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L712)
+
Override to customize drag and drop behavior
render a specific effect when an object is the source of a drag event
example: render the selection status for the part of text that is being dragged from a text object
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -5618,16 +5219,14 @@ example: render the selection status for the part of text that is being dragged
`StyledText.renderDragSourceEffect`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712)
-
***
### renderDropTargetEffect()
> **renderDropTargetEffect**(`_e`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L724)
+
Override to customize drag and drop behavior
render a specific effect when an object is the target of a drag event
used to show that the underly object can receive a drop, or to show how the
@@ -5635,7 +5234,9 @@ object will change when dropping. example: show the cursor where the text is abo
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -5645,21 +5246,21 @@ object will change when dropping. example: show the cursor where the text is abo
`StyledText.renderDropTargetEffect`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724)
-
***
### rotate()
> **rotate**(`angle`): `void`
+Defined in: [src/shapes/Object/Object.ts:1443](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1443)
+
Sets "angle" of an instance with centered rotation
#### Parameters
-• **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+##### angle
+
+[`TDegree`](/api/type-aliases/tdegree/)
Angle value (in degrees)
@@ -5671,21 +5272,21 @@ Angle value (in degrees)
`StyledText.rotate`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477)
-
***
### scale()
> **scale**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L370)
+
Scales an object (equally by x and y)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
Scale factor
@@ -5697,21 +5298,21 @@ Scale factor
`StyledText.scale`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370)
-
***
### scaleToHeight()
> **scaleToHeight**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L393)
+
Scales an object to a given height, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New height value
@@ -5723,21 +5324,21 @@ New height value
`StyledText.scaleToHeight`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393)
-
***
### scaleToWidth()
> **scaleToWidth**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L381)
+
Scales an object to a given width, with respect to bounding box (scaling by x/y equally)
#### Parameters
-• **value**: `number`
+##### value
+
+`number`
New width value
@@ -5749,102 +5350,102 @@ New width value
`StyledText.scaleToWidth`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381)
-
***
### set()
-> **set**(`key`, `value`?): [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+> **set**(`key`, `value?`): `FabricText`\<`Props`, `SProps`, `EventSpec`\>
+
+Defined in: [src/shapes/Text/Text.ts:1775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1775)
Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`.
#### Parameters
-• **key**: `any`
+##### key
+
+`any`
Property name or object (if object, iterate over the object properties)
-• **value?**: `any`
+##### value?
+
+`any`
Property value (if function, the value is passed into it and its return value is used as a new one)
#### Returns
-[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+`FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Overrides
`StyledText.set`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1763](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1763)
-
***
-### setControlVisible()
+### setControlsVisibility()
-> **setControlVisible**(`controlKey`, `visible`): `void`
+> **setControlsVisibility**(`options?`): `void`
-Sets the visibility of the specified control.
-please do not use.
+Defined in: [src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L611)
-#### Parameters
+Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
-• **controlKey**: `string`
+#### Parameters
-The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
-but since the control api allow for any control name, can be any string.
+##### options?
-• **visible**: `boolean`
+`Record`\<`string`, `boolean`\> = `{}`
-true to set the specified control visible, false otherwise
+with an optional key per control
+example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
#### Returns
`void`
-#### Todo
+#### Inherited from
-discuss this overlap of priority here with the team. Andrea Bogazzi for details
+`StyledText.setControlsVisibility`
-#### Inherited from
+***
-`StyledText.setControlVisible`
+### setControlVisible()
-#### Defined in
+> **setControlVisible**(`controlKey`, `visible`): `void`
-[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L599)
+Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599)
-***
+Sets the visibility of the specified control.
+please do not use.
-### setControlsVisibility()
+#### Parameters
-> **setControlsVisibility**(`options`?): `void`
+##### controlKey
-Sets the visibility state of object controls, this is just a bulk option for setControlVisible;
+`string`
-#### Parameters
+The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
+but since the control api allow for any control name, can be any string.
-• **options?**: `Record`\<`string`, `boolean`\> = `{}`
+##### visible
-with an optional key per control
-example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it
+`boolean`
+
+true to set the specified control visible, false otherwise
#### Returns
`void`
-#### Inherited from
+#### Todo
-`StyledText.setControlsVisibility`
+discuss this overlap of priority here with the team. Andrea Bogazzi for details
-#### Defined in
+#### Inherited from
-[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611)
+`StyledText.setControlVisible`
***
@@ -5852,8 +5453,10 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to
> **setCoords**(): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L343)
+
set controls' coordinates as well
-See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [http://fabricjs.com/fabric-gotchas](http://fabricjs.com/fabric-gotchas)
+See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords) and [https://fabric5.fabricjs.com/fabric-gotchas](https://fabric5.fabricjs.com/fabric-gotchas)
#### Returns
@@ -5863,16 +5466,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https://
`StyledText.setCoords`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343)
-
***
### setOnGroup()
> **setOnGroup**(): `void`
+Defined in: [src/shapes/Object/Object.ts:1475](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1475)
+
This callback function is called by the parent group of an object every
time a non-delegated property changes on the group. It is passed the key
and value as parameters. Not adding in this function's signature to avoid
@@ -5886,16 +5487,14 @@ Travis build error about unused variables.
`StyledText.setOnGroup`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509)
-
***
### setPathInfo()
> **setPathInfo**(): `void`
+Defined in: [src/shapes/Text/Text.ts:439](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L439)
+
If text has a path, it will add the extra information needed
for path and text calculations
@@ -5903,29 +5502,33 @@ for path and text calculations
`void`
-#### Defined in
-
-[src/shapes/Text/Text.ts:445](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L445)
-
***
### setPositionByOrigin()
> **setPositionByOrigin**(`pos`, `originX`, `originY`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:778](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L778)
+
Sets the position of the object taking into consideration the object's origin
#### Parameters
-• **pos**: [`Point`](/api/classes/point/)
+##### pos
+
+[`Point`](/api/classes/point/)
The new position of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -5937,22 +5540,22 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.setPositionByOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777)
-
***
### setRelativeX()
> **setRelativeX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L123)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in parent's coordinate plane\
-if parent is canvas then this method is identical to [setX](../../../../api/classes/fabrictext/#setx)
+`number`
+
+x position according to object's originX property in parent's coordinate plane\
+if parent is canvas then this method is identical to [setX](/api/classes/fabrictext/#setx)
#### Returns
@@ -5962,29 +5565,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas
`StyledText.setRelativeX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123)
-
***
### setRelativeXY()
-> **setRelativeXY**(`point`, `originX`?, `originY`?): `void`
+> **setRelativeXY**(`point`, `originX?`, `originY?`): `void`
-As [setXY](../../../../api/classes/fabrictext/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L186)
+
+As [setXY](/api/classes/fabrictext/#setxy), but in current parent's coordinate plane (the current group if any or the canvas)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position according to object's originX originY properties in parent's coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/) = `...`
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/) = `...`
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/) = `...`
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/) = `...`
Vertical origin: 'top', 'center' or 'bottom'
@@ -5996,22 +5603,22 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.setRelativeXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186)
-
***
### setRelativeY()
> **setRelativeY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L139)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in parent's coordinate plane\
-if parent is canvas then this property is identical to [setY](../../../../api/classes/fabrictext/#sety)
+`number`
+
+y position according to object's originY property in parent's coordinate plane\
+if parent is canvas then this property is identical to [setY](/api/classes/fabrictext/#sety)
#### Returns
@@ -6021,29 +5628,33 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl
`StyledText.setRelativeY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139)
-
***
### setSelectionStyles()
-> **setSelectionStyles**(`styles`, `startIndex`, `endIndex`?): `void`
+> **setSelectionStyles**(`styles`, `startIndex`, `endIndex?`): `void`
+
+Defined in: [src/shapes/Text/StyledText.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L242)
Sets style of a current selection, if no selection exist, do not set anything.
#### Parameters
-• **styles**: `object`
+##### styles
+
+`object`
Styles object
-• **startIndex**: `number`
+##### startIndex
+
+`number`
Start index to get styles at
-• **endIndex?**: `number`
+##### endIndex?
+
+`number`
End index to get styles at, if not specified startIndex + 1
@@ -6055,25 +5666,27 @@ End index to get styles at, if not specified startIndex + 1
`StyledText.setSelectionStyles`
-#### Defined in
-
-[src/shapes/Text/StyledText.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L245)
-
***
### setSubscript()
> **setSubscript**(`start`, `end`): `void`
+Defined in: [src/shapes/Text/Text.ts:1414](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1414)
+
Turns the character into an 'inferior figure' (i.e. 'subscript')
#### Parameters
-• **start**: `number`
+##### start
+
+`number`
selection start
-• **end**: `number`
+##### end
+
+`number`
selection end
@@ -6081,25 +5694,27 @@ selection end
`void`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1420](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1420)
-
***
### setSuperscript()
> **setSuperscript**(`start`, `end`): `void`
+Defined in: [src/shapes/Text/Text.ts:1405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1405)
+
Turns the character into a 'superior figure' (i.e. 'superscript')
#### Parameters
-• **start**: `number`
+##### start
+
+`number`
selection start
-• **end**: `number`
+##### end
+
+`number`
selection end
@@ -6107,21 +5722,21 @@ selection end
`void`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1411)
-
***
### setX()
> **setX**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L93)
+
#### Parameters
-• **value**: `number`
+##### value
-x position according to object's [originX](../../../../api/classes/fabricobject/#originx) property in canvas coordinate plane
+`number`
+
+x position according to object's originX property in canvas coordinate plane
#### Returns
@@ -6131,15 +5746,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/
`StyledText.setX`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93)
-
***
### setXY()
-> **setXY**(`point`, `originX`?, `originY`?): `void`
+> **setXY**(`point`, `originX?`, `originY?`): `void`
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L163)
Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate.
You can specify originX and originY values,
@@ -6147,15 +5760,21 @@ that otherwise are the object's current values.
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
position in scene coordinate plane
-• **originX?**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX?
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY?**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY?
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6173,21 +5792,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom').
`StyledText.setXY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163)
-
***
### setY()
> **setY**(`value`): `void`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L107)
+
#### Parameters
-• **value**: `number`
+##### value
-y position according to object's [originY](../../../../api/classes/fabricobject/#originy) property in canvas coordinate plane
+`number`
+
+y position according to object's originY property in canvas coordinate plane
#### Returns
@@ -6197,20 +5816,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/
`StyledText.setY`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107)
-
***
### shouldCache()
> **shouldCache**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:775](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L775)
+
Decide if the object should cache or not. Create its own cache level
objectCaching is a global flag, wins over everything
needsItsOwnCache should be used when the object drawing method requires
-a cache step. None of the fabric classes requires it.
+a cache step.
Generally you do not cache objects in groups because the group outside is cached.
Read as: cache if is needed, or if the feature is enabled but we are not already caching.
@@ -6222,22 +5839,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already
`StyledText.shouldCache`
-#### Defined in
-
-[src/shapes/Object/Object.ts:823](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L823)
-
***
### shouldStartDragging()
> **shouldStartDragging**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L682)
+
Override to customize Drag behavior
-Fired from Canvas#_onMouseMove
+Fired from Canvas#\_onMouseMove
#### Parameters
-• **\_e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/)
+##### \_e
+
+[`TPointerEvent`](/api/type-aliases/tpointerevent/)
#### Returns
@@ -6249,25 +5866,27 @@ true in order for the window to start a drag session
`StyledText.shouldStartDragging`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682)
-
***
### strokeBorders()
> **strokeBorders**(`ctx`, `size`): `void`
+Defined in: [src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L399)
+
override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
ctx is rotated and translated so that (0,0) is at object's center
-• **size**: [`Point`](/api/classes/point/)
+##### size
+
+[`Point`](/api/classes/point/)
the control box size used
@@ -6279,26 +5898,28 @@ the control box size used
`StyledText.strokeBorders`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:399](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L399)
-
***
### styleHas()
-> **styleHas**(`property`, `lineIndex`?): `boolean`
+> **styleHas**(`property`, `lineIndex?`): `boolean`
+
+Defined in: [src/shapes/Text/StyledText.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L70)
Returns true if object has a style property or has it ina specified line
This function is used to detect if a text will use a particular property or not.
#### Parameters
-• **property**: `StylePropertiesType`
+##### property
+
+`StylePropertiesType`
to check for
-• **lineIndex?**: `number`
+##### lineIndex?
+
+`number`
to check the style on
@@ -6310,9 +5931,27 @@ to check the style on
`StyledText.styleHas`
-#### Defined in
+***
+
+### toBlob()
+
+> **toBlob**(`options`): `Promise`\<`null` \| `Blob`\>
+
+Defined in: [src/shapes/Object/Object.ts:1393](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1393)
+
+#### Parameters
+
+##### options
-[src/shapes/Text/StyledText.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L70)
+`toDataURLOptions` = `{}`
+
+#### Returns
+
+`Promise`\<`null` \| `Blob`\>
+
+#### Inherited from
+
+`StyledText.toBlob`
***
@@ -6320,11 +5959,15 @@ to check the style on
> **toCanvasElement**(`options`): `HTMLCanvasElement`
+Defined in: [src/shapes/Object/Object.ts:1290](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1290)
+
Converts an object into a HTMLCanvas element
#### Parameters
-• **options**: `ObjectToCanvasElementOptions` = `{}`
+##### options
+
+`ObjectToCanvasElementOptions` = `{}`
Options object
@@ -6338,23 +5981,25 @@ Returns DOM element with the FabricObject
`StyledText.toCanvasElement`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340)
-
***
### toClipPathSVG()
-> **toClipPathSVG**(`this`, `reviver`?): `string`
+> **toClipPathSVG**(`this`, `reviver?`): `string`
+
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L144)
Returns svg clipPath representation of an instance
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -6368,9 +6013,33 @@ svg representation of an instance
`StyledText.toClipPathSVG`
-#### Defined in
+***
+
+### toDatalessObject()
+
+> **toDatalessObject**(`propertiesToInclude?`): `any`
+
+Defined in: [src/shapes/Object/Object.ts:1850](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1850)
+
+Returns (dataless) object representation of an instance
+
+#### Parameters
+
+##### propertiesToInclude?
+
+`any`[]
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143)
+Any properties that you might want to additionally include in the output
+
+#### Returns
+
+`any`
+
+Object representation of an instance
+
+#### Inherited from
+
+`StyledText.toDatalessObject`
***
@@ -6378,11 +6047,15 @@ svg representation of an instance
> **toDataURL**(`options`): `string`
+Defined in: [src/shapes/Object/Object.ts:1386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1386)
+
Converts an object into a data-url-like string
#### Parameters
-• **options**: `toDataURLOptions` = `{}`
+##### options
+
+`toDataURLOptions` = `{}`
Options object
@@ -6396,37 +6069,31 @@ Returns a data: URL containing a representation of the object in the format spec
`StyledText.toDataURL`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436)
-
***
-### toDatalessObject()
+### toggle()
-> **toDatalessObject**(`propertiesToInclude`?): `any`
+> **toggle**(`property`): `FabricText`\<`Props`, `SProps`, `EventSpec`\>
-Returns (dataless) object representation of an instance
+Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46)
+
+Toggles specified property from `true` to `false` or from `false` to `true`
#### Parameters
-• **propertiesToInclude?**: `any`[]
+##### property
-Any properties that you might want to additionally include in the output
+`string`
-#### Returns
+Property to toggle
-`any`
+#### Returns
-Object representation of an instance
+`FabricText`\<`Props`, `SProps`, `EventSpec`\>
#### Inherited from
-`StyledText.toDatalessObject`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884)
+`StyledText.toggle`
***
@@ -6434,6 +6101,8 @@ Object representation of an instance
> **toJSON**(): `any`
+Defined in: [src/shapes/Object/Object.ts:1434](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1434)
+
Returns a JSON representation of an instance
#### Returns
@@ -6446,27 +6115,31 @@ JSON
`StyledText.toJSON`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468)
-
***
### toObject()
-> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps`
+> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps`
+
+Defined in: [src/shapes/Text/Text.ts:1764](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1764)
Returns object representation of an instance
#### Type Parameters
-• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
+##### T
+
+`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`FabricText`\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\>
-• **K** *extends* `string` \| `number` \| `symbol` = `never`
+##### K
+
+`K` *extends* `string` \| `number` \| `symbol` = `never`
#### Parameters
-• **propertiesToInclude?**: `K`[] = `[]`
+##### propertiesToInclude?
+
+`K`[] = `[]`
Any properties that you might want to additionally include in the output
@@ -6480,46 +6153,14 @@ Object representation of an instance
`StyledText.toObject`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1752](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1752)
-
-***
-
-### toSVG()
-
-> **toSVG**(`this`, `reviver`?): `string`
-
-Returns svg representation of an instance
-
-#### Parameters
-
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-
-Method for further parsing of svg representation.
-
-#### Returns
-
-`string`
-
-svg representation of an instance
-
-#### Inherited from
-
-`StyledText.toSVG`
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129)
-
***
### toString()
> **toString**(): `string`
+Defined in: [src/shapes/Text/Text.ts:575](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L575)
+
Returns string representation of an instance
#### Returns
@@ -6532,35 +6173,37 @@ String representation of text object
`StyledText.toString`
-#### Defined in
-
-[src/shapes/Text/Text.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L581)
-
***
-### toggle()
+### toSVG()
-> **toggle**(`property`): [`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+> **toSVG**(`this`, `reviver?`): `string`
-Toggles specified property from `true` to `false` or from `false` to `true`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L130)
+
+Returns svg representation of an instance
#### Parameters
-• **property**: `string`
+##### this
-Property to toggle
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-#### Returns
+##### reviver?
-[`FabricText`](/api/classes/fabrictext/)\<`Props`, `SProps`, `EventSpec`\>
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
-#### Inherited from
+Method for further parsing of svg representation.
-`StyledText.toggle`
+#### Returns
+
+`string`
+
+svg representation of an instance
-#### Defined in
+#### Inherited from
-[src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L46)
+`StyledText.toSVG`
***
@@ -6568,11 +6211,15 @@ Property to toggle
> **transform**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:517](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L517)
+
Transforms context when rendering an object
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context
@@ -6584,19 +6231,19 @@ Context
`StyledText.transform`
-#### Defined in
-
-[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564)
-
***
### transformMatrixKey()
> **transformMatrixKey**(`skipGroup`): `number`[]
+Defined in: [src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L453)
+
#### Parameters
-• **skipGroup**: `boolean` = `false`
+##### skipGroup
+
+`boolean` = `false`
#### Returns
@@ -6606,29 +6253,33 @@ Context
`StyledText.transformMatrixKey`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453)
-
***
### translateToCenterPoint()
> **translateToCenterPoint**(`point`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:683](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L683)
+
Translates the coordinates from origin to center coordinates (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6640,37 +6291,45 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.translateToCenterPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682)
-
***
### translateToGivenOrigin()
> **translateToGivenOrigin**(`point`, `fromOriginX`, `fromOriginY`, `toOriginX`, `toOriginY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:655](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L655)
+
Translates the coordinates from a set of origin to another (based on the object's dimensions)
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
The point which corresponds to the originX and originY params
-• **fromOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### fromOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **fromOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### fromOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
-• **toOriginX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### toOriginX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **toOriginY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### toOriginY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6682,29 +6341,33 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.translateToGivenOrigin`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654)
-
***
### translateToOriginPoint()
> **translateToOriginPoint**(`center`, `originX`, `originY`): [`Point`](/api/classes/point/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:711](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L711)
+
Translates the coordinates from center to origin coordinates (based on the object's dimensions)
#### Parameters
-• **center**: [`Point`](/api/classes/point/)
+##### center
+
+[`Point`](/api/classes/point/)
The point which corresponds to center of the object
-• **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+##### originX
+
+[`TOriginX`](/api/type-aliases/toriginx/)
Horizontal origin: 'left', 'center' or 'right'
-• **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+##### originY
+
+[`TOriginY`](/api/type-aliases/toriginy/)
Vertical origin: 'top', 'center' or 'bottom'
@@ -6716,16 +6379,14 @@ Vertical origin: 'top', 'center' or 'bottom'
`StyledText.translateToOriginPoint`
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710)
-
***
### ~~willDrawShadow()~~
> **willDrawShadow**(): `boolean`
+Defined in: [src/shapes/Object/Object.ts:788](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L788)
+
Check if this object will cast a shadow with an offset.
used by Group.shouldCache to know if child has a shadow recursively
@@ -6741,25 +6402,29 @@ This API is no longer supported and may be removed in a future release.
`StyledText.willDrawShadow`
-#### Defined in
-
-[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836)
-
***
### \_fromObject()
> `static` **\_fromObject**\<`S`\>(`__namedParameters`, `__namedParameters`): `Promise`\<`S`\>
+Defined in: [src/shapes/Object/Object.ts:1903](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1903)
+
#### Type Parameters
-• **S** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### S
+
+`S` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **\_\_namedParameters**: `Record`\<`string`, `unknown`\>
+##### \_\_namedParameters
+
+`Record`\<`string`, `unknown`\>
-• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
+##### \_\_namedParameters
+
+[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}`
#### Returns
@@ -6769,16 +6434,14 @@ This API is no longer supported and may be removed in a future release.
`StyledText._fromObject`
-#### Defined in
-
-[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937)
-
***
### createControls()
> `static` **createControls**(): `object`
+Defined in: [src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L167)
+
Creates the default control object.
If you prefer to have on instance of controls shared among all objects
make this function return an empty object and add controls to the ownDefaults
@@ -6795,43 +6458,37 @@ make this function return an empty object and add controls to the ownDefaults
`StyledText.createControls`
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167)
-
***
### fromElement()
-> `static` **fromElement**(`element`, `options`?, `cssRules`?): `Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`object`, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`FabricText`\<\{ `fontSize`: `number`; `left`: `number`; `linethrough`: `boolean`; `overline`: `boolean`; `signal?`: `AbortSignal`; `strokeWidth`: `number`; `top`: `number`; `underline`: `boolean`; \}, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+
+Defined in: [src/shapes/Text/Text.ts:1855](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1855)
Returns FabricText instance from an SVG element (not yet implemented )
#### Parameters
-• **element**: `HTMLElement`
+##### element
Element to parse
-• **options?**: [`Abortable`](/api/type-aliases/abortable/)
-
-Options object
-
-• **cssRules?**: `CSSRules`
+`HTMLElement` | `SVGElement`
-#### Returns
+##### options?
-`Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`object`, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+[`Abortable`](/api/type-aliases/abortable/)
-#### Static
+Options object
-#### Member Of
+##### cssRules?
-Text
+`CSSRules`
-#### Defined in
+#### Returns
-[src/shapes/Text/Text.ts:1847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1847)
+`Promise`\<`FabricText`\<\{ `fontSize`: `number`; `left`: `number`; `linethrough`: `boolean`; `overline`: `boolean`; `signal?`: `AbortSignal`; `strokeWidth`: `number`; `top`: `number`; `underline`: `boolean`; \}, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
***
@@ -6839,17 +6496,25 @@ Text
> `static` **fromObject**\<`T`, `S`\>(`object`): `Promise`\<`S`\>
+Defined in: [src/shapes/Text/Text.ts:1930](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1930)
+
Returns FabricText instance from an object representation
#### Type Parameters
-• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedTextProps`](/api/interfaces/serializedtextprops/)\>
+##### T
-• **S** *extends* [`FabricText`](/api/classes/fabrictext/)\<`Partial`\<[`TextProps`](/api/interfaces/textprops/)\>, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedTextProps`](/api/interfaces/serializedtextprops/)\>
+
+##### S
+
+`S` *extends* `FabricText`\<`Partial`\<[`TextProps`](/api/interfaces/textprops/)\>, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Parameters
-• **object**: `T`
+##### object
+
+`T`
plain js Object to create an instance from
@@ -6861,16 +6526,14 @@ plain js Object to create an instance from
`StyledText.fromObject`
-#### Defined in
-
-[src/shapes/Text/Text.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1924)
-
***
### getDefaults()
> `static` **getDefaults**(): `Record`\<`string`, `any`\>
+Defined in: [src/shapes/Text/Text.ts:415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L415)
+
#### Returns
`Record`\<`string`, `any`\>
@@ -6878,7 +6541,3 @@ plain js Object to create an instance from
#### Overrides
`StyledText.getDefaults`
-
-#### Defined in
-
-[src/shapes/Text/Text.ts:421](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L421)
diff --git a/src/content/docs/api/classes/FitContentLayout.md b/src/content/docs/api/classes/FitContentLayout.md
index 922d7c424..d8f588467 100644
--- a/src/content/docs/api/classes/FitContentLayout.md
+++ b/src/content/docs/api/classes/FitContentLayout.md
@@ -5,6 +5,8 @@ prev: false
title: "FitContentLayout"
---
+Defined in: [src/LayoutManager/LayoutStrategies/FitContentLayout.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FitContentLayout.ts#L8)
+
Layout will adjust the bounding box to fit target's objects.
## Extends
@@ -13,17 +15,17 @@ Layout will adjust the bounding box to fit target's objects.
## Constructors
-### new FitContentLayout()
+### Constructor
-> **new FitContentLayout**(): [`FitContentLayout`](/api/classes/fitcontentlayout/)
+> **new FitContentLayout**(): `FitContentLayout`
#### Returns
-[`FitContentLayout`](/api/classes/fitcontentlayout/)
+`FitContentLayout`
#### Inherited from
-[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructors)
+[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructor)
## Properties
@@ -31,29 +33,33 @@ Layout will adjust the bounding box to fit target's objects.
> `readonly` `static` **type**: `"fit-content"` = `'fit-content'`
+Defined in: [src/LayoutManager/LayoutStrategies/FitContentLayout.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FitContentLayout.ts#L9)
+
override by subclass for persistence (TS does not support `static abstract`)
#### Overrides
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`type`](/api/classes/layoutstrategy/#type)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/FitContentLayout.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/FitContentLayout.ts#L9)
-
## Methods
### calcBoundingBox()
> **calcBoundingBox**(`objects`, `context`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
+
Override this method to customize layout.
#### Parameters
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+
+##### context
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -63,25 +69,27 @@ Override this method to customize layout.
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcBoundingBox`](/api/classes/layoutstrategy/#calcboundingbox)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
-
***
### calcLayoutResult()
> **calcLayoutResult**(`context`, `objects`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L33)
+
Used by the `LayoutManager` to perform layout
@TODO/fix: if this method is calcResult, should calc unconditionally.
the condition to not calc should be evaluated by the layoutManager.
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -93,21 +101,23 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcLayoutResult`](/api/classes/layoutstrategy/#calclayoutresult)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L33)
-
***
### getInitialSize()
> **getInitialSize**(`context`, `result`): [`Point`](/api/classes/point/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L58)
+
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
-• **result**: `Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
+##### result
+
+`Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
#### Returns
@@ -117,19 +127,19 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`getInitialSize`](/api/classes/layoutstrategy/#getinitialsize)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L58)
-
***
### shouldLayoutClipPath()
> **shouldLayoutClipPath**(`__namedParameters`): `undefined` \| `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L50)
+
#### Parameters
-• **\_\_namedParameters**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### \_\_namedParameters
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -139,22 +149,22 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldLayoutClipPath`](/api/classes/layoutstrategy/#shouldlayoutclippath)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L50)
-
***
### shouldPerformLayout()
> **shouldPerformLayout**(`context`): `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/FitContentLayout.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FitContentLayout.ts#L16)
+
layout on all triggers
Override at will
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -163,7 +173,3 @@ Override at will
#### Overrides
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldPerformLayout`](/api/classes/layoutstrategy/#shouldperformlayout)
-
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/FitContentLayout.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/FitContentLayout.ts#L16)
diff --git a/src/content/docs/api/classes/FixedLayout.md b/src/content/docs/api/classes/FixedLayout.md
index d8c60c764..283b0b999 100644
--- a/src/content/docs/api/classes/FixedLayout.md
+++ b/src/content/docs/api/classes/FixedLayout.md
@@ -5,6 +5,8 @@ prev: false
title: "FixedLayout"
---
+Defined in: [src/LayoutManager/LayoutStrategies/FixedLayout.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FixedLayout.ts#L13)
+
Layout will keep target's initial size.
## Extends
@@ -13,17 +15,17 @@ Layout will keep target's initial size.
## Constructors
-### new FixedLayout()
+### Constructor
-> **new FixedLayout**(): [`FixedLayout`](/api/classes/fixedlayout/)
+> **new FixedLayout**(): `FixedLayout`
#### Returns
-[`FixedLayout`](/api/classes/fixedlayout/)
+`FixedLayout`
#### Inherited from
-[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructors)
+[`LayoutStrategy`](/api/classes/layoutstrategy/).[`constructor`](/api/classes/layoutstrategy/#constructor)
## Properties
@@ -31,29 +33,33 @@ Layout will keep target's initial size.
> `readonly` `static` **type**: `"fixed"` = `'fixed'`
+Defined in: [src/LayoutManager/LayoutStrategies/FixedLayout.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FixedLayout.ts#L14)
+
override by subclass for persistence (TS does not support `static abstract`)
#### Overrides
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`type`](/api/classes/layoutstrategy/#type)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/FixedLayout.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/FixedLayout.ts#L14)
-
## Methods
### calcBoundingBox()
> **calcBoundingBox**(`objects`, `context`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
+
Override this method to customize layout.
#### Parameters
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+
+##### context
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -63,25 +69,27 @@ Override this method to customize layout.
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcBoundingBox`](/api/classes/layoutstrategy/#calcboundingbox)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68)
-
***
### calcLayoutResult()
> **calcLayoutResult**(`context`, `objects`): `undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/)
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L33)
+
Used by the `LayoutManager` to perform layout
@TODO/fix: if this method is calcResult, should calc unconditionally.
the condition to not calc should be evaluated by the layoutManager.
#### Parameters
-• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### context
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
-• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -93,23 +101,25 @@ layout result **OR** `undefined` to skip layout
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`calcLayoutResult`](/api/classes/layoutstrategy/#calclayoutresult)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L33)
-
***
### getInitialSize()
> **getInitialSize**(`__namedParameters`, `__namedParameters`): [`Point`](/api/classes/point/)
+Defined in: [src/LayoutManager/LayoutStrategies/FixedLayout.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/FixedLayout.ts#L19)
+
respect target's initial size
#### Parameters
-• **\_\_namedParameters**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
+##### \_\_namedParameters
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object`
-• **\_\_namedParameters**: `Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
+##### \_\_namedParameters
+
+`Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\>
#### Returns
@@ -119,19 +129,19 @@ respect target's initial size
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`getInitialSize`](/api/classes/layoutstrategy/#getinitialsize)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/FixedLayout.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/FixedLayout.ts#L19)
-
***
### shouldLayoutClipPath()
> **shouldLayoutClipPath**(`__namedParameters`): `undefined` \| `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L50)
+
#### Parameters
-• **\_\_namedParameters**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### \_\_namedParameters
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -141,19 +151,19 @@ respect target's initial size
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldLayoutClipPath`](/api/classes/layoutstrategy/#shouldlayoutclippath)
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L50)
-
***
### shouldPerformLayout()
> **shouldPerformLayout**(`__namedParameters`): `boolean`
+Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L42)
+
#### Parameters
-• **\_\_namedParameters**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
+##### \_\_namedParameters
+
+[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)
#### Returns
@@ -162,7 +172,3 @@ respect target's initial size
#### Inherited from
[`LayoutStrategy`](/api/classes/layoutstrategy/).[`shouldPerformLayout`](/api/classes/layoutstrategy/#shouldperformlayout)
-
-#### Defined in
-
-[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L42)
diff --git a/src/content/docs/api/classes/Gradient.md b/src/content/docs/api/classes/Gradient.md
index a234a71a6..0715c6b1e 100644
--- a/src/content/docs/api/classes/Gradient.md
+++ b/src/content/docs/api/classes/Gradient.md
@@ -5,36 +5,42 @@ prev: false
title: "Gradient"
---
+Defined in: [src/gradient/Gradient.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L29)
+
Gradient class
Gradient
-## Tutorial
+## See
-[http://fabricjs.com/fabric-intro-part-2#gradients](http://fabricjs.com/fabric-intro-part-2#gradients)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#gradients](http://fabric5.fabricjs.com/fabric-intro-part-2#gradients)
## Type Parameters
-• **S**
+### S
+
+`S`
+
+### T
-• **T** *extends* [`GradientType`](/api/type-aliases/gradienttype/) = `S` *extends* [`GradientType`](/api/type-aliases/gradienttype/) ? `S` : `"linear"`
+`T` *extends* [`GradientType`](/api/type-aliases/gradienttype/) = `S` *extends* [`GradientType`](/api/type-aliases/gradienttype/) ? `S` : `"linear"`
## Constructors
-### new Gradient()
+### Constructor
-> **new Gradient**\<`S`, `T`\>(`options`): [`Gradient`](/api/classes/gradient/)\<`S`, `T`\>
+> **new Gradient**\<`S`, `T`\>(`options`): `Gradient`\<`S`, `T`\>
+
+Defined in: [src/gradient/Gradient.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L102)
#### Parameters
-• **options**: [`GradientOptions`](/api/type-aliases/gradientoptions/)\<`T`\>
+##### options
-#### Returns
+[`GradientOptions`](/api/type-aliases/gradientoptions/)\<`T`\>
-[`Gradient`](/api/classes/gradient/)\<`S`, `T`\>
-
-#### Defined in
+#### Returns
-[src/gradient/Gradient.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L102)
+`Gradient`\<`S`, `T`\>
## Properties
@@ -42,24 +48,20 @@ Gradient class
> **colorStops**: [`ColorStop`](/api/type-aliases/colorstop/)[]
+Defined in: [src/gradient/Gradient.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L86)
+
Defines how many colors a gradient has and how they are located on the axis
defined by coords
-#### Defined in
-
-[src/gradient/Gradient.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L86)
-
***
### coords
> **coords**: [`GradientCoords`](/api/type-aliases/gradientcoords/)\<`T`\>
-Defines how the gradient is located in space and spread
-
-#### Defined in
+Defined in: [src/gradient/Gradient.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L79)
-[src/gradient/Gradient.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L79)
+Defines how the gradient is located in space and spread
***
@@ -67,11 +69,9 @@ Defines how the gradient is located in space and spread
> `optional` **excludeFromExport**: `boolean`
-If true, this object will not be exported during the serialization of a canvas
-
-#### Defined in
+Defined in: [src/gradient/Gradient.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L92)
-[src/gradient/Gradient.ts:92](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L92)
+If true, this object will not be exported during the serialization of a canvas
***
@@ -79,6 +79,8 @@ If true, this object will not be exported during the serialization of a canvas
> `optional` **gradientTransform**: [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/gradient/Gradient.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L55)
+
A transform matrix to apply to the gradient before painting.
Imported from svg gradients, is not applied with the current transform in the center.
Before this transform is applied, the origin point is at the top left corner of the object
@@ -90,16 +92,14 @@ plus the addition of offsetY and offsetX.
null
```
-#### Defined in
-
-[src/gradient/Gradient.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L55)
-
***
### gradientUnits
> **gradientUnits**: [`GradientUnits`](/api/type-aliases/gradientunits/)
+Defined in: [src/gradient/Gradient.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L66)
+
coordinates units for coords.
If `pixels`, the number of coords are in the same unit of width / height.
If set as `percentage` the coords are still a number, but 1 means 100% of width
@@ -112,21 +112,15 @@ allowed values pixels or percentage.
'pixels'
```
-#### Defined in
-
-[src/gradient/Gradient.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L66)
-
***
### id
> `readonly` **id**: `string` \| `number`
-ID used for SVG export functionalities
-
-#### Defined in
+Defined in: [src/gradient/Gradient.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L98)
-[src/gradient/Gradient.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L98)
+ID used for SVG export functionalities
***
@@ -134,6 +128,8 @@ ID used for SVG export functionalities
> **offsetX**: `number`
+Defined in: [src/gradient/Gradient.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L38)
+
Horizontal offset for aligning gradients coming from SVG when outside pathgroups
#### Default
@@ -142,16 +138,14 @@ Horizontal offset for aligning gradients coming from SVG when outside pathgroups
0
```
-#### Defined in
-
-[src/gradient/Gradient.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L38)
-
***
### offsetY
> **offsetY**: `number`
+Defined in: [src/gradient/Gradient.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L45)
+
Vertical offset for aligning gradients coming from SVG when outside pathgroups
#### Default
@@ -160,16 +154,14 @@ Vertical offset for aligning gradients coming from SVG when outside pathgroups
0
```
-#### Defined in
-
-[src/gradient/Gradient.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L45)
-
***
### type
> **type**: `T`
+Defined in: [src/gradient/Gradient.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L73)
+
Gradient type linear or radial
#### Default
@@ -178,53 +170,51 @@ Gradient type linear or radial
'linear'
```
-#### Defined in
-
-[src/gradient/Gradient.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L73)
-
***
### type
> `static` **type**: `string` = `'Gradient'`
-#### Defined in
-
-[src/gradient/Gradient.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L100)
+Defined in: [src/gradient/Gradient.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L100)
## Methods
### addColorStop()
-> **addColorStop**(`colorStops`): [`Gradient`](/api/classes/gradient/)\<`S`, `T`\>
+> **addColorStop**(`colorStops`): `Gradient`\<`S`, `T`\>
+
+Defined in: [src/gradient/Gradient.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L133)
Adds another colorStop
#### Parameters
-• **colorStops**: `Record`\<`string`, `string`\>
+##### colorStops
+
+`Record`\<`string`, `string`\>
#### Returns
-[`Gradient`](/api/classes/gradient/)\<`S`, `T`\>
+`Gradient`\<`S`, `T`\>
thisArg
-#### Defined in
-
-[src/gradient/Gradient.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L133)
-
***
### toLive()
> **toLive**(`ctx`): `CanvasGradient`
+Defined in: [src/gradient/Gradient.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L293)
+
Returns an instance of CanvasGradient
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -232,31 +222,27 @@ Context to render on
`CanvasGradient`
-#### Defined in
-
-[src/gradient/Gradient.ts:299](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L299)
-
***
### toObject()
-> **toObject**(`propertiesToInclude`?): `Partial`\<[`Gradient`](/api/classes/gradient/)\<`S`, `T`\>\> & `object`
+> **toObject**(`propertiesToInclude?`): [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`T`\>
+
+Defined in: [src/gradient/Gradient.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L148)
Returns object representation of a gradient
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Partial`\<[`Gradient`](/api/classes/gradient/)\<`S`, `T`\>\> & `object`
-
-#### Defined in
-
-[src/gradient/Gradient.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L150)
+[`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`T`\>
***
@@ -264,17 +250,23 @@ Any properties that you might want to additionally include in the output
> **toSVG**(`object`, `__namedParameters`): `string`
+Defined in: [src/gradient/Gradient.ts:171](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L171)
+
Returns SVG representation of an gradient
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to create a gradient for
-• **\_\_namedParameters** = `{}`
+##### \_\_namedParameters
-• **\_\_namedParameters.additionalTransform?**: `string`
+###### additionalTransform?
+
+`string`
#### Returns
@@ -282,43 +274,41 @@ Object to create a gradient for
SVG representation of an gradient (linear/radial)
-#### Defined in
-
-[src/gradient/Gradient.ts:171](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L171)
-
***
### fromElement()
-> `static` **fromElement**(`el`, `instance`, `svgOptions`): [`Gradient`](/api/classes/gradient/)\<[`GradientType`](/api/type-aliases/gradienttype/), [`GradientType`](/api/type-aliases/gradienttype/)\>
+> `static` **fromElement**(`el`, `instance`, `svgOptions`): `Gradient`\<[`GradientType`](/api/type-aliases/gradienttype/)\>
+
+Defined in: [src/gradient/Gradient.ts:369](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L369)
-Returns [Gradient](../../../../api/classes/gradient) instance from an SVG element
+Returns [Gradient](/api/classes/gradient/) instance from an SVG element
#### Parameters
-• **el**: `SVGGradientElement`
+##### el
+
+`SVGGradientElement`
SVG gradient element
-• **instance**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### instance
+
+[`FabricObject`](/api/classes/fabricobject/)
-• **svgOptions**: [`SVGOptions`](/api/type-aliases/svgoptions/)
+##### svgOptions
+
+[`SVGOptions`](/api/type-aliases/svgoptions/)
an object containing the size of the SVG in order to parse correctly gradients
that uses gradientUnits as 'userSpaceOnUse' and percentages.
#### Returns
-[`Gradient`](/api/classes/gradient/)\<[`GradientType`](/api/type-aliases/gradienttype/), [`GradientType`](/api/type-aliases/gradienttype/)\>
+`Gradient`\<[`GradientType`](/api/type-aliases/gradienttype/)\>
Gradient instance
-#### Static
-
-#### Member Of
-
-Gradient
-
#### See
- http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement
@@ -356,42 +346,38 @@ Gradient
```
-#### Defined in
-
-[src/gradient/Gradient.ts:382](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L382)
-
***
### fromObject()
-#### fromObject(options)
+#### Call Signature
-> `static` **fromObject**(`options`): `Promise`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\>
+> `static` **fromObject**(`options`): `Promise`\<`Gradient`\<`"linear"`, `"linear"`\>\>
+
+Defined in: [src/gradient/Gradient.ts:307](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L307)
##### Parameters
-• **options**: [`GradientOptions`](/api/type-aliases/gradientoptions/)\<`"linear"`\>
+###### options
-##### Returns
+[`GradientOptions`](/api/type-aliases/gradientoptions/)\<`"linear"`\>
-`Promise`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\>
+##### Returns
-##### Defined in
+`Promise`\<`Gradient`\<`"linear"`, `"linear"`\>\>
-[src/gradient/Gradient.ts:318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L318)
+#### Call Signature
-#### fromObject(options)
+> `static` **fromObject**(`options`): `Promise`\<`Gradient`\<`"radial"`, `"radial"`\>\>
-> `static` **fromObject**(`options`): `Promise`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\>
+Defined in: [src/gradient/Gradient.ts:310](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/Gradient.ts#L310)
##### Parameters
-• **options**: [`GradientOptions`](/api/type-aliases/gradientoptions/)\<`"radial"`\>
-
-##### Returns
+###### options
-`Promise`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\>
+[`GradientOptions`](/api/type-aliases/gradientoptions/)\<`"radial"`\>
-##### Defined in
+##### Returns
-[src/gradient/Gradient.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/Gradient.ts#L321)
+`Promise`\<`Gradient`\<`"radial"`, `"radial"`\>\>
diff --git a/src/content/docs/api/classes/Group.md b/src/content/docs/api/classes/Group.md
index 4bdae945b..5160fae63 100644
--- a/src/content/docs/api/classes/Group.md
+++ b/src/content/docs/api/classes/Group.md
@@ -5,6 +5,8 @@ prev: false
title: "Group"
---
+Defined in: [src/shapes/Group.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L82)
+
## Fires
object:added
@@ -23,7 +25,7 @@ layout:after
## Extends
-- `Collection`\<(`options`?) => [`FabricObject`](/api/classes/fabricobject/)\<[`GroupProps`](/api/interfaces/groupprops/), [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/), [`GroupEvents`](/api/interfaces/groupevents/)\>, `this`\> & [`FabricObject`](/api/classes/fabricobject/)\<[`GroupProps`](/api/interfaces/groupprops/), [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/), [`GroupEvents`](/api/interfaces/groupevents/), `this`\>
+- `Collection`\<\{(`options?`): [`FabricObject`](/api/classes/fabricobject/)\<[`GroupProps`](/api/interfaces/groupprops/), [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/), [`GroupEvents`](/api/interfaces/groupevents/)\>; `cacheProperties`: `string`[]; `colorProperties`: `string`[]; `customProperties`: `string`[]; `ownDefaults`: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\>; `prototype`: [`FabricObject`](/api/classes/fabricobject/)\<`any`, `any`, `any`\>; `stateProperties`: `string`[]; `type`: `string`; `_fromObject`: `Promise`\<`S`\>; `createControls`: \{ `controls`: `Record`\<`string`, [`Control`](/api/classes/control/)\>; \}; `fromObject`: `Promise`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>; `getDefaults`: `Record`\<`string`, `any`\>; \}, `this`\> & [`FabricObject`](/api/classes/fabricobject/)\<[`GroupProps`](/api/interfaces/groupprops/), [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/), [`GroupEvents`](/api/interfaces/groupevents/), `this`\>
## Extended by
@@ -35,35 +37,35 @@ layout:after
## Constructors
-### new Group()
+### Constructor
+
+> **new Group**(`objects?`, `options?`): `Group`
-> **new Group**(`objects`?, `options`?): [`Group`](/api/classes/group/)
+Defined in: [src/shapes/Group.ts:137](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L137)
Constructor
#### Parameters
-• **objects?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
+##### objects?
+
+[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
instance objects
-• **options?**: `Partial`\<[`GroupProps`](/api/interfaces/groupprops/)\> = `{}`
+##### options?
+
+`Partial`\<[`GroupProps`](/api/interfaces/groupprops/)\> = `{}`
Options object
#### Returns
-[`Group`](/api/classes/group/)
+`Group`
#### Overrides
-`createCollectionMixin(
- FabricObject,
- ).constructor`
-
-#### Defined in
-
-[src/shapes/Group.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L139)
+`createCollectionMixin( FabricObject, ).constructor`
## Properties
@@ -71,6 +73,8 @@ Options object
> `optional` **\_\_corner**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L105)
+
keeps the value of the last hovered corner during mouse move.
0 is no corner, or 'mt', 'ml', 'mtr' etc..
It should be private, but there is no harm in using it as
@@ -79,13 +83,7 @@ this isn't cleaned automatically. Non selected objects may have wrong values
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).__corner`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L105)
+`createCollectionMixin( FabricObject, ).__corner`
***
@@ -93,19 +91,15 @@ this isn't cleaned automatically. Non selected objects may have wrong values
> **\_controlsVisibility**: `Record`\<`string`, `boolean`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L112)
+
a map of control visibility for this object.
this was left when controls were introduced to not break the api too much
this takes priority over the generic control visibility
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._controlsVisibility`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L112)
+`createCollectionMixin( FabricObject, )._controlsVisibility`
***
@@ -113,19 +107,15 @@ this takes priority over the generic control visibility
> **\_objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] = `[]`
+Defined in: [src/Collection.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L21)
+
#### TODO
needs to end up in the constructor too
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._objects`
-
-#### Defined in
-
-[src/Collection.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L21)
+`createCollectionMixin( FabricObject, )._objects`
***
@@ -133,6 +123,8 @@ needs to end up in the constructor too
> `optional` **\_scaling**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L134)
+
A boolean used from the gesture module to keep tracking of a scaling
action when there is no scaling transform in place.
This is an edge case and is used twice in all codebase.
@@ -145,36 +137,7 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._scaling`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134)
-
-***
-
-### aCoords
-
-> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
-
-Describe object's corner position in scene coordinates.
-The coordinates are derived from the following:
-left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
-The coordinates do not depend on viewport changes.
-The coordinates get updated with [setCoords](../../../../api/classes/group/#setcoords).
-You can calculate them without updating with [()](../../../../api/classes/group/#calcacoords)
-
-#### Inherited from
-
-`createCollectionMixin(
- FabricObject,
- ).aCoords`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63)
+`createCollectionMixin( FabricObject, )._scaling`
***
@@ -182,6 +145,8 @@ You can calculate them without updating with [()](../../../../api/classes/group/
> **absolutePositioned**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L215)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will have its top and left relative to canvas, and will
not be influenced by the object transform. This will make the clipPath relative
@@ -201,13 +166,26 @@ false
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).absolutePositioned`
+`createCollectionMixin( FabricObject, ).absolutePositioned`
+
+***
+
+### aCoords
+
+> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L63)
+
+Describe object's corner position in scene coordinates.
+The coordinates are derived from the following:
+left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth.
+The coordinates do not depend on viewport changes.
+The coordinates get updated with [setCoords](/api/classes/group/#setcoords).
+You can calculate them without updating with [()](/api/classes/group/#calcacoords)
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218)
+`createCollectionMixin( FabricObject, ).aCoords`
***
@@ -215,6 +193,8 @@ false
> **angle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L581)
+
Angle of rotation of an object (in degrees)
#### Default
@@ -229,13 +209,7 @@ Angle of rotation of an object (in degrees)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).angle`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:581](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L581)
+`createCollectionMixin( FabricObject, ).angle`
***
@@ -243,28 +217,18 @@ Angle of rotation of an object (in degrees)
> **backgroundColor**: `string`
+Defined in: [src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L202)
+
Background color of an object.
takes css colors https://www.w3.org/TR/css-color-3/
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`backgroundColor`](/api/interfaces/groupprops/#backgroundcolor)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).backgroundColor`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L205)
+`createCollectionMixin( FabricObject, ).backgroundColor`
***
@@ -272,6 +236,8 @@ takes css colors https://www.w3.org/TR/css-color-3/
> **borderColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L74)
+
Color of controlling borders of an object (when it's active)
#### Default
@@ -286,13 +252,7 @@ rgb(178,204,255)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).borderColor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L74)
+`createCollectionMixin( FabricObject, ).borderColor`
***
@@ -300,6 +260,8 @@ rgb(178,204,255)
> **borderDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L75)
+
Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Since
@@ -312,13 +274,7 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).borderDashArray`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L75)
+`createCollectionMixin( FabricObject, ).borderDashArray`
***
@@ -326,6 +282,8 @@ Array specifying dash pattern of an object's borders (hasBorder must be true)
> **borderOpacityWhenMoving**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L76)
+
Opacity of object's controlling borders when object is active and moving
#### Default
@@ -340,13 +298,7 @@ Opacity of object's controlling borders when object is active and moving
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).borderOpacityWhenMoving`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L76)
+`createCollectionMixin( FabricObject, ).borderOpacityWhenMoving`
***
@@ -354,10 +306,13 @@ Opacity of object's controlling borders when object is active and moving
> **borderScaleFactor**: `number`
-Scale factor of object's controlling borders
-bigger number will make a thicker border
-border is 1, so this is basically a border thickness
-since there is no way to change the border itself.
+Defined in: [src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L77)
+
+Scale factor for the border of the objects ( selection box and controls stroke ).
+Bigger number will make a thicker border
+border default value is 1, so this scale value is equal to a border and control strokeWidth.
+If you need to divide border from control strokeWidth
+you will need to write your own render function for controls
#### Default
@@ -371,13 +326,7 @@ since there is no way to change the border itself.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).borderScaleFactor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77)
+`createCollectionMixin( FabricObject, ).borderScaleFactor`
***
@@ -385,6 +334,8 @@ since there is no way to change the border itself.
> **centeredRotation**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L216)
+
When `true` the object will rotate on its center.
When `false` will rotate around the origin point defined by originX and originY.
The value of this property is IGNORED during a transform if the canvas has already
@@ -395,25 +346,13 @@ The object method `rotate` will always consider this property and never the canv
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`centeredRotation`](/api/interfaces/groupprops/#centeredrotation)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).centeredRotation`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L219)
+`createCollectionMixin( FabricObject, ).centeredRotation`
***
@@ -421,6 +360,8 @@ The object method `rotate` will always consider this property and never the canv
> **centeredScaling**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L217)
+
When true, this object will use center point as the origin of transformation
when being scaled via the controls.
@@ -428,25 +369,13 @@ when being scaled via the controls.
1.3.4
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`centeredScaling`](/api/interfaces/groupprops/#centeredscaling)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).centeredScaling`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L220)
+`createCollectionMixin( FabricObject, ).centeredScaling`
***
@@ -454,6 +383,8 @@ when being scaled via the controls.
> `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+Defined in: [src/shapes/Object/Object.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L213)
+
a fabricObject that, without stroke define a clipping area with their shape. filled in black
the clipPath object gets used when the object has rendered, and the context is placed in the center
of the object cacheCanvas.
@@ -465,13 +396,7 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).clipPath`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216)
+`createCollectionMixin( FabricObject, ).clipPath`
***
@@ -479,18 +404,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi
> `optional` **clipPathId**: `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L15)
+
When an object is being exported as SVG as a clippath, a reference inside the SVG is needed.
This reference is a UID in the fabric namespace and is temporary stored here.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).clipPathId`
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14)
+`createCollectionMixin( FabricObject, ).clipPathId`
***
@@ -498,18 +419,14 @@ This reference is a UID in the fabric namespace and is temporary stored here.
> **controls**: `TControlSet`
+Defined in: [src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L118)
+
holds the controls for the object.
controls are added by default_controls.js
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).controls`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L118)
+`createCollectionMixin( FabricObject, ).controls`
***
@@ -517,6 +434,8 @@ controls are added by default_controls.js
> **cornerColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L68)
+
Color of controlling corners of an object (when it's active)
#### Default
@@ -531,13 +450,7 @@ rgb(178,204,255)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cornerColor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L68)
+`createCollectionMixin( FabricObject, ).cornerColor`
***
@@ -545,6 +458,8 @@ rgb(178,204,255)
> **cornerDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L71)
+
Array specifying dash pattern of an object's control (hasBorder must be true)
#### Since
@@ -563,13 +478,7 @@ null
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cornerDashArray`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L71)
+`createCollectionMixin( FabricObject, ).cornerDashArray`
***
@@ -577,6 +486,8 @@ null
> **cornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L65)
+
Size of object's controlling corners (in pixels)
#### Default
@@ -591,13 +502,7 @@ Size of object's controlling corners (in pixels)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cornerSize`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L65)
+`createCollectionMixin( FabricObject, ).cornerSize`
***
@@ -605,6 +510,8 @@ Size of object's controlling corners (in pixels)
> **cornerStrokeColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L69)
+
Color of controlling corners of an object (when it's active and transparentCorners false)
#### Since
@@ -623,13 +530,7 @@ Color of controlling corners of an object (when it's active and transparentCorne
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cornerStrokeColor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L69)
+`createCollectionMixin( FabricObject, ).cornerStrokeColor`
***
@@ -637,10 +538,16 @@ Color of controlling corners of an object (when it's active and transparentCorne
> **cornerStyle**: `"circle"` \| `"rect"`
+Defined in: [src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L70)
+
Specify style of control, 'rect' or 'circle'
This is deprecated. In the future there will be a standard control render
And you can swap it with one of the alternative proposed with the control api
+:::caution[Deprecated]
+This API is no longer supported and may be removed in a future release.
+:::
+
#### Since
1.6.2
@@ -651,23 +558,13 @@ And you can swap it with one of the alternative proposed with the control api
'rect'
```
-:::caution[Deprecated]
-This API is no longer supported and may be removed in a future release.
-:::
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`cornerStyle`](/api/interfaces/groupprops/#cornerstyle)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cornerStyle`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70)
+`createCollectionMixin( FabricObject, ).cornerStyle`
***
@@ -675,6 +572,8 @@ This API is no longer supported and may be removed in a future release.
> **dirty**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L242)
+
When set to `true`, object's cache will be rerendered next render call.
since 1.7.0
@@ -686,13 +585,7 @@ true
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).dirty`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245)
+`createCollectionMixin( FabricObject, ).dirty`
***
@@ -700,13 +593,9 @@ true
> **evented**: `boolean`
-When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82)
-```
+When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4
#### Implementation of
@@ -714,13 +603,7 @@ When set to `false`, an object can not be a target of events. All events propaga
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).evented`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82)
+`createCollectionMixin( FabricObject, ).evented`
***
@@ -728,31 +611,21 @@ When set to `false`, an object can not be a target of events. All events propaga
> **excludeFromExport**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L209)
+
When `true`, object is not exported in OBJECT/JSON
#### Since
1.6.3
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`excludeFromExport`](/api/interfaces/groupprops/#excludefromexport)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).excludeFromExport`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L212)
+`createCollectionMixin( FabricObject, ).excludeFromExport`
***
@@ -760,6 +633,8 @@ When `true`, object is not exported in OBJECT/JSON
> **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L192)
+
Color of object's fill
takes css colors https://www.w3.org/TR/css-color-3/
@@ -775,13 +650,7 @@ rgb(0,0,0)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).fill`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L195)
+`createCollectionMixin( FabricObject, ).fill`
***
@@ -789,6 +658,8 @@ rgb(0,0,0)
> **fillRule**: `CanvasFillRule`
+Defined in: [src/shapes/Object/Object.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L193)
+
Fill rule used to fill an object
accepted values are nonzero, evenodd
Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12 (use `globalCompositeOperation` instead)
@@ -805,13 +676,7 @@ nonzero
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).fillRule`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L196)
+`createCollectionMixin( FabricObject, ).fillRule`
***
@@ -819,6 +684,8 @@ nonzero
> **flipX**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L567)
+
When true, an object is rendered as flipped horizontally
#### Default
@@ -833,13 +700,7 @@ false
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).flipX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L567)
+`createCollectionMixin( FabricObject, ).flipX`
***
@@ -847,6 +708,8 @@ false
> **flipY**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L568)
+
When true, an object is rendered as flipped vertically
#### Default
@@ -861,13 +724,7 @@ false
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).flipY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:568](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L568)
+`createCollectionMixin( FabricObject, ).flipY`
***
@@ -875,13 +732,9 @@ false
> **globalCompositeOperation**: `GlobalCompositeOperation`
-Composite rule used for canvas globalCompositeOperation
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201)
-```
+Composite rule used for canvas globalCompositeOperation
#### Implementation of
@@ -889,13 +742,7 @@ Composite rule used for canvas globalCompositeOperation
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).globalCompositeOperation`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L204)
+`createCollectionMixin( FabricObject, ).globalCompositeOperation`
***
@@ -903,13 +750,9 @@ Composite rule used for canvas globalCompositeOperation
> **hasBorders**: `boolean`
-When set to `false`, object's controlling borders are not rendered
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78)
-```
+When set to `false`, object's controlling borders are not rendered
#### Implementation of
@@ -917,13 +760,7 @@ When set to `false`, object's controlling borders are not rendered
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).hasBorders`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L78)
+`createCollectionMixin( FabricObject, ).hasBorders`
***
@@ -931,6 +768,8 @@ When set to `false`, object's controlling borders are not rendered
> **hasControls**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L72)
+
When set to `false`, object's controls are not displayed and can not be used to manipulate object
#### Default
@@ -945,13 +784,7 @@ true
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).hasControls`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L72)
+`createCollectionMixin( FabricObject, ).hasControls`
***
@@ -959,13 +792,9 @@ true
> **height**: `number`
-Object height
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566)
-```
+Object height
#### Implementation of
@@ -973,13 +802,7 @@ Object height
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).height`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566)
+`createCollectionMixin( FabricObject, ).height`
***
@@ -987,6 +810,8 @@ Object height
> **hoverCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L86)
+
Default cursor value used when hovering over this object on canvas
#### Default
@@ -1001,13 +826,7 @@ null
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).hoverCursor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86)
+`createCollectionMixin( FabricObject, ).hoverCursor`
***
@@ -1015,13 +834,9 @@ null
> **includeDefaultValues**: `boolean`
-When `false`, default object's values are not included in its serialization
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208)
-```
+When `false`, default object's values are not included in its serialization
#### Implementation of
@@ -1029,13 +844,7 @@ When `false`, default object's values are not included in its serialization
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).includeDefaultValues`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L211)
+`createCollectionMixin( FabricObject, ).includeDefaultValues`
***
@@ -1043,6 +852,8 @@ When `false`, default object's values are not included in its serialization
> **interactive**: `boolean`
+Defined in: [src/shapes/Group.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L106)
+
Used to allow targeting of object inside groups.
set to true if you want to select an object inside a group.\
**REQUIRES** `subTargetCheck` set to true
@@ -1051,12 +862,6 @@ that will take care of enabling subTargetCheck and necessary object events.
There is too much attached to group interactivity to just be evaluated by a
boolean in the code
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1065,16 +870,14 @@ This API is no longer supported and may be removed in a future release.
[`GroupProps`](/api/interfaces/groupprops/).[`interactive`](/api/interfaces/groupprops/#interactive)
-#### Defined in
-
-[src/shapes/Group.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L108)
-
***
### inverted
> **inverted**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L214)
+
Meaningful ONLY when the object is used as clipPath.
if true, the clipPath will make the object clip to the outside of the clipPath
since 2.4.0
@@ -1091,13 +894,7 @@ false
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).inverted`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217)
+`createCollectionMixin( FabricObject, ).inverted`
***
@@ -1105,18 +902,14 @@ false
> `optional` **isMoving**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L124)
+
internal boolean to signal the code that the object is
part of the move action.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).isMoving`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124)
+`createCollectionMixin( FabricObject, ).isMoving`
***
@@ -1124,23 +917,23 @@ part of the move action.
> **layoutManager**: [`LayoutManager`](/api/classes/layoutmanager/)
+Defined in: [src/shapes/Group.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L108)
+
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`layoutManager`](/api/interfaces/groupprops/#layoutmanager)
-#### Defined in
-
-[src/shapes/Group.ts:110](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L110)
-
***
### left
> **left**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L564)
+
Left position of an object.
Note that by default it's relative to object left.
-You can change this by setting [originX](../../../../api/interfaces/fabricobjectprops/#originx)
+You can change this by setting originX
#### Default
@@ -1154,13 +947,7 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).left`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L564)
+`createCollectionMixin( FabricObject, ).left`
***
@@ -1168,13 +955,9 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject
> **lockMovementX**: `boolean`
-When `true`, object horizontal movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56)
-```
+When `true`, object horizontal movement is locked
#### Implementation of
@@ -1182,13 +965,7 @@ When `true`, object horizontal movement is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockMovementX`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L56)
+`createCollectionMixin( FabricObject, ).lockMovementX`
***
@@ -1196,13 +973,9 @@ When `true`, object horizontal movement is locked
> **lockMovementY**: `boolean`
-When `true`, object vertical movement is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57)
-```
+When `true`, object vertical movement is locked
#### Implementation of
@@ -1210,13 +983,7 @@ When `true`, object vertical movement is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockMovementY`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L57)
+`createCollectionMixin( FabricObject, ).lockMovementY`
***
@@ -1224,13 +991,9 @@ When `true`, object vertical movement is locked
> **lockRotation**: `boolean`
-When `true`, object rotation is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58)
-```
+When `true`, object rotation is locked
#### Implementation of
@@ -1238,13 +1001,7 @@ When `true`, object rotation is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockRotation`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58)
+`createCollectionMixin( FabricObject, ).lockRotation`
***
@@ -1252,13 +1009,9 @@ When `true`, object rotation is locked
> **lockScalingFlip**: `boolean`
-When `true`, object cannot be flipped by scaling into negative values
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63)
-```
+When `true`, object cannot be flipped by scaling into negative values
#### Implementation of
@@ -1266,13 +1019,7 @@ When `true`, object cannot be flipped by scaling into negative values
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockScalingFlip`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L63)
+`createCollectionMixin( FabricObject, ).lockScalingFlip`
***
@@ -1280,27 +1027,17 @@ When `true`, object cannot be flipped by scaling into negative values
> **lockScalingX**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59)
+
When `true`, object horizontal scaling is locked
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`lockScalingX`](/api/interfaces/groupprops/#lockscalingx)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockScalingX`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L59)
+`createCollectionMixin( FabricObject, ).lockScalingX`
***
@@ -1308,13 +1045,9 @@ When `true`, object horizontal scaling is locked
> **lockScalingY**: `boolean`
-When `true`, object vertical scaling is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60)
-```
+When `true`, object vertical scaling is locked
#### Implementation of
@@ -1322,13 +1055,7 @@ When `true`, object vertical scaling is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockScalingY`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L60)
+`createCollectionMixin( FabricObject, ).lockScalingY`
***
@@ -1336,13 +1063,9 @@ When `true`, object vertical scaling is locked
> **lockSkewingX**: `boolean`
-When `true`, object horizontal skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L61)
-```
+When `true`, object horizontal skewing is locked
#### Implementation of
@@ -1350,13 +1073,7 @@ When `true`, object horizontal skewing is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockSkewingX`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L61)
+`createCollectionMixin( FabricObject, ).lockSkewingX`
***
@@ -1364,13 +1081,9 @@ When `true`, object horizontal skewing is locked
> **lockSkewingY**: `boolean`
-When `true`, object vertical skewing is locked
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L62)
-```
+When `true`, object vertical skewing is locked
#### Implementation of
@@ -1378,13 +1091,7 @@ When `true`, object vertical skewing is locked
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).lockSkewingY`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L62)
+`createCollectionMixin( FabricObject, ).lockSkewingY`
***
@@ -1392,17 +1099,13 @@ When `true`, object vertical skewing is locked
> `optional` **matrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L73)
+
storage cache for object full transform matrix
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).matrixCache`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73)
+`createCollectionMixin( FabricObject, ).matrixCache`
***
@@ -1410,6 +1113,8 @@ storage cache for object full transform matrix
> **minScaleLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L187)
+
Minimum allowed scale value of an object
#### Default
@@ -1424,13 +1129,7 @@ Minimum allowed scale value of an object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).minScaleLimit`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190)
+`createCollectionMixin( FabricObject, ).minScaleLimit`
***
@@ -1438,6 +1137,8 @@ Minimum allowed scale value of an object
> **moveCursor**: `null` \| `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L87)
+
Default cursor value used when moving this object on canvas
#### Default
@@ -1452,13 +1153,7 @@ null
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).moveCursor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L87)
+`createCollectionMixin( FabricObject, ).moveCursor`
***
@@ -1466,6 +1161,8 @@ null
> **noScaleCache**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L51)
+
When `true`, cache does not get updated during scaling. The picture will get blocky if scaled
too much and will be redrawn with correct details at the end of scaling.
this setting is performance and application dependant.
@@ -1484,34 +1181,7 @@ true
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).noScaleCache`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L51)
-
-***
-
-### oCoords
-
-> **oCoords**: `Record`\<`string`, `TOCoord`\>
-
-The object's controls' position in viewport coordinates
-Calculated by [Control#positionHandler](../../../../api/classes/control/#positionhandler) and [Control#calcCornerCoords](../../../../api/classes/control/#calccornercoords), depending on [padding](../../../../api/classes/fabricobject/#padding).
-`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
-Used to draw and locate controls.
-
-#### Inherited from
-
-`createCollectionMixin(
- FabricObject,
- ).oCoords`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L95)
+`createCollectionMixin( FabricObject, ).noScaleCache`
***
@@ -1519,6 +1189,8 @@ Used to draw and locate controls.
> **objectCaching**: `boolean`
+Defined in: [src/shapes/Object/Object.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L211)
+
When `true`, object is cached on an additional canvas.
When `false`, object is not cached unless necessary ( clipPath )
default to true
@@ -1539,13 +1211,24 @@ true
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).objectCaching`
+`createCollectionMixin( FabricObject, ).objectCaching`
+
+***
+
+### oCoords
+
+> **oCoords**: `Record`\<`string`, `TOCoord`\>
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L95)
+
+The object's controls' position in viewport coordinates
+Calculated by [Control#positionHandler](/api/classes/control/#positionhandler) and [Control#calcCornerCoords](/api/classes/control/#calccornercoords), depending on [padding](/api/classes/fabricobject/#padding).
+`corner/touchCorner` describe the 4 points forming the interactive area of the corner.
+Used to draw and locate controls.
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214)
+`createCollectionMixin( FabricObject, ).oCoords`
***
@@ -1553,6 +1236,8 @@ true
> **opacity**: `number`
+Defined in: [src/shapes/Object/Object.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L189)
+
Opacity of an object
#### Default
@@ -1567,13 +1252,7 @@ Opacity of an object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).opacity`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L192)
+`createCollectionMixin( FabricObject, ).opacity`
***
@@ -1581,6 +1260,8 @@ Opacity of an object
> **originX**: [`TOriginX`](/api/type-aliases/toriginx/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L576)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1591,13 +1272,7 @@ please use 'center' as value in new projects
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).originX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L576)
+`createCollectionMixin( FabricObject, ).originX`
***
@@ -1605,6 +1280,8 @@ please use 'center' as value in new projects
> **originY**: [`TOriginY`](/api/type-aliases/toriginy/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L580)
+
:::caution[Deprecated]
please use 'center' as value in new projects
:::
@@ -1615,13 +1292,7 @@ please use 'center' as value in new projects
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).originY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:580](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L580)
+`createCollectionMixin( FabricObject, ).originY`
***
@@ -1629,17 +1300,13 @@ please use 'center' as value in new projects
> `optional` **ownMatrixCache**: `TMatrixCache`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L68)
+
storage cache for object transform matrix
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).ownMatrixCache`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68)
+`createCollectionMixin( FabricObject, ).ownMatrixCache`
***
@@ -1647,6 +1314,8 @@ storage cache for object transform matrix
> **padding**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L53)
+
Padding between object and its controlling borders (in pixels)
#### Default
@@ -1661,13 +1330,7 @@ Padding between object and its controlling borders (in pixels)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).padding`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L53)
+`createCollectionMixin( FabricObject, ).padding`
***
@@ -1675,13 +1338,9 @@ Padding between object and its controlling borders (in pixels)
> **paintFirst**: `"fill"` \| `"stroke"`
-Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L191)
-```
+Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Implementation of
@@ -1689,32 +1348,22 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).paintFirst`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L194)
+`createCollectionMixin( FabricObject, ).paintFirst`
***
### parent?
-> `optional` **parent**: [`Group`](/api/classes/group/)
+> `optional` **parent**: `Group`
+
+Defined in: [src/shapes/Object/Object.ts:1602](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1602)
A reference to the parent of the object
Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the `group` ref
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).parent`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636)
+`createCollectionMixin( FabricObject, ).parent`
***
@@ -1722,13 +1371,9 @@ Used to keep the original parent ref when the object has been added to an Active
> **perPixelTargetFind**: `boolean`
-When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L83)
-```
+When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box
#### Implementation of
@@ -1736,13 +1381,7 @@ When set to `true`, objects are "found" on canvas on per-pixel basis rather than
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).perPixelTargetFind`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83)
+`createCollectionMixin( FabricObject, ).perPixelTargetFind`
***
@@ -1750,6 +1389,8 @@ When set to `true`, objects are "found" on canvas on per-pixel basis rather than
> **scaleX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L569)
+
Object scale factor (horizontal)
#### Default
@@ -1764,13 +1405,7 @@ Object scale factor (horizontal)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).scaleX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:569](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L569)
+`createCollectionMixin( FabricObject, ).scaleX`
***
@@ -1778,6 +1413,8 @@ Object scale factor (horizontal)
> **scaleY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L570)
+
Object scale factor (vertical)
#### Default
@@ -1792,13 +1429,7 @@ Object scale factor (vertical)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).scaleY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:570](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L570)
+`createCollectionMixin( FabricObject, ).scaleY`
***
@@ -1806,28 +1437,18 @@ Object scale factor (vertical)
> **selectable**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L81)
+
When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection).
But events still fire on it.
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`selectable`](/api/interfaces/groupprops/#selectable)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).selectable`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L81)
+`createCollectionMixin( FabricObject, ).selectable`
***
@@ -1835,15 +1456,11 @@ But events still fire on it.
> **selectionBackgroundColor**: `string`
+Defined in: [src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L79)
+
Selection Background color of an object. colored layer behind the object when it is active.
does not mix good with globalCompositeOperation methods.
-#### Default
-
-```ts
-
-```
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
@@ -1854,13 +1471,7 @@ This API is no longer supported and may be removed in a future release.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).selectionBackgroundColor`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79)
+`createCollectionMixin( FabricObject, ).selectionBackgroundColor`
***
@@ -1868,6 +1479,8 @@ This API is no longer supported and may be removed in a future release.
> **shadow**: `null` \| [`Shadow`](/api/classes/shadow/)
+Defined in: [src/shapes/Object/Object.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L204)
+
Shadow object representing shadow of this shape
#### Default
@@ -1882,13 +1495,7 @@ null
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).shadow`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:207](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L207)
+`createCollectionMixin( FabricObject, ).shadow`
***
@@ -1896,6 +1503,8 @@ null
> **skewX**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L571)
+
Angle of skew on x axes of an object (in degrees)
#### Default
@@ -1910,13 +1519,7 @@ Angle of skew on x axes of an object (in degrees)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).skewX`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L571)
+`createCollectionMixin( FabricObject, ).skewX`
***
@@ -1924,6 +1527,8 @@ Angle of skew on x axes of an object (in degrees)
> **skewY**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L572)
+
Angle of skew on y axes of an object (in degrees)
#### Default
@@ -1938,13 +1543,7 @@ Angle of skew on y axes of an object (in degrees)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).skewY`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:572](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L572)
+`createCollectionMixin( FabricObject, ).skewY`
***
@@ -1952,6 +1551,8 @@ Angle of skew on y axes of an object (in degrees)
> `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L53)
+
The angle that an object will lock to while rotating.
#### Implementation of
@@ -1960,13 +1561,7 @@ The angle that an object will lock to while rotating.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).snapAngle`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L53)
+`createCollectionMixin( FabricObject, ).snapAngle`
***
@@ -1974,6 +1569,8 @@ The angle that an object will lock to while rotating.
> `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/)
+Defined in: [src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L54)
+
The angle difference from the current snapped angle in which snapping should occur.
When undefined, the snapThreshold will default to the snapAngle.
@@ -1983,13 +1580,7 @@ When undefined, the snapThreshold will default to the snapAngle.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).snapThreshold`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54)
+`createCollectionMixin( FabricObject, ).snapThreshold`
***
@@ -1997,6 +1588,8 @@ When undefined, the snapThreshold will default to the snapAngle.
> **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/)
+Defined in: [src/shapes/Object/Object.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L194)
+
When defined, an object is rendered via stroke and this property specifies its color
takes css colors https://www.w3.org/TR/css-color-3/
@@ -2012,13 +1605,7 @@ null
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).stroke`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L197)
+`createCollectionMixin( FabricObject, ).stroke`
***
@@ -2026,6 +1613,8 @@ null
> **strokeDashArray**: `null` \| `number`[]
+Defined in: [src/shapes/Object/Object.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L195)
+
Array specifying dash pattern of an object's stroke (stroke must be defined)
#### Default
@@ -2040,13 +1629,7 @@ null;
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeDashArray`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L198)
+`createCollectionMixin( FabricObject, ).strokeDashArray`
***
@@ -2054,6 +1637,8 @@ null;
> **strokeDashOffset**: `number`
+Defined in: [src/shapes/Object/Object.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L196)
+
Line offset of an object's stroke
#### Default
@@ -2068,13 +1653,7 @@ Line offset of an object's stroke
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeDashOffset`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199)
+`createCollectionMixin( FabricObject, ).strokeDashOffset`
***
@@ -2082,6 +1661,8 @@ Line offset of an object's stroke
> **strokeLineCap**: `CanvasLineCap`
+Defined in: [src/shapes/Object/Object.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L197)
+
Line endings style of an object's stroke (one of "butt", "round", "square")
#### Default
@@ -2096,13 +1677,7 @@ butt
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeLineCap`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L200)
+`createCollectionMixin( FabricObject, ).strokeLineCap`
***
@@ -2110,13 +1685,9 @@ butt
> **strokeLineJoin**: `CanvasLineJoin`
-Corner style of an object's stroke (one of "bevel", "round", "miter")
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L198)
-```
+Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Implementation of
@@ -2124,13 +1695,7 @@ Corner style of an object's stroke (one of "bevel", "round", "miter")
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeLineJoin`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L201)
+`createCollectionMixin( FabricObject, ).strokeLineJoin`
***
@@ -2138,6 +1703,8 @@ Corner style of an object's stroke (one of "bevel", "round", "miter")
> **strokeMiterLimit**: `number`
+Defined in: [src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L199)
+
Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Default
@@ -2152,13 +1719,7 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeMiterLimit`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202)
+`createCollectionMixin( FabricObject, ).strokeMiterLimit`
***
@@ -2166,6 +1727,8 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke
> **strokeUniform**: `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L583)
+
When `false`, the stoke width will scale with the object.
When `true`, the stroke will always match the exact pixel size entered for stroke width.
this Property does not work on Text classes or drawing call that uses strokeText,fillText methods
@@ -2193,13 +1756,7 @@ false
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeUniform`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:583](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L583)
+`createCollectionMixin( FabricObject, ).strokeUniform`
***
@@ -2207,6 +1764,8 @@ false
> **strokeWidth**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L582)
+
Width of a stroke used to render this object
#### Default
@@ -2221,13 +1780,7 @@ Width of a stroke used to render this object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).strokeWidth`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L582)
+`createCollectionMixin( FabricObject, ).strokeWidth`
***
@@ -2235,32 +1788,26 @@ Width of a stroke used to render this object
> **subTargetCheck**: `boolean`
+Defined in: [src/shapes/Group.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L93)
+
Used to optimize performance
set to `false` if you don't need contained objects to be targets of events
-#### Default
-
-```ts
-
-```
-
#### Implementation of
[`GroupProps`](/api/interfaces/groupprops/).[`subTargetCheck`](/api/interfaces/groupprops/#subtargetcheck)
-#### Defined in
-
-[src/shapes/Group.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L94)
-
***
### top
> **top**: `number`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L563)
+
Top position of an object.
Note that by default it's relative to object top.
-You can change this by setting [originY](../../../../api/interfaces/fabricobjectprops/#originy)
+You can change this by setting originY
#### Default
@@ -2274,13 +1821,7 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).top`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:563](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L563)
+`createCollectionMixin( FabricObject, ).top`
***
@@ -2288,6 +1829,8 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject
> **touchCornerSize**: `number`
+Defined in: [src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L66)
+
Size of object's controlling corners when touch interaction is detected
#### Default
@@ -2302,13 +1845,7 @@ Size of object's controlling corners when touch interaction is detected
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).touchCornerSize`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L66)
+`createCollectionMixin( FabricObject, ).touchCornerSize`
***
@@ -2316,6 +1853,8 @@ Size of object's controlling corners when touch interaction is detected
> **transparentCorners**: `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L67)
+
When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)
#### Default
@@ -2330,13 +1869,7 @@ true
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).transparentCorners`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L67)
+`createCollectionMixin( FabricObject, ).transparentCorners`
***
@@ -2344,13 +1877,9 @@ true
> **visible**: `boolean`
-When set to `false`, an object is not rendered on canvas
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/Object.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L206)
-```
+When set to `false`, an object is not rendered on canvas
#### Implementation of
@@ -2358,13 +1887,7 @@ When set to `false`, an object is not rendered on canvas
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).visible`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L209)
+`createCollectionMixin( FabricObject, ).visible`
***
@@ -2372,13 +1895,9 @@ When set to `false`, an object is not rendered on canvas
> **width**: `number`
-Object width
-
-#### Default
-
-```ts
+Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565)
-```
+Object width
#### Implementation of
@@ -2386,13 +1905,7 @@ Object width
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).width`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L565)
+`createCollectionMixin( FabricObject, ).width`
***
@@ -2400,6 +1913,8 @@ Object width
> `static` **cacheProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:234](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L234)
+
List of properties to consider when checking if cache needs refresh
Those properties are checked by
calls to Object.set(key, value). If the key is in this list, the object is marked as dirty
@@ -2407,13 +1922,7 @@ and refreshed at the next render
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cacheProperties`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L237)
+`createCollectionMixin( FabricObject, ).cacheProperties`
***
@@ -2421,17 +1930,13 @@ and refreshed at the next render
> `static` **colorProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1509)
+
List of properties to consider for animating colors.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).colorProperties`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1543](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1543)
+`createCollectionMixin( FabricObject, ).colorProperties`
***
@@ -2439,18 +1944,14 @@ List of properties to consider for animating colors.
> `static` **customProperties**: `string`[] = `[]`
+Defined in: [src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1750)
+
Define a list of custom properties that will be serialized when
instance.toObject() gets called
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).customProperties`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784)
+`createCollectionMixin( FabricObject, ).customProperties`
***
@@ -2458,15 +1959,11 @@ instance.toObject() gets called
> `static` **ownDefaults**: `Record`\<`string`, `any`\> = `groupDefaultValues`
-#### Overrides
-
-`createCollectionMixin(
- FabricObject,
- ).ownDefaults`
+Defined in: [src/shapes/Group.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L120)
-#### Defined in
+#### Overrides
-[src/shapes/Group.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L122)
+`createCollectionMixin( FabricObject, ).ownDefaults`
***
@@ -2474,19 +1971,15 @@ instance.toObject() gets called
> `static` **stateProperties**: `string`[]
+Defined in: [src/shapes/Object/Object.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L225)
+
This list of properties is used to check if the state of an object is changed.
This state change now is only used for children of groups to understand if a group
needs its cache regenerated during a .set call
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).stateProperties`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L228)
+`createCollectionMixin( FabricObject, ).stateProperties`
***
@@ -2494,41 +1987,41 @@ needs its cache regenerated during a .set call
> `static` **type**: `string` = `'Group'`
+Defined in: [src/shapes/Group.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L118)
+
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
-
-add sustainable warning message
-
:::caution[Deprecated]
This API is no longer supported and may be removed in a future release.
:::
-#### Overrides
+#### TODO
-`createCollectionMixin(
- FabricObject,
- ).type`
+add sustainable warning message
-#### Defined in
+#### Overrides
-[src/shapes/Group.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L120)
+`createCollectionMixin( FabricObject, ).type`
## Accessors
### type
-> `get` **type**(): `string`
+#### Get Signature
+
+> **get** **type**(): `string`
+
+Defined in: [src/shapes/Object/Object.ts:354](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L354)
Legacy identifier of the class. Prefer using utils like isType or instanceOf
Will be removed in fabric 7 or 8.
The setter exists to avoid type errors in old code and possibly current deserialization code.
DO NOT build new code around this type value
-#### TODO
+##### TODO
add sustainable warning message
@@ -2536,25 +2029,29 @@ add sustainable warning message
This API is no longer supported and may be removed in a future release.
:::
-> `set` **type**(`value`): `void`
+##### Returns
-#### Parameters
+`string`
-• **value**: `string`
+#### Set Signature
-#### Returns
+> **set** **type**(`value`): `void`
+
+Defined in: [src/shapes/Object/Object.ts:362](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L362)
+
+##### Parameters
+
+###### value
`string`
-#### Inherited from
+##### Returns
-`createCollectionMixin(
- FabricObject,
- ).type`
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:357](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L357)
+[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#type-1)
## Methods
@@ -2562,66 +2059,61 @@ This API is no longer supported and may be removed in a future release.
> **\_drawClipPath**(`ctx`, `clipPath`, `context`): `void`
+Defined in: [src/shapes/Object/Object.ts:871](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L871)
+
Prepare clipPath state and cache and draw it on instance's cache
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
-• **clipPath**: `undefined` \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+`CanvasRenderingContext2D`
-• **context**: `DrawContext`
+##### clipPath
-#### Returns
+`undefined` | [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
-`void`
+##### context
-#### Inherited from
+[`DrawContext`](/api/type-aliases/drawcontext/)
+
+#### Returns
-`createCollectionMixin(
- FabricObject,
- )._drawClipPath`
+`void`
-#### Defined in
+#### Inherited from
-[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920)
+`createCollectionMixin( FabricObject, )._drawClipPath`
***
### \_limitCacheSize()
-> **\_limitCacheSize**(`dims`): `any`
+> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object`
+
+Defined in: [src/shapes/Object/Object.ts:397](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L397)
Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal
and each side do not cross fabric.cacheSideLimit
those numbers are configurable so that you can get as much detail as you want
making bargain with performances.
+It mutates the input object dims.
#### Parameters
-• **dims**: `any`
-
-#### Returns
-
-`any`
+##### dims
-.width width of canvas
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.height height of canvas
+#### Returns
-.zoomX zoomX zoom value to unscale the canvas before drawing cache
+[`TSize`](/api/type-aliases/tsize/) & `object` & `object`
-.zoomY zoomY zoom value to unscale the canvas before drawing cache
+dims
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._limitCacheSize`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L406)
+`createCollectionMixin( FabricObject, )._limitCacheSize`
***
@@ -2629,9 +2121,13 @@ making bargain with performances.
> **\_onObjectAdded**(`object`): `void`
+Defined in: [src/shapes/Group.ts:256](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L256)
+
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
#### Returns
@@ -2639,13 +2135,7 @@ making bargain with performances.
#### Overrides
-`createCollectionMixin(
- FabricObject,
- )._onObjectAdded`
-
-#### Defined in
-
-[src/shapes/Group.ts:258](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L258)
+`createCollectionMixin( FabricObject, )._onObjectAdded`
***
@@ -2653,19 +2143,15 @@ making bargain with performances.
> **\_onStackOrderChanged**(): `void`
+Defined in: [src/shapes/Group.ts:286](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L286)
+
#### Returns
`void`
#### Overrides
-`createCollectionMixin(
- FabricObject,
- )._onStackOrderChanged`
-
-#### Defined in
-
-[src/shapes/Group.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L288)
+`createCollectionMixin( FabricObject, )._onStackOrderChanged`
***
@@ -2673,6 +2159,8 @@ making bargain with performances.
> **\_removeCacheCanvas**(): `void`
+Defined in: [src/shapes/Object/Object.ts:707](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L707)
+
Remove cacheCanvas and its dimensions from the objects
#### Returns
@@ -2681,30 +2169,30 @@ Remove cacheCanvas and its dimensions from the objects
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._removeCacheCanvas`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:756](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L756)
+`createCollectionMixin( FabricObject, )._removeCacheCanvas`
***
### \_renderControls()
-> **\_renderControls**(`ctx`, `styleOverride`?): `void`
+> **\_renderControls**(`ctx`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L435)
Renders controls and borders for the object
the context here is not transformed
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
-• **styleOverride?**: `TStyleOverride` = `{}`
+##### styleOverride?
+
+`TStyleOverride` = `{}`
properties to override the object style
@@ -2718,13 +2206,7 @@ move to interactivity
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._renderControls`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435)
+`createCollectionMixin( FabricObject, )._renderControls`
***
@@ -2732,9 +2214,13 @@ move to interactivity
> **\_setClippingProperties**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1016](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1016)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
#### Returns
@@ -2742,13 +2228,7 @@ move to interactivity
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._setClippingProperties`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1062](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1062)
+`createCollectionMixin( FabricObject, )._setClippingProperties`
***
@@ -2756,11 +2236,17 @@ move to interactivity
> **\_setFillStyles**(`ctx`, `__namedParameters`): `void`
+Defined in: [src/shapes/Object/Object.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1005)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
+
+##### \_\_namedParameters
-• **\_\_namedParameters**: `Pick`\<[`Group`](/api/classes/group/), `"fill"`\>
+`Pick`\<`this`, `"fill"`\>
#### Returns
@@ -2768,13 +2254,7 @@ move to interactivity
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._setFillStyles`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1051)
+`createCollectionMixin( FabricObject, )._setFillStyles`
***
@@ -2782,11 +2262,17 @@ move to interactivity
> **\_setStrokeStyles**(`ctx`, `decl`): `void`
+Defined in: [src/shapes/Object/Object.ts:963](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L963)
+
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
-• **decl**: `Pick`\<[`Group`](/api/classes/group/), `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\>
+##### decl
+
+`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\>
#### Returns
@@ -2794,13 +2280,7 @@ move to interactivity
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._setStrokeStyles`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1009](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1009)
+`createCollectionMixin( FabricObject, )._setStrokeStyles`
***
@@ -2808,12 +2288,16 @@ move to interactivity
> **\_setupCompositeOperation**(`ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:1484](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1484)
+
Sets canvas globalCompositeOperation for specific object
custom composition operation for the particular object can be specified using globalCompositeOperation property
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Rendering canvas context
@@ -2823,25 +2307,23 @@ Rendering canvas context
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- )._setupCompositeOperation`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1518)
+`createCollectionMixin( FabricObject, )._setupCompositeOperation`
***
### \_toSVG()
-> **\_toSVG**(`reviver`?): `string`[]
+> **\_toSVG**(`reviver?`): `string`[]
+
+Defined in: [src/shapes/Group.ts:635](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L635)
Returns svg representation of an instance
#### Parameters
-• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/)
+##### reviver?
+
+[`TSVGReviver`](/api/type-aliases/tsvgreviver/)
Method for further parsing of svg representation.
@@ -2853,13 +2335,7 @@ svg representation of an instance
#### Overrides
-`createCollectionMixin(
- FabricObject,
- )._toSVG`
-
-#### Defined in
-
-[src/shapes/Group.ts:637](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L637)
+`createCollectionMixin( FabricObject, )._toSVG`
***
@@ -2867,11 +2343,15 @@ svg representation of an instance
> **add**(...`objects`): `number`
+Defined in: [src/shapes/Group.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L226)
+
Add objects
#### Parameters
-• ...**objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+##### objects
+
+...[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
#### Returns
@@ -2879,13 +2359,7 @@ Add objects
#### Overrides
-`createCollectionMixin(
- FabricObject,
- ).add`
-
-#### Defined in
-
-[src/shapes/Group.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L228)
+`createCollectionMixin( FabricObject, ).add`
***
@@ -2893,9 +2367,13 @@ Add objects
> **addPaintOrder**(`this`): `string`
+Defined in: [src/shapes/Object/FabricObjectSVGExportMixin.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/FabricObjectSVGExportMixin.ts#L250)
+
#### Parameters
-• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### this
+
+`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
#### Returns
@@ -2903,37 +2381,39 @@ Add objects
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).addPaintOrder`
-
-#### Defined in
-
-[src/shapes/Object/FabricObjectSVGExportMixin.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L249)
+`createCollectionMixin( FabricObject, ).addPaintOrder`
***
### animate()
-> **animate**\<`T`\>(`animatable`, `options`?): `Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+> **animate**\<`T`\>(`animatable`, `options?`): `Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+
+Defined in: [src/shapes/Object/Object.ts:1523](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1523)
Animates object's properties
#### Type Parameters
-• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
+##### T
+
+`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/)
#### Parameters
-• **animatable**: `Record`\<`string`, `T`\>
+##### animatable
+
+`Record`\<`string`, `T`\>
map of keys and end values
-• **options?**: `Partial`\<[`AnimationOptions`](/api/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
+##### options?
+
+`Partial`\<[`AnimationOptions`](/api/fabric/namespaces/util/type-aliases/animationoptions/)\<`T`\>\>
#### Returns
-`Record`\<`string`, [`TAnimation`](/api/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
+`Record`\<`string`, [`TAnimation`](/api/fabric/namespaces/util/type-aliases/tanimation/)\<`T`\>\>
map of animation contexts
@@ -2942,25 +2422,21 @@ As object — multiple properties
object.animate({ left: ..., top: ... });
object.animate({ left: ..., top: ... }, { duration: ... });
-#### Tutorial
+#### See
-[http://fabricjs.com/fabric-intro-part-2#animation](http://fabricjs.com/fabric-intro-part-2#animation)
+[http://fabric5.fabricjs.com/fabric-intro-part-2#animation](http://fabric5.fabricjs.com/fabric-intro-part-2#animation)
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).animate`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557)
+`createCollectionMixin( FabricObject, ).animate`
***
### bringObjectForward()
-> **bringObjectForward**(`object`, `intersecting`?): `boolean`
+> **bringObjectForward**(`object`, `intersecting?`): `boolean`
+
+Defined in: [src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L240)
Moves an object or a selection up in stack of drawn objects
An optional parameter, intersecting allows to move the object in front
@@ -2970,11 +2446,15 @@ stack.
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
-• **intersecting?**: `boolean`
+##### intersecting?
+
+`boolean`
If `true`, send object in front of next upper intersecting object
@@ -2986,13 +2466,7 @@ true if change occurred
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).bringObjectForward`
-
-#### Defined in
-
-[src/Collection.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L240)
+`createCollectionMixin( FabricObject, ).bringObjectForward`
***
@@ -3000,12 +2474,16 @@ true if change occurred
> **bringObjectToFront**(`object`): `boolean`
+Defined in: [src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L194)
+
Moves an object or the objects of a multiple selection
to the top of the stack of drawn objects
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to send
@@ -3017,13 +2495,7 @@ true if change occurred
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).bringObjectToFront`
-
-#### Defined in
-
-[src/Collection.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L194)
+`createCollectionMixin( FabricObject, ).bringObjectToFront`
***
@@ -3031,6 +2503,8 @@ true if change occurred
> **calcACoords**(): [`TCornerPoint`](/api/type-aliases/tcornerpoint/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L427)
+
Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates.
those never change with zoom or viewport changes.
@@ -3040,13 +2514,7 @@ those never change with zoom or viewport changes.
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).calcACoords`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L427)
+`createCollectionMixin( FabricObject, ).calcACoords`
***
@@ -3054,6 +2522,8 @@ those never change with zoom or viewport changes.
> **calcOCoords**(): `Record`\<`string`, `TOCoord`\>
+Defined in: [src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L255)
+
Calculates the coordinates of the center of each control plus the corners of the control itself
This basically just delegates to each control positionHandler
WARNING: changing what is passed to positionHandler is a breaking change, since position handler
@@ -3065,13 +2535,7 @@ is a public api and should be done just if extremely necessary
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).calcOCoords`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L255)
+`createCollectionMixin( FabricObject, ).calcOCoords`
***
@@ -3079,6 +2543,8 @@ is a public api and should be done just if extremely necessary
> **calcOwnMatrix**(): [`TMat2D`](/api/type-aliases/tmat2d/)
+Defined in: [src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L513)
+
calculate transform matrix that represents the current transformations from the
object's properties, this matrix does not include the group transformation
@@ -3090,26 +2556,24 @@ transform matrix for the object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).calcOwnMatrix`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:513](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L513)
+`createCollectionMixin( FabricObject, ).calcOwnMatrix`
***
### calcTransformMatrix()
-> **calcTransformMatrix**(`skipGroup`?): [`TMat2D`](/api/type-aliases/tmat2d/)
+> **calcTransformMatrix**(`skipGroup?`): [`TMat2D`](/api/type-aliases/tmat2d/)
+
+Defined in: [src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L485)
calculate transform matrix that represents the current transformations from the
object's properties.
#### Parameters
-• **skipGroup?**: `boolean` = `false`
+##### skipGroup?
+
+`boolean` = `false`
return transform matrix for object not counting parent transformations
There are some situation in which this is useful to avoid the fake rotation.
@@ -3122,13 +2586,7 @@ transform matrix for the object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).calcTransformMatrix`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:485](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L485)
+`createCollectionMixin( FabricObject, ).calcTransformMatrix`
***
@@ -3136,11 +2594,15 @@ transform matrix for the object
> **canDrop**(`_e`): `boolean`
+Defined in: [src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L701)
+
Override to customize drag and drop behavior
#### Parameters
-• **\_e**: `DragEvent`
+##### \_e
+
+`DragEvent`
#### Returns
@@ -3150,19 +2612,15 @@ true if the object currently dragged can be dropped on the target
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).canDrop`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:701](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L701)
+`createCollectionMixin( FabricObject, ).canDrop`
***
### clearContextTop()
-> **clearContextTop**(`restoreManually`?): `undefined` \| `CanvasRenderingContext2D`
+> **clearContextTop**(`restoreManually?`): `undefined` \| `CanvasRenderingContext2D`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L627)
Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box
that is in the canvas.contextContainer.
@@ -3171,7 +2629,9 @@ Example: blinking cursor text selection, drag effects.
#### Parameters
-• **restoreManually?**: `boolean`
+##### restoreManually?
+
+`boolean`
When true won't restore the context after clear, in order to draw something else.
@@ -3188,47 +2648,41 @@ discuss swapping restoreManually with a renderCallback, but think of async issue
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).clearContextTop`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:627](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L627)
+`createCollectionMixin( FabricObject, ).clearContextTop`
***
### clone()
-> **clone**(`propertiesToInclude`?): `Promise`\<[`Group`](/api/classes/group/)\>
+> **clone**(`propertiesToInclude?`): `Promise`\<`Group`\>
+
+Defined in: [src/shapes/Object/Object.ts:1242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1242)
Clones an instance.
#### Parameters
-• **propertiesToInclude?**: `string`[]
+##### propertiesToInclude?
+
+`string`[]
Any properties that you might want to additionally include in the output
#### Returns
-`Promise`\<[`Group`](/api/classes/group/)\>
+`Promise`\<`Group`\>
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).clone`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1292](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1292)
+`createCollectionMixin( FabricObject, ).clone`
***
### cloneAsImage()
-> **cloneAsImage**(`options`?): [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+> **cloneAsImage**(`options?`): [`FabricImage`](/api/classes/fabricimage/)
+
+Defined in: [src/shapes/Object/Object.ts:1268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1268)
Creates an instance of Image out of an object
makes use of toCanvasElement.
@@ -3239,13 +2693,15 @@ toCanvasElement and then toBlob from the obtained canvas is also a good option.
#### Parameters
-• **options?**: `ObjectToCanvasElementOptions`
+##### options?
+
+`ObjectToCanvasElementOptions`
for clone as image, passed to toDataURL
#### Returns
-[`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+[`FabricImage`](/api/classes/fabricimage/)
Object cloned as image.
@@ -3255,13 +2711,7 @@ fix the export type, it could not be Image but the type that getClass return for
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).cloneAsImage`
-
-#### Defined in
-
-[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318)
+`createCollectionMixin( FabricObject, ).cloneAsImage`
***
@@ -3269,21 +2719,27 @@ fix the export type, it could not be Image but the type that getClass return for
> **collectObjects**(`bbox`, `options`): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[]
+Defined in: [src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L326)
+
Given a bounding box, return all the objects of the collection that are contained in the bounding box.
If `includeIntersecting` is true, return also the objects that intersect the bounding box as well.
This is meant to work with selection. Is not a generic method.
#### Parameters
-• **bbox**: [`TBBox`](/api/type-aliases/tbbox/)
+##### bbox
+
+[`TBBox`](/api/type-aliases/tbbox/)
a bounding box in scene coordinates
-• **options** = `{}`
+##### options
an object with includeIntersecting
-• **options.includeIntersecting?**: `boolean` = `true`
+###### includeIntersecting?
+
+`boolean` = `true`
#### Returns
@@ -3293,13 +2749,7 @@ array of objects contained in the bounding box, ordered from top to bottom stack
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).collectObjects`
-
-#### Defined in
-
-[src/Collection.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L326)
+`createCollectionMixin( FabricObject, ).collectObjects`
***
@@ -3307,6 +2757,8 @@ array of objects contained in the bounding box, ordered from top to bottom stack
> **complexity**(): `number`
+Defined in: [src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L165)
+
#### Returns
`number`
@@ -3315,31 +2767,31 @@ complexity
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).complexity`
-
-#### Defined in
-
-[src/Collection.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L165)
+`createCollectionMixin( FabricObject, ).complexity`
***
### contains()
-> **contains**(`object`, `deep`?): `boolean`
+> **contains**(`object`, `deep?`): `boolean`
+
+Defined in: [src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L148)
Returns true if collection contains an object.\
-**Prefer using [FabricObject#isDescendantOf](../../../../api/classes/fabricobject/#isdescendantof) for performance reasons**
+**Prefer using [FabricObject#isDescendantOf](/api/classes/fabricobject/#isdescendantof) for performance reasons**
instead of `a.contains(b)` use `b.isDescendantOf(a)`
#### Parameters
-• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>
+##### object
+
+[`FabricObject`](/api/classes/fabricobject/)
Object to check against
-• **deep?**: `boolean`
+##### deep?
+
+`boolean`
`true` to check all descendants, `false` to check only `_objects`
@@ -3351,13 +2803,7 @@ Object to check against
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).contains`
-
-#### Defined in
-
-[src/Collection.ts:148](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L148)
+`createCollectionMixin( FabricObject, ).contains`
***
@@ -3365,11 +2811,15 @@ Object to check against
> **containsPoint**(`point`): `boolean`
+Defined in: [src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L282)
+
Checks if point is inside the object
#### Parameters
-• **point**: [`Point`](/api/classes/point/)
+##### point
+
+[`Point`](/api/classes/point/)
Point to check against
@@ -3381,13 +2831,7 @@ true if point is inside the object
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).containsPoint`
-
-#### Defined in
-
-[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282)
+`createCollectionMixin( FabricObject, ).containsPoint`
***
@@ -3395,6 +2839,8 @@ true if point is inside the object
> **dispose**(): `void`
+Defined in: [src/shapes/Group.ts:603](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L603)
+
cancel instance's running animations
override if necessary to dispose artifacts such as `clipPath`
@@ -3404,19 +2850,15 @@ override if necessary to dispose artifacts such as `clipPath`
#### Overrides
-`createCollectionMixin(
- FabricObject,
- ).dispose`
-
-#### Defined in
-
-[src/shapes/Group.ts:605](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L605)
+`createCollectionMixin( FabricObject, ).dispose`
***
### drawBorders()
-> **drawBorders**(`ctx`, `options`, `styleOverride`?): `void`
+> **drawBorders**(`ctx`, `options`, `styleOverride?`): `void`
+
+Defined in: [src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L478)
Draws borders of an object's bounding box.
Requires public properties: width, height
@@ -3424,15 +2866,21 @@ Requires public options: padding, borderColor
#### Parameters
-• **ctx**: `CanvasRenderingContext2D`
+##### ctx
+
+`CanvasRenderingContext2D`
Context to draw on
-• **options**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\>
+##### options
+
+[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/)
object representing current object parameters
-• **styleOverride?**: `TStyleOverride`
+##### styleOverride?
+
+`TStyleOverride`
object to override the object style
@@ -3442,13 +2890,7 @@ object to override the object style
#### Inherited from
-`createCollectionMixin(
- FabricObject,
- ).drawBorders`
-
-#### Defined in
-
-[src/shapes/Object/InteractiveObject.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L478)
+`createCollectionMixin( FabricObject, ).drawBorders`
***
@@ -3456,13 +2898,19 @@ object to override the object style
> **drawCacheOnCanvas**(`this`, `ctx`): `void`
+Defined in: [src/shapes/Object/Object.ts:893](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L893)
+
Paint the cached copy of the object on the target context.
#### Parameters
-• **this**: `TCachedFabricObject`\<[`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>
+##### this
-• **ctx**: `CanvasRenderingContext2D`
+`TCachedFabricObject`
+
+##### ctx
+
+`CanvasRenderingContext2D`
Context to render on
@@ -3472,13 +2920,7 @@ Context to render on
#### Inherited from
-`createCollectionMixin(
- FabricObject