diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 322e6c936..255708a8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,11 +15,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout your repository using git - uses: actions/checkout@v4 + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4 with: submodules: true - name: Install, build, and upload your site - uses: withastro/action@v2 + uses: withastro/action@a4407e937037e68022f04ae1c068d3634f08bc8d # v4.2.1 + with: + node-version: 24 # with: # path: . # The root location of your Astro project inside the repository. (optional) # node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 079477fec..b4c3fa294 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,11 +19,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout your repository using git - uses: actions/checkout@v4 + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4 with: submodules: true - name: Install, build, and upload your site - uses: withastro/action@v2 + uses: withastro/action@a4407e937037e68022f04ae1c068d3634f08bc8d # v4.2.1 + with: + node-version: 24 # with: # path: . # The root location of your Astro project inside the repository. (optional) # node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional) @@ -38,4 +40,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..4d4d5e6d4 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ + node_modules + dist \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..c351c0a2c --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "semi": true, + "singleQuote": true, + "tabWidth": 2 + } diff --git a/astro.config.mjs b/astro.config.mjs index 07db40166..8297363b1 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,13 +2,22 @@ import { defineConfig } from 'astro/config'; import react from "@astrojs/react"; import starlight from "@astrojs/starlight"; import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc'; +import fs from 'node:fs' + +import sitemap from '@astrojs/sitemap'; // https://astro.build/config export default defineConfig({ + site: 'https://fabricjs.com', + redirects: { + '/kitchensink': 'https://fabric5.fabricjs.com/kitchensink', + '/fabric-object-caching': '/docs/fabric-object-caching', + '/docs/old-docs/fabric-object-caching': '/docs/fabric-object-caching', + }, integrations: [starlight({ favicon: '/favicon.ico', title: 'Docs and Guides', - disable404Route: true, + disable404Route: true, logo: { src: './src/assets/logo.svg', }, @@ -29,26 +38,33 @@ export default defineConfig({ collapsed: true, autogenerate: { directory: 'api' }, }, + { + label: 'Fabric.js v5', + link: 'https://fabric5.fabricjs.com/docs', + } ], customCss: [ // Relative path to your custom CSS file './src/layouts/colorvars.css', ], plugins: [ - // Generate the documentation. - starlightTypeDoc({ - entryPoints: ['./fabric.js/fabric.ts'], - tsconfig: './fabric.js/typedoc.config.json', - typeDoc: { - plugin: ['typedoc-plugin-no-inherit'], - readme: 'none', - gitRemote: 'https://github.com/fabricjs/fabric.js/blob', - entryFileName: 'index.md', - includeVersion: true, - sourceLinkExternal: true, - sourceLinkTemplate: 'https://github.com/fabricjs/fabric.js/blob/{gitRevision}/{path}#L{line}', - }, - }), - ], - }), react()], + // Generate the documentation only if local sources exist. + // This avoids dev crashes when `fabric.js` sources are not checked out. + (fs.existsSync(new URL('./fabric.js/fabric.ts', import.meta.url)) && + fs.existsSync(new URL('./fabric.js/typedoc.config.json', import.meta.url))) && + starlightTypeDoc({ + entryPoints: ['./fabric.js/fabric.ts'], + tsconfig: './fabric.js/typedoc.config.json', + typeDoc: { + plugin: ['typedoc-plugin-no-inherit'], + readme: 'none', + gitRemote: 'https://github.com/fabricjs/fabric.js/blob', + entryFileName: 'index.md', + includeVersion: true, + sourceLinkExternal: true, + sourceLinkTemplate: 'https://github.com/fabricjs/fabric.js/blob/{gitRevision}/{path}#L{line}', + }, + }), + ].filter(Boolean), + }), react(), sitemap()], }); \ No newline at end of file diff --git a/fabric.js b/fabric.js index 5c1240d8b..9a792f4b7 160000 --- a/fabric.js +++ b/fabric.js @@ -1 +1 @@ -Subproject commit 5c1240d8b4662e45868dd33f385f941de21c8e9c +Subproject commit 9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec diff --git a/package-lock.json b/package-lock.json index 5c615fb21..5a03bf85c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,51 +8,62 @@ "name": "fabric-astro-7", "version": "0.0.1", "dependencies": { - "@astrojs/check": "^0.9.4", - "@astrojs/mdx": "^3.1.9", - "@astrojs/react": "^3.6.2", - "@astrojs/starlight": "^0.29.0", + "@astrojs/check": "^0.9.5", + "@astrojs/mdx": "^4.3.10", + "@astrojs/react": "^4.4.2", + "@astrojs/sitemap": "^3.6.0", + "@astrojs/starlight": "^0.36.2", "@codemirror/lang-javascript": "^6.2.2", "@codemirror/state": "^6.4.1", "@types/jsdom": "^21.1.6", - "@types/react": "^18.2.65", - "@types/react-dom": "^18.2.22", - "astro": "^4.16.10", + "@types/node": "^24.3.0", + "@types/react": "^18.x", + "@types/react-dom": "^18.x", + "astro": "^5.15.8", + "canvas": "^3.2.0", "codemirror": "^6.0.1", - "fabric": "^6.4.3", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-helmet": "^6.1.0", - "react-load-script": "^0.0.6", + "fabric": "^6.9.0", + "jsdom": "^26.1.0", + "prettier": "^3.4.2", + "react": "19.2", + "react-dom": "19.2", + "starlight-typedoc": "^0.21.4", "thememirror": "^2.0.1", - "typedoc": "^0.26.2", - "typedoc-plugin-markdown": "^4.1.1", - "typedoc-plugin-no-inherit": "^1.4.0", + "typedoc-plugin-no-inherit": "^1.6.1", "typescript": "^5.4.2" }, "devDependencies": { - "starlight-typedoc": "^0.17.0" + "typedoc": "^0.28.11", + "typedoc-plugin-markdown": "^4.7.0" }, "engines": { - "node": "^18.17.1 || ^20.3.0" + "node": "^20.3.0 || ^22.16.0 || ^24.8.0" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "license": "MIT", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" } }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/@astrojs/check": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.9.4.tgz", - "integrity": "sha512-IOheHwCtpUfvogHHsvu0AbeRZEnjJg3MopdLddkJE70mULItS/Vh37BHcI00mcOJcH1vhD3odbpvWokpxam7xA==", + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.9.5.tgz", + "integrity": "sha512-88vc8n2eJ1Oua74yXSGo/8ABMeypfQPGEzuoAx2awL9Ju8cE6tZ2Rz9jVx5hIExHK5gKVhpxfZj4WXm7e32g1w==", + "license": "MIT", "dependencies": { "@astrojs/language-server": "^2.15.0", "chokidar": "^4.0.1", @@ -67,14 +78,16 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.3.tgz", - "integrity": "sha512-bL/O7YBxsFt55YHU021oL+xz+B/9HvGNId3F9xURN16aeqDK9juHGktdkCSXz+U4nqFACq6ZFvWomOzhV+zfPw==" + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.13.0.tgz", + "integrity": "sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw==", + "license": "MIT" }, "node_modules/@astrojs/internal-helpers": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.4.1.tgz", - "integrity": "sha512-bMf9jFihO8YP940uD70SI/RDzIhUHJAolWVcO1v5PUivxGKvfLZTLTVVxEYzGYyPsA3ivdLNqMnL5VgmQySa+g==" + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.7.4.tgz", + "integrity": "sha512-lDA9MqE8WGi7T/t2BMi+EAXhs4Vcvr94Gqx3q15cFEz8oFZMO4/SFBqYr/UcmNlvW+35alowkVj+w9VhLvs5Cw==", + "license": "MIT" }, "node_modules/@astrojs/language-server": { "version": "2.15.4", @@ -117,23 +130,27 @@ } }, "node_modules/@astrojs/markdown-remark": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-5.3.0.tgz", - "integrity": "sha512-r0Ikqr0e6ozPb5bvhup1qdWnSPUvQu6tub4ZLYaKyG50BXZ0ej6FhGz3GpChKpH7kglRFPObJd/bDyf2VM9pkg==", + "version": "6.3.8", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-6.3.8.tgz", + "integrity": "sha512-uFNyFWadnULWK2cOw4n0hLKeu+xaVWeuECdP10cQ3K2fkybtTlhb7J7TcScdjmS8Yps7oje9S/ehYMfZrhrgCg==", + "license": "MIT", "dependencies": { - "@astrojs/prism": "3.1.0", + "@astrojs/internal-helpers": "0.7.4", + "@astrojs/prism": "3.3.0", "github-slugger": "^2.0.0", "hast-util-from-html": "^2.0.3", "hast-util-to-text": "^4.0.2", - "import-meta-resolve": "^4.1.0", + "import-meta-resolve": "^4.2.0", + "js-yaml": "^4.1.0", "mdast-util-definitions": "^6.0.0", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.1", - "remark-gfm": "^4.0.0", + "remark-gfm": "^4.0.1", "remark-parse": "^11.0.0", - "remark-rehype": "^11.1.1", + "remark-rehype": "^11.1.2", "remark-smartypants": "^3.0.2", - "shiki": "^1.22.0", + "shiki": "^3.13.0", + "smol-toml": "^1.4.2", "unified": "^11.0.5", "unist-util-remove-position": "^5.0.0", "unist-util-visit": "^5.0.0", @@ -142,90 +159,98 @@ } }, "node_modules/@astrojs/mdx": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-3.1.9.tgz", - "integrity": "sha512-3jPD4Bff6lIA20RQoonnZkRtZ9T3i0HFm6fcDF7BMsKIZ+xBP2KXzQWiuGu62lrVCmU612N+SQVGl5e0fI+zWg==", - "dependencies": { - "@astrojs/markdown-remark": "5.3.0", - "@mdx-js/mdx": "^3.1.0", - "acorn": "^8.14.0", - "es-module-lexer": "^1.5.4", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-4.3.10.tgz", + "integrity": "sha512-2T5+XIr7PMqMeXhRofXY5NlY4lA0Km+wkfsqmr9lq5KXUHpGlKPQ9dlDZJP9E/CtljJyEBNS17zq66LrIJ1tiQ==", + "license": "MIT", + "dependencies": { + "@astrojs/markdown-remark": "6.3.8", + "@mdx-js/mdx": "^3.1.1", + "acorn": "^8.15.0", + "es-module-lexer": "^1.7.0", "estree-util-visit": "^2.0.0", - "gray-matter": "^4.0.3", - "hast-util-to-html": "^9.0.3", - "kleur": "^4.1.5", + "hast-util-to-html": "^9.0.5", + "picocolors": "^1.1.1", "rehype-raw": "^7.0.0", - "remark-gfm": "^4.0.0", + "remark-gfm": "^4.0.1", "remark-smartypants": "^3.0.2", - "source-map": "^0.7.4", + "source-map": "^0.7.6", "unist-util-visit": "^5.0.0", "vfile": "^6.0.3" }, "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0" + "node": "18.20.8 || ^20.3.0 || >=22.0.0" }, "peerDependencies": { - "astro": "^4.8.0" + "astro": "^5.0.0" } }, "node_modules/@astrojs/mdx/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "license": "BSD-3-Clause", "engines": { - "node": ">= 8" + "node": ">= 12" } }, "node_modules/@astrojs/prism": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.1.0.tgz", - "integrity": "sha512-Z9IYjuXSArkAUx3N6xj6+Bnvx8OdUSHA8YoOgyepp3+zJmtVYJIl/I18GozdJVW1p5u/CNpl3Km7/gwTJK85cw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.3.0.tgz", + "integrity": "sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==", + "license": "MIT", "dependencies": { - "prismjs": "^1.29.0" + "prismjs": "^1.30.0" }, "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0" + "node": "18.20.8 || ^20.3.0 || >=22.0.0" } }, "node_modules/@astrojs/react": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.6.2.tgz", - "integrity": "sha512-fK29lYI7zK/KG4ZBy956x4dmauZcZ18osFkuyGa8r3gmmCQa2NZ9XNu9WaVYEUm0j89f4Gii4tbxLoyM8nk2MA==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-4.4.2.tgz", + "integrity": "sha512-1tl95bpGfuaDMDn8O3x/5Dxii1HPvzjvpL2YTuqOOrQehs60I2DKiDgh1jrKc7G8lv+LQT5H15V6QONQ+9waeQ==", + "license": "MIT", "dependencies": { - "@vitejs/plugin-react": "^4.3.1", - "ultrahtml": "^1.5.3" + "@vitejs/plugin-react": "^4.7.0", + "ultrahtml": "^1.6.0", + "vite": "^6.4.1" }, "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0" + "node": "18.20.8 || ^20.3.0 || >=22.0.0" }, "peerDependencies": { - "@types/react": "^17.0.50 || ^18.0.21", - "@types/react-dom": "^17.0.17 || ^18.0.6", - "react": "^17.0.2 || ^18.0.0 || ^19.0.0-beta", - "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0-beta" + "@types/react": "^17.0.50 || ^18.0.21 || ^19.0.0", + "@types/react-dom": "^17.0.17 || ^18.0.6 || ^19.0.0", + "react": "^17.0.2 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0" } }, "node_modules/@astrojs/sitemap": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.1.6.tgz", - "integrity": "sha512-1Qp2NvAzVImqA6y+LubKi1DVhve/hXXgFvB0szxiipzh7BvtuKe4oJJ9dXSqaubaTkt4nMa6dv6RCCAYeB6xaQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.6.0.tgz", + "integrity": "sha512-4aHkvcOZBWJigRmMIAJwRQXBS+ayoP5z40OklTXYXhUDhwusz+DyDl+nSshY6y9DvkVEavwNcFO8FD81iGhXjg==", + "license": "MIT", "dependencies": { - "sitemap": "^7.1.2", + "sitemap": "^8.0.0", "stream-replace-string": "^2.0.0", - "zod": "^3.23.8" + "zod": "^3.25.76" } }, "node_modules/@astrojs/starlight": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.29.0.tgz", - "integrity": "sha512-0HRr7LiI0XJUA5n0Mj5LPSLZtw80ttkL6eh824y6t/DCcvJzC6e+HRQZ0hIolU8jsEMc7Qs07mMQIvPTpX9KMg==", + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.36.2.tgz", + "integrity": "sha512-QR8NfO7+7DR13kBikhQwAj3IAoptLLNs9DkyKko2M2l3PrqpcpVUnw1JBJ0msGDIwE6tBbua2UeBND48mkh03w==", + "license": "MIT", "dependencies": { - "@astrojs/mdx": "^3.1.3", - "@astrojs/sitemap": "^3.1.6", - "@pagefind/default-ui": "^1.0.3", + "@astrojs/markdown-remark": "^6.3.1", + "@astrojs/mdx": "^4.2.3", + "@astrojs/sitemap": "^3.3.0", + "@pagefind/default-ui": "^1.3.0", "@types/hast": "^3.0.4", + "@types/js-yaml": "^4.0.9", "@types/mdast": "^4.0.4", - "astro-expressive-code": "^0.38.3", + "astro-expressive-code": "^0.41.1", "bcp-47": "^2.1.0", "hast-util-from-html": "^2.0.1", "hast-util-select": "^6.0.2", @@ -233,19 +258,21 @@ "hastscript": "^9.0.0", "i18next": "^23.11.5", "js-yaml": "^4.1.0", + "klona": "^2.0.6", "mdast-util-directive": "^3.0.0", "mdast-util-to-markdown": "^2.1.0", "mdast-util-to-string": "^4.0.0", - "pagefind": "^1.0.3", + "pagefind": "^1.3.0", "rehype": "^13.0.1", "rehype-format": "^5.0.0", "remark-directive": "^3.0.0", + "ultrahtml": "^1.6.0", "unified": "^11.0.5", "unist-util-visit": "^5.0.0", "vfile": "^6.0.2" }, "peerDependencies": { - "astro": "^4.14.0" + "astro": "^5.5.0" } }, "node_modules/@astrojs/starlight/node_modules/hastscript": { @@ -265,20 +292,21 @@ } }, "node_modules/@astrojs/telemetry": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.1.0.tgz", - "integrity": "sha512-/ca/+D8MIKEC8/A9cSaPUqQNZm+Es/ZinRv0ZAzvu2ios7POQSsVD+VOj7/hypWNsNM3T7RpfgNq7H2TU1KEHA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.0.tgz", + "integrity": "sha512-UFBgfeldP06qu6khs/yY+q1cDAaArM2/7AEIqQ9Cuvf7B1hNLq0xDrZkct+QoIGyjq56y8IaE2I3CTvG99mlhQ==", + "license": "MIT", "dependencies": { - "ci-info": "^4.0.0", - "debug": "^4.3.4", + "ci-info": "^4.2.0", + "debug": "^4.4.0", "dlv": "^1.1.3", - "dset": "^3.1.3", + "dset": "^3.1.4", "is-docker": "^3.0.0", - "is-wsl": "^3.0.0", + "is-wsl": "^3.1.0", "which-pm-runs": "^1.1.0" }, "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0" + "node": "18.20.8 || ^20.3.0 || >=22.0.0" } }, "node_modules/@astrojs/yaml2ts": { @@ -290,41 +318,45 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", - "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", - "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", - "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -343,43 +375,35 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", - "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", - "dependencies": { - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", - "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.9", - "@babel/helper-validator-option": "^7.25.9", + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -392,30 +416,42 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", - "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", - "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" }, "engines": { "node": ">=6.9.0" @@ -425,55 +461,61 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", - "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", - "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "license": "MIT", "dependencies": { - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.28.5" }, "bin": { "parser": "bin/babel-parser.js" @@ -482,44 +524,13 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", - "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.9.tgz", - "integrity": "sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-module-imports": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", - "@babel/plugin-syntax-jsx": "^7.25.9", - "@babel/types": "^7.25.9" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.7.tgz", - "integrity": "sha512-fOPQYbGSgH0HUp4UJO4sMBFjY6DuWq+2i8rixyUMb3CdGixs/gccURvYOAhajBdKDoGajFr3mUq5rH3phtkGzw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -529,11 +540,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.7.tgz", - "integrity": "sha512-J2z+MWzZHVOemyLweMqngXrgGC42jQ//R0KdxqkIz/OrbVIIlhFI3WigZ5fO+nwFvBlncr4MGapd8vTyc7RPNQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -543,58 +555,71 @@ } }, "node_modules/@babel/runtime": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", - "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.9", - "@babel/helper-validator-identifier": "^7.25.9" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@capsizecss/unpack": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@capsizecss/unpack/-/unpack-3.0.0.tgz", + "integrity": "sha512-+ntATQe1AlL7nTOYjwjj6w3299CgRot48wL761TUGYpYgAou3AaONZazp0PKZyCyWhudWsjhq1nvRHOvbMzhTA==", + "license": "MIT", + "dependencies": { + "fontkit": "^2.0.2" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@codemirror/autocomplete": { "version": "6.15.0", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.15.0.tgz", @@ -641,6 +666,7 @@ "version": "6.10.1", "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.1.tgz", "integrity": "sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==", + "peer": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", @@ -673,18 +699,132 @@ "node_modules/@codemirror/state": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", - "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==" + "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==", + "peer": true }, "node_modules/@codemirror/view": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.26.0.tgz", "integrity": "sha512-nSSmzONpqsNzshPOxiKhK203R6BvABepugAe34QfQDbNDslyjkqBuKgrK5ZBvqNXpfxz5iLrlGTmEfhbQyH46A==", + "peer": true, "dependencies": { "@codemirror/state": "^6.4.0", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@ctrl/tinycolor": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.1.0.tgz", @@ -742,18 +882,19 @@ "integrity": "sha512-ZsZ2I9Vzso3Ho/pjZFsmmZ++FWeEd/txqybHTm4OgaZzdS8V9V/YYWQwg5TC38Z7uLWUV1vavpLLbjJtKubR1A==" }, "node_modules/@emnapi/runtime": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.1.1.tgz", - "integrity": "sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", + "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==", + "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", + "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", "cpu": [ "ppc64" ], @@ -762,13 +903,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", + "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", "cpu": [ "arm" ], @@ -777,13 +918,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", + "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", "cpu": [ "arm64" ], @@ -792,13 +933,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", + "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", "cpu": [ "x64" ], @@ -807,13 +948,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", + "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", "cpu": [ "arm64" ], @@ -822,13 +963,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", + "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", "cpu": [ "x64" ], @@ -837,13 +978,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", + "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", "cpu": [ "arm64" ], @@ -852,13 +993,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", + "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", "cpu": [ "x64" ], @@ -867,13 +1008,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", + "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", "cpu": [ "arm" ], @@ -882,13 +1023,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", + "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", "cpu": [ "arm64" ], @@ -897,13 +1038,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", + "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", "cpu": [ "ia32" ], @@ -912,13 +1053,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", + "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", "cpu": [ "loong64" ], @@ -927,13 +1068,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", + "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", "cpu": [ "mips64el" ], @@ -942,13 +1083,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", + "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", "cpu": [ "ppc64" ], @@ -957,13 +1098,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", + "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", "cpu": [ "riscv64" ], @@ -972,13 +1113,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", + "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", "cpu": [ "s390x" ], @@ -987,13 +1128,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", + "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", "cpu": [ "x64" ], @@ -1002,13 +1143,28 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", + "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", + "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", "cpu": [ "x64" ], @@ -1017,13 +1173,28 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", + "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", + "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", "cpu": [ "x64" ], @@ -1032,13 +1203,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", + "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", "cpu": [ "x64" ], @@ -1047,13 +1218,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", + "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", "cpu": [ "arm64" ], @@ -1062,13 +1233,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", + "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", "cpu": [ "ia32" ], @@ -1077,13 +1248,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", + "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", "cpu": [ "x64" ], @@ -1092,13 +1263,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@expressive-code/core": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.38.3.tgz", - "integrity": "sha512-s0/OtdRpBONwcn23O8nVwDNQqpBGKscysejkeBkwlIeHRLZWgiTVrusT5Idrdz1d8cW5wRk9iGsAIQmwDPXgJg==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.1.tgz", + "integrity": "sha512-mG2IrN4t/NGPmEeeswmttsW7W7c96sz3ASjo1psQnOqU5QWAF61HpnBu3lPxHI8iQJyZI8wfAroo9FFpwlkvAQ==", "dependencies": { "@ctrl/tinycolor": "^4.0.4", "hast-util-select": "^6.0.2", @@ -1112,14 +1283,14 @@ } }, "node_modules/@expressive-code/core/node_modules/hastscript": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.0.tgz", - "integrity": "sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz", + "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==", "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" }, "funding": { @@ -1127,500 +1298,521 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/@expressive-code/plugin-frames": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.38.3.tgz", - "integrity": "sha512-qL2oC6FplmHNQfZ8ZkTR64/wKo9x0c8uP2WDftR/ydwN/yhe1ed7ZWYb8r3dezxsls+tDokCnN4zYR594jbpvg==", - "dependencies": { - "@expressive-code/core": "^0.38.3" + "node_modules/@expressive-code/core/node_modules/property-information": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", + "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/@expressive-code/plugin-frames": { + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.41.1.tgz", + "integrity": "sha512-cwUUWMr2jNpKpgiepEzM9BGnU60WepE5/Ar3H2aOn8IzcDa4Eeuk0JqQB1Vvpo0bu+VRIxaTA2njoAIeQuMN5w==", + "dependencies": { + "@expressive-code/core": "^0.41.1" } }, "node_modules/@expressive-code/plugin-shiki": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.38.3.tgz", - "integrity": "sha512-kqHnglZeesqG3UKrb6e9Fq5W36AZ05Y9tCREmSN2lw8LVTqENIeCIkLDdWtQ5VoHlKqwUEQFTVlRehdwoY7Gmw==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.41.1.tgz", + "integrity": "sha512-xJHk89ECxQpvf7ftTmtEfAKoApYYr5Um7d6fiE6GuY7+WuXN02+ZHH8r5pSJpxlQMfAmavqbNPd3dEJ9v/zHnQ==", "dependencies": { - "@expressive-code/core": "^0.38.3", - "shiki": "^1.22.2" + "@expressive-code/core": "^0.41.1", + "shiki": "^3.2.2" } }, "node_modules/@expressive-code/plugin-text-markers": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.38.3.tgz", - "integrity": "sha512-dPK3+BVGTbTmGQGU3Fkj3jZ3OltWUAlxetMHI6limUGCWBCucZiwoZeFM/WmqQa71GyKRzhBT+iEov6kkz2xVA==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.41.1.tgz", + "integrity": "sha512-PFvk91yY+H8KVEcyZSrktLoWzBgLVpowvMxOJooFn74roGxnU4TEBJpWcRnJFtMEwTLzWNnk10MSOApOccvSKg==", "dependencies": { - "@expressive-code/core": "^0.38.3" + "@expressive-code/core": "^0.41.1" + } + }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.11.0.tgz", + "integrity": "sha512-ooCDMAOKv71O7MszbXjSQGcI6K5T6NKlemQZOBHLq7Sv/oXCRfYbZ7UgbzFdl20lSXju6Juds4I3y30R6rHA4Q==", + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.11.0", + "@shikijs/langs": "^3.11.0", + "@shikijs/themes": "^3.11.0", + "@shikijs/types": "^3.11.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.4.tgz", - "integrity": "sha512-p0suNqXufJs9t3RqLBO6vvrgr5OhgbWp76s5gTRvdmxmuv9E1rcaqGUsl3l4mKVmXPkTkTErXediAui4x+8PSA==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz", + "integrity": "sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.2" + "@img/sharp-libvips-darwin-arm64": "1.2.3" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.4.tgz", - "integrity": "sha512-0l7yRObwtTi82Z6ebVI2PnHT8EB2NxBgpK2MiKJZJ7cz32R4lxd001ecMhzzsZig3Yv9oclvqqdV93jo9hy+Dw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.4.tgz", + "integrity": "sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.2" + "@img/sharp-libvips-darwin-x64": "1.2.3" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.2.tgz", - "integrity": "sha512-tcK/41Rq8IKlSaKRCCAuuY3lDJjQnYIW1UXU1kxcEKrfL8WR7N6+rzNoOxoQRJWTAECuKwgAHnPvqXGN8XfkHA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.3.tgz", + "integrity": "sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" ], - "engines": { - "macos": ">=11", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.2.tgz", - "integrity": "sha512-Ofw+7oaWa0HiiMiKWqqaZbaYV3/UGL2wAPeLuJTx+9cXpCRdvQhCLG0IH8YGwM0yGWGLpsF4Su9vM1o6aer+Fw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.3.tgz", + "integrity": "sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" ], - "engines": { - "macos": ">=10.13", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.2.tgz", - "integrity": "sha512-iLWCvrKgeFoglQxdEwzu1eQV04o8YeYGFXtfWU26Zr2wWT3q3MTzC+QTCO3ZQfWd3doKHT4Pm2kRmLbupT+sZw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.3.tgz", + "integrity": "sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==", "cpu": [ "arm" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.2.tgz", - "integrity": "sha512-x7kCt3N00ofFmmkkdshwj3vGPCnmiDh7Gwnd4nUwZln2YjqPxV1NlTyZOvoDWdKQVDL911487HOueBvrpflagw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.3.tgz", + "integrity": "sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.3.tgz", + "integrity": "sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.2.tgz", - "integrity": "sha512-cmhQ1J4qVhfmS6szYW7RT+gLJq9dH2i4maq+qyXayUSn9/3iY2ZeWpbAgSpSVbV2E1JUL2Gg7pwnYQ1h8rQIog==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.3.tgz", + "integrity": "sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==", "cpu": [ "s390x" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.2.tgz", - "integrity": "sha512-E441q4Qdb+7yuyiADVi5J+44x8ctlrqn8XgkDTwr4qPJzWkaHwD489iZ4nGDgcuya4iMN3ULV6NwbhRZJ9Z7SQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.3.tgz", + "integrity": "sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.2.tgz", - "integrity": "sha512-3CAkndNpYUrlDqkCM5qhksfE+qSIREVpyoeHIU6jd48SJZViAmznoQQLAv4hVXF7xyUB9zf+G++e2v1ABjCbEQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.3.tgz", + "integrity": "sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.2.tgz", - "integrity": "sha512-VI94Q6khIHqHWNOh6LLdm9s2Ry4zdjWJwH56WoiJU7NTeDwyApdZZ8c+SADC8OH98KWNQXnE01UdJ9CSfZvwZw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.3.tgz", + "integrity": "sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.4.tgz", - "integrity": "sha512-RUgBD1c0+gCYZGCCe6mMdTiOFS0Zc/XrN0fYd6hISIKcDUbAW5NtSQW9g/powkrXYm6Vzwd6y+fqmExDuCdHNQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.4.tgz", + "integrity": "sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==", "cpu": [ "arm" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "glibc": ">=2.28", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.2" + "@img/sharp-libvips-linux-arm": "1.2.3" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.4.tgz", - "integrity": "sha512-2800clwVg1ZQtxwSoTlHvtm9ObgAax7V6MTAB/hDT945Tfyy3hVkmiHpeLPCKYqYR1Gcmv1uDZ3a4OFwkdBL7Q==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.4.tgz", + "integrity": "sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.3" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.4.tgz", + "integrity": "sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.2" + "@img/sharp-libvips-linux-ppc64": "1.2.3" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.4.tgz", - "integrity": "sha512-h3RAL3siQoyzSoH36tUeS0PDmb5wINKGYzcLB5C6DIiAn2F3udeFAum+gj8IbA/82+8RGCTn7XW8WTFnqag4tQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.4.tgz", + "integrity": "sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==", "cpu": [ "s390x" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "glibc": ">=2.31", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.2" + "@img/sharp-libvips-linux-s390x": "1.2.3" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.4.tgz", - "integrity": "sha512-GoR++s0XW9DGVi8SUGQ/U4AeIzLdNjHka6jidVwapQ/JebGVQIpi52OdyxCNVRE++n1FCLzjDovJNozif7w/Aw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.4.tgz", + "integrity": "sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.0.2" + "@img/sharp-libvips-linux-x64": "1.2.3" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.4.tgz", - "integrity": "sha512-nhr1yC3BlVrKDTl6cO12gTpXMl4ITBUZieehFvMntlCXFzH2bvKG76tBL2Y/OqhupZt81pR7R+Q5YhJxW0rGgQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.4.tgz", + "integrity": "sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.2" + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.4.tgz", - "integrity": "sha512-uCPTku0zwqDmZEOi4ILyGdmW76tH7dm8kKlOIV1XC5cLyJ71ENAAqarOHQh0RLfpIpbV5KOpXzdU6XkJtS0daw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.4.tgz", + "integrity": "sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.2" + "@img/sharp-libvips-linuxmusl-x64": "1.2.3" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.4.tgz", - "integrity": "sha512-Bmmauh4sXUsUqkleQahpdNXKvo+wa1V9KhT2pDA4VJGKwnKMJXiSTGphn0gnJrlooda0QxCtXc6RX1XAU6hMnQ==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.4.tgz", + "integrity": "sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==", "cpu": [ "wasm32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.1.1" + "@emnapi/runtime": "^1.5.0" }, "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.4.tgz", + "integrity": "sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.4.tgz", - "integrity": "sha512-99SJ91XzUhYHbx7uhK3+9Lf7+LjwMGQZMDlO/E/YVJ7Nc3lyDFZPGhjwiYdctoH2BOzW9+TnfqcaMKt0jHLdqw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.4.tgz", + "integrity": "sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==", "cpu": [ "ia32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.4.tgz", - "integrity": "sha512-3QLocdTRVIrFNye5YocZl+KKpYKP+fksi1QhmOArgx7GyhIbQp/WrJRu176jm8IxromS7RIkzMiMINVdBtC8Aw==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.4.tgz", + "integrity": "sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==", "cpu": [ "x64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -1661,6 +1853,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", "optional": true, "dependencies": { "detect-libc": "^2.0.0", @@ -1678,14 +1871,16 @@ } }, "node_modules/@mdx-js/mdx": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz", - "integrity": "sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz", + "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdx": "^2.0.0", + "acorn": "^8.0.0", "collapse-white-space": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", @@ -1713,11 +1908,12 @@ } }, "node_modules/@mdx-js/mdx/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "license": "BSD-3-Clause", "engines": { - "node": ">= 8" + "node": ">= 12" } }, "node_modules/@nodelib/fs.scandir": { @@ -1759,80 +1955,81 @@ "license": "MIT" }, "node_modules/@pagefind/darwin-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.1.1.tgz", - "integrity": "sha512-tZ9tysUmQpFs2EqWG2+E1gc+opDAhSyZSsgKmFzhnWfkK02YHZhvL5XJXEZDqYy3s1FAKhwjTg8XDxneuBlDZQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.3.0.tgz", + "integrity": "sha512-365BEGl6ChOsauRjyVpBjXybflXAOvoMROw3TucAROHIcdBvXk9/2AmEvGFU0r75+vdQI4LJdJdpH4Y6Yqaj4A==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@pagefind/darwin-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.1.1.tgz", - "integrity": "sha512-ChohLQ39dLwaxQv0jIQB/SavP3TM5K5ENfDTqIdzLkmfs3+JlzSDyQKcJFjTHYcCzQOZVeieeGq8PdqvLJxJxQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.3.0.tgz", + "integrity": "sha512-zlGHA23uuXmS8z3XxEGmbHpWDxXfPZ47QS06tGUq0HDcZjXjXHeLG+cboOy828QIV5FXsm9MjfkP5e4ZNbOkow==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@pagefind/default-ui": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.1.1.tgz", - "integrity": "sha512-ZM0zDatWDnac/VGHhQCiM7UgA4ca8jpjA+VfuTJyHJBaxGqZMQnm4WoTz9E0KFcue1Bh9kxpu7uWFZfwpZZk0A==", - "license": "MIT" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.3.0.tgz", + "integrity": "sha512-CGKT9ccd3+oRK6STXGgfH+m0DbOKayX6QGlq38TfE1ZfUcPc5+ulTuzDbZUnMo+bubsEOIypm4Pl2iEyzZ1cNg==" }, "node_modules/@pagefind/linux-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.1.1.tgz", - "integrity": "sha512-H5P6wDoCoAbdsWp0Zx0DxnLUrwTGWGLu/VI1rcN2CyFdY2EGSvPQsbGBMrseKRNuIrJDFtxHHHyjZ7UbzaM9EA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.3.0.tgz", + "integrity": "sha512-8lsxNAiBRUk72JvetSBXs4WRpYrQrVJXjlRRnOL6UCdBN9Nlsz0t7hWstRk36+JqHpGWOKYiuHLzGYqYAqoOnQ==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@pagefind/linux-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.1.1.tgz", - "integrity": "sha512-yJs7tTYbL2MI3HT+ngs9E1BfUbY9M4/YzA0yEM5xBo4Xl8Yu8Qg2xZTOQ1/F6gwvMrjCUFo8EoACs6LRDhtMrQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.3.0.tgz", + "integrity": "sha512-hAvqdPJv7A20Ucb6FQGE6jhjqy+vZ6pf+s2tFMNtMBG+fzcdc91uTw7aP/1Vo5plD0dAOHwdxfkyw0ugal4kcQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@pagefind/windows-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.1.1.tgz", - "integrity": "sha512-b7/qPqgIl+lMzkQ8fJt51SfguB396xbIIR+VZ3YrL2tLuyifDJ1wL5mEm+ddmHxJ2Fki340paPcDan9en5OmAw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.3.0.tgz", + "integrity": "sha512-BR1bIRWOMqkf8IoU576YDhij1Wd/Zf2kX/kCI0b2qzCKC8wcc2GQJaaRMCpzvCCrmliO4vtJ6RITp/AnoYUUmQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "win32" ] }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "license": "MIT" + }, "node_modules/@rollup/pluginutils": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", - "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -1853,12 +2050,14 @@ "node_modules/@rollup/pluginutils/node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" }, "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1867,306 +2066,335 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.25.0.tgz", - "integrity": "sha512-CC/ZqFZwlAIbU1wUPisHyV/XRc5RydFrNLtgl3dGYskdwPZdt4HERtKm50a/+DtTlKeCq9IXFEWR+P6blwjqBA==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz", + "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==", "cpu": [ "arm" ], - "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.25.0.tgz", - "integrity": "sha512-/Y76tmLGUJqVBXXCfVS8Q8FJqYGhgH4wl4qTA24E9v/IJM0XvJCGQVSW1QZ4J+VURO9h8YCa28sTFacZXwK7Rg==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz", + "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.25.0.tgz", - "integrity": "sha512-YVT6L3UrKTlC0FpCZd0MGA7NVdp7YNaEqkENbWQ7AOVOqd/7VzyHpgIpc1mIaxRAo1ZsJRH45fq8j4N63I/vvg==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz", + "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.25.0.tgz", - "integrity": "sha512-ZRL+gexs3+ZmmWmGKEU43Bdn67kWnMeWXLFhcVv5Un8FQcx38yulHBA7XR2+KQdYIOtD0yZDWBCudmfj6lQJoA==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz", + "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.25.0.tgz", - "integrity": "sha512-xpEIXhiP27EAylEpreCozozsxWQ2TJbOLSivGfXhU4G1TBVEYtUPi2pOZBnvGXHyOdLAUUhPnJzH3ah5cqF01g==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz", + "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.25.0.tgz", - "integrity": "sha512-sC5FsmZGlJv5dOcURrsnIK7ngc3Kirnx3as2XU9uER+zjfyqIjdcMVgzy4cOawhsssqzoAX19qmxgJ8a14Qrqw==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz", + "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.25.0.tgz", - "integrity": "sha512-uD/dbLSs1BEPzg564TpRAQ/YvTnCds2XxyOndAO8nJhaQcqQGFgv/DAVko/ZHap3boCvxnzYMa3mTkV/B/3SWA==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz", + "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==", "cpu": [ "arm" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.25.0.tgz", - "integrity": "sha512-ZVt/XkrDlQWegDWrwyC3l0OfAF7yeJUF4fq5RMS07YM72BlSfn2fQQ6lPyBNjt+YbczMguPiJoCfaQC2dnflpQ==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz", + "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==", "cpu": [ "arm" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.25.0.tgz", - "integrity": "sha512-qboZ+T0gHAW2kkSDPHxu7quaFaaBlynODXpBVnPxUgvWYaE84xgCKAPEYE+fSMd3Zv5PyFZR+L0tCdYCMAtG0A==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz", + "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.25.0.tgz", - "integrity": "sha512-ndWTSEmAaKr88dBuogGH2NZaxe7u2rDoArsejNslugHZ+r44NfWiwjzizVS1nUOHo+n1Z6qV3X60rqE/HlISgw==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz", + "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==", "cpu": [ "arm64" ], - "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz", + "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==", + "cpu": [ + "loong64" + ], "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.25.0.tgz", - "integrity": "sha512-BVSQvVa2v5hKwJSy6X7W1fjDex6yZnNKy3Kx1JGimccHft6HV0THTwNtC2zawtNXKUu+S5CjXslilYdKBAadzA==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz", + "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==", "cpu": [ "ppc64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.25.0.tgz", - "integrity": "sha512-G4hTREQrIdeV0PE2JruzI+vXdRnaK1pg64hemHq2v5fhv8C7WjVaeXc9P5i4Q5UC06d/L+zA0mszYIKl+wY8oA==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz", + "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz", + "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==", "cpu": [ "riscv64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.25.0.tgz", - "integrity": "sha512-9T/w0kQ+upxdkFL9zPVB6zy9vWW1deA3g8IauJxojN4bnz5FwSsUAD034KpXIVX5j5p/rn6XqumBMxfRkcHapQ==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz", + "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==", "cpu": [ "s390x" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.25.0.tgz", - "integrity": "sha512-ThcnU0EcMDn+J4B9LD++OgBYxZusuA7iemIIiz5yzEcFg04VZFzdFjuwPdlURmYPZw+fgVrFzj4CA64jSTG4Ig==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz", + "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.25.0.tgz", - "integrity": "sha512-zx71aY2oQxGxAT1JShfhNG79PnjYhMC6voAjzpu/xmMjDnKNf6Nl/xv7YaB/9SIa9jDYf8RBPWEnjcdlhlv1rQ==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz", + "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.25.0.tgz", - "integrity": "sha512-JT8tcjNocMs4CylWY/CxVLnv8e1lE7ff1fi6kbGocWwxDq9pj30IJ28Peb+Y8yiPNSF28oad42ApJB8oUkwGww==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz", + "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.25.0.tgz", - "integrity": "sha512-dRLjLsO3dNOfSN6tjyVlG+Msm4IiZnGkuZ7G5NmpzwF9oOc582FZG05+UdfTbz5Jd4buK/wMb6UeHFhG18+OEg==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz", + "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==", "cpu": [ "ia32" ], - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.25.0.tgz", - "integrity": "sha512-/RqrIFtLB926frMhZD0a5oDa4eFIbyNEwLLloMTEjmqfwZWXywwVVOVmwTsuyhC9HKkVEZcOOi+KV4U9wmOdlg==", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz", + "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@shikijs/core": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.22.2.tgz", - "integrity": "sha512-bvIQcd8BEeR1yFvOYv6HDiyta2FFVePbzeowf5pPS1avczrPK+cjmaxxh0nx5QzbON7+Sv0sQfQVciO7bN72sg==", - "dependencies": { - "@shikijs/engine-javascript": "1.22.2", - "@shikijs/engine-oniguruma": "1.22.2", - "@shikijs/types": "1.22.2", - "@shikijs/vscode-textmate": "^9.3.0", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.15.0.tgz", + "integrity": "sha512-8TOG6yG557q+fMsSVa8nkEDOZNTSxjbbR8l6lF2gyr6Np+jrPlslqDxQkN6rMXCECQ3isNPZAGszAfYoJOPGlg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.15.0", + "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", - "hast-util-to-html": "^9.0.3" + "hast-util-to-html": "^9.0.5" } }, "node_modules/@shikijs/engine-javascript": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.22.2.tgz", - "integrity": "sha512-iOvql09ql6m+3d1vtvP8fLCVCK7BQD1pJFmHIECsujB0V32BJ0Ab6hxk1ewVSMFA58FI0pR2Had9BKZdyQrxTw==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.15.0.tgz", + "integrity": "sha512-ZedbOFpopibdLmvTz2sJPJgns8Xvyabe2QbmqMTz07kt1pTzfEvKZc5IqPVO/XFiEbbNyaOpjPBkkr1vlwS+qg==", + "license": "MIT", "dependencies": { - "@shikijs/types": "1.22.2", - "@shikijs/vscode-textmate": "^9.3.0", - "oniguruma-to-js": "0.4.3" + "@shikijs/types": "3.15.0", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.3" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.22.2.tgz", - "integrity": "sha512-GIZPAGzQOy56mGvWMoZRPggn0dTlBf1gutV5TdceLCZlFNqWmuc7u+CzD0Gd9vQUTgLbrt0KLzz6FNprqYAxlA==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.15.0.tgz", + "integrity": "sha512-HnqFsV11skAHvOArMZdLBZZApRSYS4LSztk2K3016Y9VCyZISnlYUYsL2hzlS7tPqKHvNqmI5JSUJZprXloMvA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.15.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.15.0.tgz", + "integrity": "sha512-WpRvEFvkVvO65uKYW4Rzxs+IG0gToyM8SARQMtGGsH4GDMNZrr60qdggXrFOsdfOVssG/QQGEl3FnJ3EZ+8w8A==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.15.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.15.0.tgz", + "integrity": "sha512-8ow2zWb1IDvCKjYb0KiLNrK4offFdkfNVPXb1OZykpLCzRU6j+efkY+Y7VQjNlNFXonSw+4AOdGYtmqykDbRiQ==", + "license": "MIT", "dependencies": { - "@shikijs/types": "1.22.2", - "@shikijs/vscode-textmate": "^9.3.0" + "@shikijs/types": "3.15.0" } }, "node_modules/@shikijs/types": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.22.2.tgz", - "integrity": "sha512-NCWDa6LGZqTuzjsGfXOBWfjS/fDIbDdmVDug+7ykVe1IKT4c1gakrvlfFYp5NhAXH/lyqLM8wsAPo5wNy73Feg==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.15.0.tgz", + "integrity": "sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw==", + "license": "MIT", "dependencies": { - "@shikijs/vscode-textmate": "^9.3.0", + "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "node_modules/@shikijs/vscode-textmate": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.0.tgz", - "integrity": "sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==" + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==" + }, + "node_modules/@swc/helpers": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", + "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "license": "MIT", "optional": true, "engines": { "node": ">= 10" } }, - "node_modules/@types/acorn": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", - "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==", - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "license": "MIT", "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -2176,9 +2404,10 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "license": "MIT", "dependencies": { "@babel/types": "^7.0.0" } @@ -2187,24 +2416,21 @@ "version": "7.4.4", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "license": "MIT", "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.28.2" } }, - "node_modules/@types/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" - }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -2214,27 +2440,41 @@ } }, "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "license": "MIT" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==" }, "node_modules/@types/estree-jsx": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", "dependencies": { "@types/estree": "*" } }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "node_modules/@types/fontkit": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/fontkit/-/fontkit-2.0.8.tgz", + "integrity": "sha512-wN+8bYxIpJf+5oZdrdtaX04qUuWHcKxcDEgRS9Qm9ZClSHjzEn13SxUC+5eRM+4yXIeTYk8mTzLAWGF64847ew==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dependencies": { "@types/unist": "*" } }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==" + }, "node_modules/@types/jsdom": { "version": "21.1.6", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz", @@ -2256,7 +2496,8 @@ "node_modules/@types/mdx": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", - "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==" + "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==", + "license": "MIT" }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2272,34 +2513,39 @@ } }, "node_modules/@types/node": { - "version": "20.11.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", - "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.0.tgz", + "integrity": "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==", + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~7.10.0" } }, "node_modules/@types/prop-types": { - "version": "15.7.11", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", - "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "license": "MIT" }, "node_modules/@types/react": { - "version": "18.2.65", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.65.tgz", - "integrity": "sha512-98TsY0aW4jqx/3RqsUXwMDZSWR1Z4CUlJNue8ueS2/wcxZOsz4xmW1X8ieaWVRHcmmQM3R8xVA4XWB3dJnWwDQ==", + "version": "18.3.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.26.tgz", + "integrity": "sha512-RFA/bURkcKzx/X9oumPG9Vp3D3JUgus/d0b67KB0t5S/raciymilkOa66olh78MUI92QLbEJevO7rvqU/kjwKA==", + "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "18.2.22", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", - "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", - "dependencies": { - "@types/react": "*" + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "@types/react": "^18.0.0" } }, "node_modules/@types/sax": { @@ -2310,11 +2556,6 @@ "@types/node": "*" } }, - "node_modules/@types/scheduler": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", - "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" - }, "node_modules/@types/tough-cookie": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", @@ -2331,21 +2572,23 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@vitejs/plugin-react": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.1.tgz", - "integrity": "sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "license": "MIT", "dependencies": { - "@babel/core": "^7.24.5", - "@babel/plugin-transform-react-jsx-self": "^7.24.5", - "@babel/plugin-transform-react-jsx-source": "^7.24.1", + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", - "react-refresh": "^0.14.2" + "react-refresh": "^0.17.0" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0" + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "node_modules/@volar/kit": { @@ -2440,18 +2683,22 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "deprecated": "Use your platform's native atob() and btoa() methods instead", + "license": "BSD-3-Clause", "optional": true }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", "optional": true }, "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2463,6 +2710,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "license": "MIT", "optional": true, "dependencies": { "acorn": "^8.1.0", @@ -2473,15 +2721,20 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "license": "MIT", "optional": true, + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } @@ -2575,16 +2828,32 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC", "optional": true }, "node_modules/are-we-there-yet": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -2626,105 +2895,227 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "license": "MIT", "bin": { "astring": "bin/astring" } }, "node_modules/astro": { - "version": "4.16.10", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.16.10.tgz", - "integrity": "sha512-a+nB4bZE50NXHLzVXUHtx/lYct2Aa8kbqZnWNrWqkU97RuhBuWJ5H5/LQbKRnBWGvqChKfJBiMWJe53TY9ieYQ==", + "version": "5.15.8", + "resolved": "https://registry.npmjs.org/astro/-/astro-5.15.8.tgz", + "integrity": "sha512-QiiRnNPdxCcAGO2UlO07o+QeGgRfEC5Dlm0x35WPB/ixFK1T2bsNB6KaXri70cVkYY1GYgoRtrWv3HCR26o9aw==", + "license": "MIT", + "peer": true, "dependencies": { - "@astrojs/compiler": "^2.10.3", - "@astrojs/internal-helpers": "0.4.1", - "@astrojs/markdown-remark": "5.3.0", - "@astrojs/telemetry": "3.1.0", - "@babel/core": "^7.26.0", - "@babel/plugin-transform-react-jsx": "^7.25.9", - "@babel/types": "^7.26.0", + "@astrojs/compiler": "^2.13.0", + "@astrojs/internal-helpers": "0.7.4", + "@astrojs/markdown-remark": "6.3.8", + "@astrojs/telemetry": "3.3.0", + "@capsizecss/unpack": "^3.0.0", "@oslojs/encoding": "^1.1.0", - "@rollup/pluginutils": "^5.1.3", - "@types/babel__core": "^7.20.5", - "@types/cookie": "^0.6.0", - "acorn": "^8.14.0", + "@rollup/pluginutils": "^5.3.0", + "acorn": "^8.15.0", "aria-query": "^5.3.2", "axobject-query": "^4.1.0", "boxen": "8.0.1", - "ci-info": "^4.0.0", + "ci-info": "^4.3.1", "clsx": "^2.1.1", "common-ancestor-path": "^1.0.1", - "cookie": "^0.7.2", + "cookie": "^1.0.2", "cssesc": "^3.0.0", - "debug": "^4.3.7", + "debug": "^4.4.3", "deterministic-object-hash": "^2.0.2", - "devalue": "^5.1.1", + "devalue": "^5.4.2", "diff": "^5.2.0", "dlv": "^1.1.3", "dset": "^3.1.4", - "es-module-lexer": "^1.5.4", - "esbuild": "^0.21.5", + "es-module-lexer": "^1.7.0", + "esbuild": "^0.25.0", "estree-walker": "^3.0.3", - "fast-glob": "^3.3.2", "flattie": "^1.1.1", + "fontace": "~0.3.1", "github-slugger": "^2.0.0", - "gray-matter": "^4.0.3", - "html-escaper": "^3.0.3", - "http-cache-semantics": "^4.1.1", + "html-escaper": "3.0.3", + "http-cache-semantics": "^4.2.0", + "import-meta-resolve": "^4.2.0", "js-yaml": "^4.1.0", - "kleur": "^4.1.5", - "magic-string": "^0.30.12", - "magicast": "^0.3.5", - "micromatch": "^4.0.8", - "mrmime": "^2.0.0", + "magic-string": "^0.30.21", + "magicast": "^0.5.1", + "mrmime": "^2.0.1", "neotraverse": "^0.6.18", - "ora": "^8.1.1", - "p-limit": "^6.1.0", - "p-queue": "^8.0.1", - "preferred-pm": "^4.0.0", + "p-limit": "^6.2.0", + "p-queue": "^8.1.1", + "package-manager-detector": "^1.5.0", + "picocolors": "^1.1.1", + "picomatch": "^4.0.3", "prompts": "^2.4.2", "rehype": "^13.0.2", - "semver": "^7.6.3", - "shiki": "^1.22.2", - "tinyexec": "^0.3.1", - "tsconfck": "^3.1.4", + "semver": "^7.7.3", + "shiki": "^3.15.0", + "smol-toml": "^1.4.2", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tsconfck": "^3.1.6", + "ultrahtml": "^1.6.0", + "unifont": "~0.6.0", "unist-util-visit": "^5.0.0", + "unstorage": "^1.17.2", "vfile": "^6.0.3", - "vite": "^5.4.10", - "vitefu": "^1.0.3", - "which-pm": "^3.0.0", - "xxhash-wasm": "^1.0.2", + "vite": "^6.4.1", + "vitefu": "^1.1.1", + "xxhash-wasm": "^1.1.0", "yargs-parser": "^21.1.1", - "zod": "^3.23.8", - "zod-to-json-schema": "^3.23.5", + "yocto-spinner": "^0.2.3", + "zod": "^3.25.76", + "zod-to-json-schema": "^3.24.6", "zod-to-ts": "^1.2.0" }, "bin": { "astro": "astro.js" }, "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0", + "node": "18.20.8 || ^20.3.0 || >=22.0.0", "npm": ">=9.6.5", "pnpm": ">=7.1.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/astrodotbuild" + }, "optionalDependencies": { - "sharp": "^0.33.3" + "sharp": "^0.34.0" } }, "node_modules/astro-expressive-code": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.38.3.tgz", - "integrity": "sha512-Tvdc7RV0G92BbtyEOsfJtXU35w41CkM94fOAzxbQP67Wj5jArfserJ321FO4XA7WG9QMV0GIBmQq77NBIRDzpQ==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.41.1.tgz", + "integrity": "sha512-za6HlekMOczwlkuYuQQTd6LkKFwsnfAjwjIprCzOqsjp9vkYrAcriXM5cIG7V1Zxx88sVXF6iGnyNl4J0DL2Mg==", "dependencies": { - "rehype-expressive-code": "^0.38.3" + "rehype-expressive-code": "^0.41.1" }, "peerDependencies": { "astro": "^4.0.0-beta || ^5.0.0-beta || ^3.3.0" } }, + "node_modules/astro/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/astro/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/astro/node_modules/unstorage": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.17.2.tgz", + "integrity": "sha512-cKEsD6iBWJgOMJ6vW1ID/SYuqNf8oN4yqRk8OYqaVQ3nnkJXOT1PSpaMh2QfzLs78UN5kSNRD2c/mgjT8tX7+w==", + "license": "MIT", + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^4.0.3", + "destr": "^2.0.5", + "h3": "^1.15.4", + "lru-cache": "^10.4.3", + "node-fetch-native": "^1.6.7", + "ofetch": "^1.5.0", + "ufo": "^1.6.1" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.8.0", + "@azure/cosmos": "^4.2.0", + "@azure/data-tables": "^13.3.0", + "@azure/identity": "^4.6.0", + "@azure/keyvault-secrets": "^4.9.0", + "@azure/storage-blob": "^12.26.0", + "@capacitor/preferences": "^6.0.3 || ^7.0.0", + "@deno/kv": ">=0.9.0", + "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0", + "@planetscale/database": "^1.19.0", + "@upstash/redis": "^1.34.3", + "@vercel/blob": ">=0.27.1", + "@vercel/functions": "^2.2.12 || ^3.0.0", + "@vercel/kv": "^1.0.1", + "aws4fetch": "^1.0.20", + "db0": ">=0.2.1", + "idb-keyval": "^6.2.1", + "ioredis": "^5.4.2", + "uploadthing": "^7.4.4" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@deno/kv": { + "optional": true + }, + "@netlify/blobs": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/blob": { + "optional": true + }, + "@vercel/functions": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "aws4fetch": { + "optional": true + }, + "db0": { + "optional": true + }, + "idb-keyval": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "uploadthing": { + "optional": true + } + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT", "optional": true }, "node_modules/axobject-query": { @@ -2754,6 +3145,35 @@ "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.28", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.28.tgz", + "integrity": "sha512-gYjt7OIqdM0PcttNYP2aVrr2G0bMALkBaoehD4BuRGjAOtipg0b6wHg1yNL+s5zSnLZZrGHOw4IrND8CD+3oIQ==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, "node_modules/bcp-47": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz", @@ -2777,6 +3197,17 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -2805,9 +3236,10 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "optional": true, "dependencies": { "balanced-match": "^1.0.0", @@ -2825,10 +3257,19 @@ "node": ">=8" } }, + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.1.2" + } + }, "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", + "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==", "funding": [ { "type": "opencollective", @@ -2843,11 +3284,14 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", + "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.1" + "baseline-browser-mapping": "^2.8.25", + "caniuse-lite": "^1.0.30001754", + "electron-to-chromium": "^1.5.249", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.1.4" }, "bin": { "browserslist": "cli.js" @@ -2856,6 +3300,44 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/camelcase": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", @@ -2869,9 +3351,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001679", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001679.tgz", - "integrity": "sha512-j2YqID/YwpLnKzCmBOS4tlZdWprXm3ZmQLBH9ZBXFOhoxLA46fwyBvx6toCBWBmnuwUY/qB3kEU6gFx8qgCroA==", + "version": "1.0.30001754", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001754.tgz", + "integrity": "sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==", "funding": [ { "type": "opencollective", @@ -2885,56 +3367,22 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/canvas": { - "version": "2.11.2", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", - "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-3.2.0.tgz", + "integrity": "sha512-jk0GxrLtUEmW/TmFsk2WghvgHe8B0pxGilqCL21y8lHkPUGa6FTsnCNtHPOzT8O3y+N+m3espawV80bbBlgfTA==", "hasInstallScript": true, - "optional": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "nan": "^2.17.0", - "simple-get": "^3.0.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/canvas/node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "optional": true, + "license": "MIT", + "peer": true, "dependencies": { - "mimic-response": "^2.0.0" + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.3" }, "engines": { - "node": ">=8" - } - }, - "node_modules/canvas/node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "optional": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/canvas/node_modules/simple-get": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", - "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", - "optional": true, - "dependencies": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" + "node": "^18.12.0 || >= 20.9.0" } }, "node_modules/ccount": { @@ -2994,9 +3442,9 @@ } }, "node_modules/chokidar": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", - "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dependencies": { "readdirp": "^4.0.1" }, @@ -3007,16 +3455,23 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, "node_modules/ci-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", - "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -3033,31 +3488,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-cursor": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", - "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", - "dependencies": { - "restore-cursor": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -3154,6 +3584,15 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -3180,71 +3619,27 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "optional": true, - "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" - }, - "engines": { - "node": ">=12.5.0" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "optional": true - }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "optional": true, - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, "node_modules/color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", "optional": true, "bin": { "color-support": "bin.js" } }, - "node_modules/color/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "optional": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "optional": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "optional": true, "dependencies": { "delayed-stream": "~1.0.0" @@ -3271,37 +3666,54 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT", "optional": true }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", "optional": true }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" }, "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", "engines": { - "node": ">= 0.6" + "node": ">=18" } }, + "node_modules/cookie-es": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.2.2.tgz", + "integrity": "sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==", + "license": "MIT" + }, "node_modules/crelt": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" }, + "node_modules/crossws": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", + "integrity": "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==", + "license": "MIT", + "dependencies": { + "uncrypto": "^0.1.3" + } + }, "node_modules/css-selector-parser": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.5.tgz", - "integrity": "sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.1.2.tgz", + "integrity": "sha512-WfUcL99xWDs7b3eZPoRszWVfbNo8ErCF15PTvVROjkShGlAfjIkG6hlfj/sl6/rfo5Q9x9ryJ3VqVnAZDA+gcw==", "funding": [ { "type": "github", @@ -3313,6 +3725,19 @@ } ] }, + "node_modules/css-tree": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.1.0.tgz", + "integrity": "sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.12.2", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -3328,49 +3753,44 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "license": "MIT", "optional": true }, "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "optional": true, + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "license": "MIT", "dependencies": { - "cssom": "~0.3.6" + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "optional": true - }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", - "optional": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "license": "MIT", "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -3385,10 +3805,10 @@ } }, "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "optional": true + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "license": "MIT" }, "node_modules/decode-named-character-reference": { "version": "1.0.2", @@ -3402,10 +3822,41 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "license": "MIT" + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "optional": true, "engines": { "node": ">=0.4.0" @@ -3415,6 +3866,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", "optional": true }, "node_modules/dequal": { @@ -3425,11 +3877,17 @@ "node": ">=6" } }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, "node_modules/detect-libc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "optional": true, + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -3446,9 +3904,9 @@ } }, "node_modules/devalue": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.1.1.tgz", - "integrity": "sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.5.0.tgz", + "integrity": "sha512-69sM5yrHfFLJt0AZ9QqZXGCPfJ7fQjvpln3Rq5+PS03LD32Ost1Q9N+eEnaQwGRIriKkMImXD56ocjQmfjbV3w==", "license": "MIT" }, "node_modules/devlop": { @@ -3463,6 +3921,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/dfa": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz", + "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==", + "license": "MIT" + }, "node_modules/diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", @@ -3486,13 +3950,15 @@ "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "license": "MIT" }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "deprecated": "Use your platform's native DOMException instead", + "license": "MIT", "optional": true, "dependencies": { "webidl-conversions": "^7.0.0" @@ -3510,10 +3976,26 @@ "node": ">=4" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/electron-to-chromium": { - "version": "1.5.55", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.55.tgz", - "integrity": "sha512-6maZ2ASDOTBtjt9FhqYPRnbvKU5tjG0IN9SztUOWYw2AzNDNpKJYLJmlK0/En4Hs/aiWnB+JZ+gW19PIGszgKg==" + "version": "1.5.253", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.253.tgz", + "integrity": "sha512-O0tpQ/35rrgdiGQ0/OFWhy1itmd9A6TY9uQzlqj3hKSu/aYpe7UIn5d7CU2N9myH6biZiWF3VMZVuup8pw5U9w==", + "license": "ISC" }, "node_modules/emmet": { "version": "2.4.11", @@ -3536,6 +4018,15 @@ "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", "license": "MIT" }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -3547,15 +4038,66 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/esast-util-from-estree": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", "integrity": "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "devlop": "^1.0.0", @@ -3571,6 +4113,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz", "integrity": "sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "acorn": "^8.0.0", @@ -3583,40 +4126,42 @@ } }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", + "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.25.2", + "@esbuild/android-arm": "0.25.2", + "@esbuild/android-arm64": "0.25.2", + "@esbuild/android-x64": "0.25.2", + "@esbuild/darwin-arm64": "0.25.2", + "@esbuild/darwin-x64": "0.25.2", + "@esbuild/freebsd-arm64": "0.25.2", + "@esbuild/freebsd-x64": "0.25.2", + "@esbuild/linux-arm": "0.25.2", + "@esbuild/linux-arm64": "0.25.2", + "@esbuild/linux-ia32": "0.25.2", + "@esbuild/linux-loong64": "0.25.2", + "@esbuild/linux-mips64el": "0.25.2", + "@esbuild/linux-ppc64": "0.25.2", + "@esbuild/linux-riscv64": "0.25.2", + "@esbuild/linux-s390x": "0.25.2", + "@esbuild/linux-x64": "0.25.2", + "@esbuild/netbsd-arm64": "0.25.2", + "@esbuild/netbsd-x64": "0.25.2", + "@esbuild/openbsd-arm64": "0.25.2", + "@esbuild/openbsd-x64": "0.25.2", + "@esbuild/sunos-x64": "0.25.2", + "@esbuild/win32-arm64": "0.25.2", + "@esbuild/win32-ia32": "0.25.2", + "@esbuild/win32-x64": "0.25.2" } }, "node_modules/escalade": { @@ -3628,10 +4173,22 @@ "node": ">=6" } }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/escodegen": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", "optional": true, "dependencies": { "esprima": "^4.0.1", @@ -3653,6 +4210,8 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "optional": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3665,6 +4224,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", "optional": true, "engines": { "node": ">=4.0" @@ -3674,6 +4234,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" }, @@ -3686,6 +4247,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "devlop": "^1.0.0", @@ -3701,6 +4263,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -3710,6 +4273,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz", "integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "devlop": "^1.0.0" @@ -3723,6 +4287,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "astring": "^1.8.0", @@ -3734,17 +4299,19 @@ } }, "node_modules/estree-util-to-js/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "license": "BSD-3-Clause", "engines": { - "node": ">= 8" + "node": ">= 12" } }, "node_modules/estree-util-visit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/unist": "^3.0.0" @@ -3766,6 +4333,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", "optional": true, "engines": { "node": ">=0.10.0" @@ -3774,17 +4342,27 @@ "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } }, "node_modules/expressive-code": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/expressive-code/-/expressive-code-0.38.3.tgz", - "integrity": "sha512-COM04AiUotHCKJgWdn7NtW2lqu8OW8owAidMpkXt1qxrZ9Q2iC7+tok/1qIn2ocGnczvr9paIySgGnEwFeEQ8Q==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/expressive-code/-/expressive-code-0.41.1.tgz", + "integrity": "sha512-O3+bDWGw+y7b0L3Y3xc7LbPgRTvFy2tqXzYY24TBbDwnHbIwb0OFdS4v+1PpX6NEsF7XsVv9sqY5xo22yWe7Hw==", "dependencies": { - "@expressive-code/core": "^0.38.3", - "@expressive-code/plugin-frames": "^0.38.3", - "@expressive-code/plugin-shiki": "^0.38.3", - "@expressive-code/plugin-text-markers": "^0.38.3" + "@expressive-code/core": "^0.41.1", + "@expressive-code/plugin-frames": "^0.41.1", + "@expressive-code/plugin-shiki": "^0.41.1", + "@expressive-code/plugin-text-markers": "^0.41.1" } }, "node_modules/extend": { @@ -3792,21 +4370,11 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fabric": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fabric/-/fabric-6.4.3.tgz", - "integrity": "sha512-z/bJna3kWOBv+wmvVK4XxUQgCXLGb//VaSr5xPFIP708obH7472uuVsWbXam+xq+y21bLBtr4OHO1HuJyYi4FQ==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/fabric/-/fabric-6.9.0.tgz", + "integrity": "sha512-ILIbG4Us/41Z4rU8/gveN4Hb7NvgBorqV9xj+9Dl7YsXiyUPXdxV8+q5OvaNghmYzQoK1Am3m0wTvmovOxrJAg==", + "license": "MIT", "engines": { "node": ">=16.20.0" }, @@ -3815,6 +4383,242 @@ "jsdom": "^20.0.1" } }, + "node_modules/fabric/node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "license": "MIT", + "optional": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fabric/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "license": "MIT", + "optional": true + }, + "node_modules/fabric/node_modules/data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "license": "MIT", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fabric/node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fabric/node_modules/jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/fabric/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fabric/node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "license": "MIT", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/fabric/node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/fabric/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "license": "MIT", + "optional": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/fabric/node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3853,44 +4657,12 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/find-up-simple": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", - "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-yarn-workspace-root2": { - "version": "1.2.16", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", - "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", - "dependencies": { - "micromatch": "^4.0.2", - "pkg-dir": "^4.2.0" - } - }, "node_modules/flattie": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", @@ -3899,24 +4671,61 @@ "node": ">=8" } }, + "node_modules/fontace": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/fontace/-/fontace-0.3.1.tgz", + "integrity": "sha512-9f5g4feWT1jWT8+SbL85aLIRLIXUaDygaM2xPXRmzPYxrOMNok79Lr3FGJoKVNKibE0WCunNiEVG2mwuE+2qEg==", + "license": "MIT", + "dependencies": { + "@types/fontkit": "^2.0.8", + "fontkit": "^2.0.4" + } + }, + "node_modules/fontkit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.4.tgz", + "integrity": "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==", + "license": "MIT", + "dependencies": { + "@swc/helpers": "^0.5.12", + "brotli": "^1.3.2", + "clone": "^2.1.2", + "dfa": "^1.2.0", + "fast-deep-equal": "^3.1.3", + "restructure": "^3.0.0", + "tiny-inflate": "^1.0.3", + "unicode-properties": "^1.4.0", + "unicode-trie": "^2.0.0" + } + }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", "optional": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { "node": ">= 6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -3929,6 +4738,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -3941,12 +4751,14 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", "optional": true }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC", "optional": true }, "node_modules/fsevents": { @@ -3962,10 +4774,22 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -3986,6 +4810,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -3995,18 +4820,14 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "optional": true - }, - "node_modules/gauge/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "MIT", "optional": true }, "node_modules/gauge/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "optional": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -4021,6 +4842,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -4033,6 +4855,7 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -4057,6 +4880,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "optional": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/github-slugger": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", @@ -4066,6 +4934,8 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -4093,59 +4963,85 @@ "node": ">= 6" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "optional": true, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "node_modules/h3": { + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.4.tgz", + "integrity": "sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ==", + "license": "MIT", "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, - "engines": { - "node": ">=6.0" + "cookie-es": "^1.2.2", + "crossws": "^0.3.5", + "defu": "^6.1.4", + "destr": "^2.0.5", + "iron-webcrypto": "^1.2.1", + "node-mock-http": "^1.0.2", + "radix3": "^1.1.2", + "ufo": "^1.6.1", + "uncrypto": "^0.1.3" } }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "optional": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "has-symbols": "^1.0.3" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", "optional": true }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hast-util-embedded": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz", @@ -4285,9 +5181,9 @@ } }, "node_modules/hast-util-select": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.3.tgz", - "integrity": "sha512-OVRQlQ1XuuLP8aFVLYmC2atrfWHS5UD3shonxpnyrjcCkwtvmt/+N6kYJdcY4mkMJhxp4kj2EFIxQ9kvkkt/eQ==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.4.tgz", + "integrity": "sha512-RqGS1ZgI0MwxLaKLDxjprynNzINEkRHY2i8ln4DDjgv9ZhcYVIHN9rlpiYsqtFwrgpYU361SyWDQcGNIBVu3lw==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4300,7 +5196,7 @@ "hast-util-to-string": "^3.0.0", "hast-util-whitespace": "^3.0.0", "nth-check": "^2.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" @@ -4310,10 +5206,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-select/node_modules/property-information": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", + "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/hast-util-to-estree": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz", - "integrity": "sha512-lfX5g6hqVh9kjS/B9E2gSkvHH4SZNiQFiqWS0x9fENzEl+8W12RqdRxX6d/Cwxi30tPQs3bIO+aolQJNp1bIyw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", + "integrity": "sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", @@ -4326,9 +5232,9 @@ "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", - "style-to-object": "^0.4.0", + "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "zwitch": "^2.0.0" }, @@ -4337,24 +5243,20 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-to-estree/node_modules/inline-style-parser": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", - "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" - }, - "node_modules/hast-util-to-estree/node_modules/style-to-object": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz", - "integrity": "sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==", - "dependencies": { - "inline-style-parser": "0.1.1" + "node_modules/hast-util-to-estree/node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/hast-util-to-html": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz", - "integrity": "sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==", - "license": "MIT", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4363,7 +5265,7 @@ "hast-util-whitespace": "^3.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", "zwitch": "^2.0.4" @@ -4373,10 +5275,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-html/node_modules/property-information": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.0.0.tgz", + "integrity": "sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/hast-util-to-jsx-runtime": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.2.tgz", - "integrity": "sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", @@ -4388,9 +5300,9 @@ "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", - "style-to-object": "^1.0.0", + "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "vfile-message": "^4.0.0" }, @@ -4399,6 +5311,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-jsx-runtime/node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", @@ -4473,15 +5395,15 @@ } }, "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "optional": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "license": "MIT", "dependencies": { - "whatwg-encoding": "^2.0.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/html-escaper": { @@ -4508,22 +5430,31 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "license": "BSD-2-Clause" }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "optional": true, + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" } }, "node_modules/https-proxy-agent": { @@ -4565,7 +5496,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -4573,10 +5504,31 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/import-meta-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", - "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4586,6 +5538,8 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", "optional": true, "dependencies": { "once": "^1.3.0", @@ -4596,12 +5550,28 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "optional": true + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" }, "node_modules/inline-style-parser": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", - "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==" + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.6.tgz", + "integrity": "sha512-gtGXVaBdl5mAes3rPcMedEBm12ibjt1kDMFfheul1wUAOVEJW60voNdMVzVkfLN06O7ZaD/rxhfKgtlgtTbMjg==", + "license": "MIT" + }, + "node_modules/iron-webcrypto": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", + "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/brc-dd" + } }, "node_modules/is-alphabetical": { "version": "2.0.1", @@ -4625,12 +5595,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "optional": true - }, "node_modules/is-decimal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", @@ -4644,6 +5608,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -4654,14 +5619,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4702,6 +5659,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", "dependencies": { "is-docker": "^3.0.0" }, @@ -4715,17 +5673,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4749,23 +5696,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "optional": true - }, - "node_modules/is-unicode-supported": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", - "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "MIT" }, "node_modules/is-wsl": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "license": "MIT", "dependencies": { "is-inside-container": "^1.0.0" }, @@ -4779,7 +5716,8 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -4790,46 +5728,40 @@ }, "bin": { "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsdom": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", - "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", - "optional": true, - "dependencies": { - "abab": "^2.0.6", - "acorn": "^8.8.1", - "acorn-globals": "^7.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.4.2", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + } + }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", - "parse5": "^7.1.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.11.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^3.0.0" }, "peerDependenciesMeta": { "canvas": { @@ -4837,10 +5769,33 @@ } } }, + "node_modules/jsdom/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/jsdom/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -4857,6 +5812,7 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -4869,14 +5825,6 @@ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -4885,6 +5833,14 @@ "node": ">=6" } }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "engines": { + "node": ">= 8" + } + }, "node_modules/linkify-it": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", @@ -4893,82 +5849,11 @@ "uc.micro": "^2.0.0" } }, - "node_modules/load-yaml-file": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", - "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", - "dependencies": { - "graceful-fs": "^4.1.5", - "js-yaml": "^3.13.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/load-yaml-file/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/load-yaml-file/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/log-symbols": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", - "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", - "dependencies": { - "chalk": "^5.3.0", - "is-unicode-supported": "^1.3.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -4978,21 +5863,11 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -5003,29 +5878,30 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" }, "node_modules/magic-string": { - "version": "0.30.12", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", - "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/magicast": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", - "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.1.tgz", + "integrity": "sha512-xrHS24IxaLrvuo613F719wvOIv9xPHFWQHuvGUBmPnCA/3MQxKI3b+r7n1jAoDHmsbC5bRhTZYR77invLAxVnw==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.25.4", - "@babel/types": "^7.25.4", - "source-map-js": "^1.2.0" + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "source-map-js": "^1.2.1" } }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", "optional": true, "dependencies": { "semver": "^6.0.0" @@ -5041,6 +5917,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -5050,6 +5927,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "license": "MIT", "engines": { "node": ">=16" }, @@ -5074,14 +5952,24 @@ } }, "node_modules/markdown-table": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", - "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdast-util-definitions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", @@ -5116,9 +6004,9 @@ } }, "node_modules/mdast-util-find-and-replace": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", - "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", @@ -5130,17 +6018,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mdast-util-from-markdown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", @@ -5165,9 +6042,9 @@ } }, "node_modules/mdast-util-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", - "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", + "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", @@ -5183,9 +6060,9 @@ } }, "node_modules/mdast-util-gfm-autolink-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", - "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", @@ -5199,9 +6076,9 @@ } }, "node_modules/mdast-util-gfm-footnote": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", - "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", @@ -5263,6 +6140,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "license": "MIT", "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-mdx-expression": "^2.0.0", @@ -5279,6 +6157,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -5293,9 +6172,10 @@ } }, "node_modules/mdast-util-mdx-jsx": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz", - "integrity": "sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -5319,6 +6199,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -5396,6 +6277,12 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdn-data": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz", + "integrity": "sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==", + "license": "CC0-1.0" + }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", @@ -5514,9 +6401,9 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", - "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", @@ -5529,9 +6416,9 @@ } }, "node_modules/micromark-extension-gfm-footnote": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", - "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", @@ -5548,9 +6435,9 @@ } }, "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -5565,9 +6452,9 @@ } }, "node_modules/micromark-extension-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", - "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", + "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5593,9 +6480,9 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", - "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5609,9 +6496,9 @@ } }, "node_modules/micromark-extension-mdx-expression": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz", - "integrity": "sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz", + "integrity": "sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==", "funding": [ { "type": "GitHub Sponsors", @@ -5622,6 +6509,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "devlop": "^1.0.0", @@ -5634,11 +6522,11 @@ } }, "node_modules/micromark-extension-mdx-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.1.tgz", - "integrity": "sha512-vNuFb9czP8QCtAQcEJn0UJQJZA8Dk6DXKBqx+bg/w0WGuSxDxNr7hErW89tHUY31dUW4NqEOWwmEUNhjTFmHkg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.2.tgz", + "integrity": "sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==", + "license": "MIT", "dependencies": { - "@types/acorn": "^4.0.0", "@types/estree": "^1.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", @@ -5659,6 +6547,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", + "license": "MIT", "dependencies": { "micromark-util-types": "^2.0.0" }, @@ -5671,6 +6560,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "license": "MIT", "dependencies": { "acorn": "^8.0.0", "acorn-jsx": "^5.0.0", @@ -5690,6 +6580,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "devlop": "^1.0.0", @@ -5748,9 +6639,9 @@ } }, "node_modules/micromark-factory-mdx-expression": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.2.tgz", - "integrity": "sha512-5E5I2pFzJyg2CtemqAbcyCktpHXuJbABnsb32wX2U8IQKhhVFBqkcZR5LRm1WVoFqa4kTueZK4abep7wdo9nrw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.3.tgz", + "integrity": "sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5761,6 +6652,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "devlop": "^1.0.0", @@ -5965,9 +6857,9 @@ ] }, "node_modules/micromark-util-events-to-acorn": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.2.tgz", - "integrity": "sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.3.tgz", + "integrity": "sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==", "funding": [ { "type": "GitHub Sponsors", @@ -5978,8 +6870,8 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { - "@types/acorn": "^4.0.0", "@types/estree": "^1.0.0", "@types/unist": "^3.0.0", "devlop": "^1.0.0", @@ -6128,6 +7020,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "optional": true, "engines": { "node": ">= 0.6" @@ -6137,6 +7030,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "optional": true, "dependencies": { "mime-db": "1.52.0" @@ -6145,12 +7039,13 @@ "node": ">= 0.6" } }, - "node_modules/mimic-function": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", - "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6160,6 +7055,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", "optional": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -6168,10 +7064,20 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", "optional": true, "engines": { "node": ">=8" @@ -6181,6 +7087,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", "optional": true, "dependencies": { "minipass": "^3.0.0", @@ -6194,6 +7101,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -6206,12 +7114,14 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", "optional": true }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", "optional": true, "bin": { "mkdirp": "bin/cmd.js" @@ -6220,10 +7130,16 @@ "node": ">=10" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/mrmime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", - "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", "engines": { "node": ">=10" } @@ -6240,15 +7156,16 @@ "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" }, "node_modules/nan": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", - "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", + "license": "MIT", "optional": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", "funding": [ { "type": "github", @@ -6262,6 +7179,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, "node_modules/neotraverse": { "version": "0.6.18", "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz", @@ -6282,6 +7205,24 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/node-abi": { + "version": "3.78.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.78.0.tgz", + "integrity": "sha512-E2wEyrgX/CqvicaQYU3Ze1PFGjc4QYPGsjUrlYkqAE0WjHEZwgOsGMPMzkMse4LjJbDmaEuDX3CM036j5K2DSQ==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -6302,6 +7243,12 @@ } } }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -6324,15 +7271,23 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/node-mock-http": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.3.tgz", + "integrity": "sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==", + "license": "MIT" + }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==" + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "license": "MIT" }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", "optional": true, "dependencies": { "abbrev": "1" @@ -6344,10 +7299,21 @@ "node": ">=6" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npmlog": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "are-we-there-yet": "^2.0.0", @@ -6368,118 +7334,83 @@ } }, "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", - "optional": true + "version": "2.2.22", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.22.tgz", + "integrity": "sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==", + "license": "MIT" }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "MIT", "optional": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", - "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", - "dependencies": { - "mimic-function": "^5.0.0" - }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/oniguruma-to-js": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz", - "integrity": "sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==", + "node_modules/ofetch": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.5.1.tgz", + "integrity": "sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA==", + "license": "MIT", "dependencies": { - "regex": "^4.3.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "destr": "^2.0.5", + "node-fetch-native": "^1.6.7", + "ufo": "^1.6.1" } }, - "node_modules/ora": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-8.1.1.tgz", - "integrity": "sha512-YWielGi1XzG1UTvOaCFaNgEnuhZVMSHYkW/FQ7UX8O26PtlpdM84c0f7wLPlkvx2RfiQmnzd61d/MGxmpQeJPw==", - "dependencies": { - "chalk": "^5.3.0", - "cli-cursor": "^5.0.0", - "cli-spinners": "^2.9.2", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^2.0.0", - "log-symbols": "^6.0.0", - "stdin-discarder": "^0.2.2", - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" }, - "node_modules/p-limit": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz", - "integrity": "sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==", - "dependencies": { - "yocto-queue": "^1.1.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" } }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/oniguruma-parser": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.1.tgz", + "integrity": "sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.3.tgz", + "integrity": "sha512-rPiZhzC3wXwE59YQMRDodUwwT9FZ9nNBwQQfsd1wfdtlKEyCdRV0avrTcSZ5xlIvGRVPd/cx6ZN45ECmS39xvg==", + "license": "MIT", "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" + "oniguruma-parser": "^0.12.1", + "regex": "^6.0.1", + "regex-recursion": "^6.0.2" } }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/p-limit": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz", + "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==", "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^1.1.1" }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-queue": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", - "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.1.1.tgz", + "integrity": "sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ==", + "license": "MIT", "dependencies": { "eventemitter3": "^5.0.1", "p-timeout": "^6.1.2" @@ -6492,9 +7423,10 @@ } }, "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz", + "integrity": "sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==", + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -6502,30 +7434,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } + "node_modules/package-manager-detector": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.5.0.tgz", + "integrity": "sha512-uBj69dVlYe/+wxj8JOpr97XfsxH/eumMt6HqjNTmJDf/6NO9s+0uxeOneIz3AsPt2m6y9PqzDzd3ATcU17MNfw==", + "license": "MIT" }, "node_modules/pagefind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.1.1.tgz", - "integrity": "sha512-U2YR0dQN5B2fbIXrLtt/UXNS0yWSSYfePaad1KcBPTi0p+zRtsVjwmoPaMQgTks5DnHNbmDxyJUL5TGaLljK3A==", - "license": "MIT", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.3.0.tgz", + "integrity": "sha512-8KPLGT5g9s+olKMRTU9LFekLizkVIu9tes90O1/aigJ0T5LmyPqTzGJrETnSw3meSYg58YH7JTzhTTW/3z6VAw==", "bin": { "pagefind": "lib/runner/bin.cjs" }, "optionalDependencies": { - "@pagefind/darwin-arm64": "1.1.1", - "@pagefind/darwin-x64": "1.1.1", - "@pagefind/linux-arm64": "1.1.1", - "@pagefind/linux-x64": "1.1.1", - "@pagefind/windows-x64": "1.1.1" + "@pagefind/darwin-arm64": "1.3.0", + "@pagefind/darwin-x64": "1.3.0", + "@pagefind/linux-arm64": "1.3.0", + "@pagefind/linux-x64": "1.3.0", + "@pagefind/windows-x64": "1.3.0" } }, + "node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "license": "MIT" + }, "node_modules/parse-entities": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", @@ -6568,33 +7503,39 @@ } }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", "dependencies": { - "entities": "^4.4.0" + "entities": "^6.0.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -6617,29 +7558,10 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "funding": [ { "type": "opencollective", @@ -6654,10 +7576,10 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", + "peer": true, "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -6700,24 +7622,36 @@ "node": ">=4" } }, - "node_modules/preferred-pm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz", - "integrity": "sha512-gYBeFTZLu055D8Vv3cSPox/0iTPtkzxpLroSYYA7WXgRi31WCJ51Uyl8ZiPeUUjyvs2MBzK+S8v9JVUgHU/Sqw==", + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", "dependencies": { - "find-up-simple": "^1.0.0", - "find-yarn-workspace-root2": "1.2.16", - "which-pm": "^3.0.0" + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" }, "engines": { - "node": ">=18.12" + "node": ">=10" } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "optional": true, + "version": "3.4.2", + "resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "peer": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6730,9 +7664,10 @@ } }, "node_modules/prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6757,16 +7692,6 @@ "node": ">=6" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, "node_modules/property-information": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", @@ -6777,16 +7702,33 @@ } }, "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "optional": true + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "license": "MIT", + "optional": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "optional": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -6803,6 +7745,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT", "optional": true }, "node_modules/queue-microtask": { @@ -6824,84 +7767,64 @@ } ] }, - "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "node_modules/radix3": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", + "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==", + "license": "MIT" + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { - "loose-envify": "^1.1.0" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react": { + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", + "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", + "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" - }, - "peerDependencies": { - "react": "^18.2.0" - } - }, - "node_modules/react-fast-compare": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", - "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==" - }, - "node_modules/react-helmet": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz", - "integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==", + "version": "19.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", + "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", + "license": "MIT", + "peer": true, "dependencies": { - "object-assign": "^4.1.1", - "prop-types": "^15.7.2", - "react-fast-compare": "^3.1.1", - "react-side-effect": "^2.1.0" + "scheduler": "^0.27.0" }, "peerDependencies": { - "react": ">=16.3.0" - } - }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, - "node_modules/react-load-script": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/react-load-script/-/react-load-script-0.0.6.tgz", - "integrity": "sha512-aRGxDGP9VoLxcsaYvKWIW+LRrMOzz2eEcubTS4NvQPPugjk2VvMhow0wWTkSl7RxookomD1MwcP4l5UStg5ShQ==", - "deprecated": "abandoned and unmaintained", - "peerDependencies": { - "prop-types": ">=15", - "react": ">=0.14.9" + "react": "^19.2.0" } }, "node_modules/react-refresh": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", - "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/react-side-effect": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz", - "integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==", - "peerDependencies": { - "react": "^16.3.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "optional": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -6927,6 +7850,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz", "integrity": "sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-util-build-jsx": "^3.0.0", @@ -6938,9 +7862,10 @@ } }, "node_modules/recma-jsx": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.0.tgz", - "integrity": "sha512-5vwkv65qWwYxg+Atz95acp8DMu1JDSqdGkA2Of1j6rCreyFUE/gp15fC8MnGEuG1W68UKjM6x6+YTWIh7hZM/Q==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.1.tgz", + "integrity": "sha512-huSIy7VU2Z5OLv6oFLosQGGDqPqdO1iq6bWNAdhzMxSJP7RAso4fCZ1cKu8j9YHCZf3TPrq4dw3okhrylgcd7w==", + "license": "MIT", "dependencies": { "acorn-jsx": "^5.0.0", "estree-util-to-js": "^2.0.0", @@ -6951,12 +7876,16 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/recma-parse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz", "integrity": "sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "esast-util-from-js": "^2.0.0", @@ -6972,6 +7901,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz", "integrity": "sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-util-to-js": "^2.0.0", @@ -6983,15 +7913,29 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" - }, "node_modules/regex": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/regex/-/regex-4.4.0.tgz", - "integrity": "sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.0.1.tgz", + "integrity": "sha512-uorlqlzAKjKQZ5P+kTJr3eeJGSVroLKoHmquUj4zHWuR+hEyNqlXsSKlYYF5F4NI6nl7tWCs0apKJ0lmfsXAPA==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" }, "node_modules/rehype": { "version": "13.0.2", @@ -7010,11 +7954,11 @@ } }, "node_modules/rehype-expressive-code": { - "version": "0.38.3", - "resolved": "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.38.3.tgz", - "integrity": "sha512-RYSSDkMBikoTbycZPkcWp6ELneANT4eTpND1DSRJ6nI2eVFUwTBDCvE2vO6jOOTaavwnPiydi4i/87NRyjpdOA==", + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.41.1.tgz", + "integrity": "sha512-QApC3js5/AwrF6VqWfGsNY9Y1qLC0LQDWcqOHEAhbl3CB4e5GMor2SpWaGOWBW+mmrkVCEymayLPCPIbx0tcQQ==", "dependencies": { - "expressive-code": "^0.38.3" + "expressive-code": "^0.41.1" } }, "node_modules/rehype-format": { @@ -7084,6 +8028,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz", "integrity": "sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", @@ -7125,9 +8070,9 @@ } }, "node_modules/remark-gfm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", - "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", + "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", @@ -7142,9 +8087,10 @@ } }, "node_modules/remark-mdx": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz", - "integrity": "sha512-Ngl/H3YXyBV9RcRNdlYsZujAmhsxwzxpDzpDEhFBVAGthS4GDgnctpDjgFl/ULx5UEDzqtW1cyBSNKqYYrqLBA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.1.tgz", + "integrity": "sha512-Pjj2IYlUY3+D8x00UJsIOg5BEvfMyeI+2uLPn9VO9Wg4MEtN/VTIq2NEJQfde9PnX15KgtHyl9S0BcTnWrIuWg==", + "license": "MIT", "dependencies": { "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0" @@ -7170,9 +8116,9 @@ } }, "node_modules/remark-rehype": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.1.tgz", - "integrity": "sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==", + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -7239,22 +8185,14 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT", "optional": true }, - "node_modules/restore-cursor": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", - "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", - "dependencies": { - "onetime": "^7.0.0", - "signal-exit": "^4.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/restructure": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.2.tgz", + "integrity": "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==", + "license": "MIT" }, "node_modules/retext": { "version": "9.0.0", @@ -7326,6 +8264,8 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", "optional": true, "dependencies": { "glob": "^7.1.3" @@ -7338,12 +8278,12 @@ } }, "node_modules/rollup": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.25.0.tgz", - "integrity": "sha512-uVbClXmR6wvx5R1M3Od4utyLUxrmOcEm3pAtMphn73Apq19PDtHpgZoEvqH2YnnaNUuvKmg2DgRd2Sqv+odyqg==", - "license": "MIT", + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz", + "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==", + "peer": true, "dependencies": { - "@types/estree": "1.0.6" + "@types/estree": "1.0.7" }, "bin": { "rollup": "dist/bin/rollup" @@ -7353,27 +8293,35 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.25.0", - "@rollup/rollup-android-arm64": "4.25.0", - "@rollup/rollup-darwin-arm64": "4.25.0", - "@rollup/rollup-darwin-x64": "4.25.0", - "@rollup/rollup-freebsd-arm64": "4.25.0", - "@rollup/rollup-freebsd-x64": "4.25.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.25.0", - "@rollup/rollup-linux-arm-musleabihf": "4.25.0", - "@rollup/rollup-linux-arm64-gnu": "4.25.0", - "@rollup/rollup-linux-arm64-musl": "4.25.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.25.0", - "@rollup/rollup-linux-riscv64-gnu": "4.25.0", - "@rollup/rollup-linux-s390x-gnu": "4.25.0", - "@rollup/rollup-linux-x64-gnu": "4.25.0", - "@rollup/rollup-linux-x64-musl": "4.25.0", - "@rollup/rollup-win32-arm64-msvc": "4.25.0", - "@rollup/rollup-win32-ia32-msvc": "4.25.0", - "@rollup/rollup-win32-x64-msvc": "4.25.0", + "@rollup/rollup-android-arm-eabi": "4.40.0", + "@rollup/rollup-android-arm64": "4.40.0", + "@rollup/rollup-darwin-arm64": "4.40.0", + "@rollup/rollup-darwin-x64": "4.40.0", + "@rollup/rollup-freebsd-arm64": "4.40.0", + "@rollup/rollup-freebsd-x64": "4.40.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.40.0", + "@rollup/rollup-linux-arm-musleabihf": "4.40.0", + "@rollup/rollup-linux-arm64-gnu": "4.40.0", + "@rollup/rollup-linux-arm64-musl": "4.40.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.40.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0", + "@rollup/rollup-linux-riscv64-gnu": "4.40.0", + "@rollup/rollup-linux-riscv64-musl": "4.40.0", + "@rollup/rollup-linux-s390x-gnu": "4.40.0", + "@rollup/rollup-linux-x64-gnu": "4.40.0", + "@rollup/rollup-linux-x64-musl": "4.40.0", + "@rollup/rollup-win32-arm64-msvc": "4.40.0", + "@rollup/rollup-win32-ia32-msvc": "4.40.0", + "@rollup/rollup-win32-x64-msvc": "4.40.0", "fsevents": "~2.3.2" } }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -7414,13 +8362,13 @@ "url": "https://feross.org/support" } ], - "optional": true + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "optional": true + "license": "MIT" }, "node_modules/sax": { "version": "1.4.1", @@ -7431,7 +8379,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "optional": true, + "license": "ISC", "dependencies": { "xmlchars": "^2.2.0" }, @@ -7440,29 +8388,16 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dependencies": { - "loose-envify": "^1.1.0" - } - }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -7474,71 +8409,74 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", "optional": true }, "node_modules/sharp": { - "version": "0.33.4", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.4.tgz", - "integrity": "sha512-7i/dt5kGl7qR4gwPRD2biwD2/SvBn3O04J77XKFgL2OnZtQw+AG9wnuS/csmu80nPRHLYE9E41fyEiG8nhH6/Q==", + "version": "0.34.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.4.tgz", + "integrity": "sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==", "hasInstallScript": true, + "license": "Apache-2.0", "optional": true, "dependencies": { - "color": "^4.2.3", - "detect-libc": "^2.0.3", - "semver": "^7.6.0" + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.0", + "semver": "^7.7.2" }, "engines": { - "libvips": ">=8.15.2", "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.33.4", - "@img/sharp-darwin-x64": "0.33.4", - "@img/sharp-libvips-darwin-arm64": "1.0.2", - "@img/sharp-libvips-darwin-x64": "1.0.2", - "@img/sharp-libvips-linux-arm": "1.0.2", - "@img/sharp-libvips-linux-arm64": "1.0.2", - "@img/sharp-libvips-linux-s390x": "1.0.2", - "@img/sharp-libvips-linux-x64": "1.0.2", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.2", - "@img/sharp-libvips-linuxmusl-x64": "1.0.2", - "@img/sharp-linux-arm": "0.33.4", - "@img/sharp-linux-arm64": "0.33.4", - "@img/sharp-linux-s390x": "0.33.4", - "@img/sharp-linux-x64": "0.33.4", - "@img/sharp-linuxmusl-arm64": "0.33.4", - "@img/sharp-linuxmusl-x64": "0.33.4", - "@img/sharp-wasm32": "0.33.4", - "@img/sharp-win32-ia32": "0.33.4", - "@img/sharp-win32-x64": "0.33.4" + "@img/sharp-darwin-arm64": "0.34.4", + "@img/sharp-darwin-x64": "0.34.4", + "@img/sharp-libvips-darwin-arm64": "1.2.3", + "@img/sharp-libvips-darwin-x64": "1.2.3", + "@img/sharp-libvips-linux-arm": "1.2.3", + "@img/sharp-libvips-linux-arm64": "1.2.3", + "@img/sharp-libvips-linux-ppc64": "1.2.3", + "@img/sharp-libvips-linux-s390x": "1.2.3", + "@img/sharp-libvips-linux-x64": "1.2.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.3", + "@img/sharp-libvips-linuxmusl-x64": "1.2.3", + "@img/sharp-linux-arm": "0.34.4", + "@img/sharp-linux-arm64": "0.34.4", + "@img/sharp-linux-ppc64": "0.34.4", + "@img/sharp-linux-s390x": "0.34.4", + "@img/sharp-linux-x64": "0.34.4", + "@img/sharp-linuxmusl-arm64": "0.34.4", + "@img/sharp-linuxmusl-x64": "0.34.4", + "@img/sharp-wasm32": "0.34.4", + "@img/sharp-win32-arm64": "0.34.4", + "@img/sharp-win32-ia32": "0.34.4", + "@img/sharp-win32-x64": "0.34.4" } }, "node_modules/shiki": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.22.2.tgz", - "integrity": "sha512-3IZau0NdGKXhH2bBlUk4w1IHNxPh6A5B2sUpyY+8utLu2j/h1QpFkAaUA1bAMxOWWGtTWcAh531vnS4NJKS/lA==", - "dependencies": { - "@shikijs/core": "1.22.2", - "@shikijs/engine-javascript": "1.22.2", - "@shikijs/engine-oniguruma": "1.22.2", - "@shikijs/types": "1.22.2", - "@shikijs/vscode-textmate": "^9.3.0", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.15.0.tgz", + "integrity": "sha512-kLdkY6iV3dYbtPwS9KXU7mjfmDm25f5m0IPNFnaXO7TBPcvbUOY72PYXSuSqDzwp+vlH/d7MXpHlKO/x+QoLXw==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "3.15.0", + "@shikijs/engine-javascript": "3.15.0", + "@shikijs/engine-oniguruma": "3.15.0", + "@shikijs/langs": "3.15.0", + "@shikijs/themes": "3.15.0", + "@shikijs/types": "3.15.0", + "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC", + "optional": true }, "node_modules/simple-concat": { "version": "1.0.1", @@ -7558,15 +8496,31 @@ "url": "https://feross.org/support" } ], - "optional": true + "license": "MIT" }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "optional": true, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", "dependencies": { - "is-arrayish": "^0.3.1" + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" } }, "node_modules/sisteransi": { @@ -7575,9 +8529,9 @@ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/sitemap": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.2.tgz", - "integrity": "sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.0.tgz", + "integrity": "sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==", "dependencies": { "@types/node": "^17.0.5", "@types/sax": "^1.2.1", @@ -7588,8 +8542,8 @@ "sitemap": "dist/cli.js" }, "engines": { - "node": ">=12.0.0", - "npm": ">=5.6.0" + "node": ">=14.0.0", + "npm": ">=6.0.0" } }, "node_modules/sitemap/node_modules/@types/node": { @@ -7597,10 +8551,23 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" }, + "node_modules/smol-toml": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", + "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "optional": true, "engines": { "node": ">=0.10.0" @@ -7624,37 +8591,21 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, "node_modules/starlight-typedoc": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/starlight-typedoc/-/starlight-typedoc-0.17.0.tgz", - "integrity": "sha512-7ARUGo45ZWfAF5UI5HLLmLFGlMYdWW27Xfqcm4PBgcjZaGnEeEayqbusqc+5qAX46R5gzJ9ei8fxfMKZWMtgqg==", - "dev": true, + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/starlight-typedoc/-/starlight-typedoc-0.21.4.tgz", + "integrity": "sha512-ZnajyNs3CxzaDrKplBY9Lg4R12YheegCvbD2cvczN+8fLET0Rh3sss5mMN206pk8pVXeZgjPY5IATPJoCjjHqA==", + "license": "MIT", "dependencies": { - "github-slugger": "2.0.0" + "github-slugger": "^2.0.0" }, "engines": { - "node": ">=18.14.1" + "node": ">=18.17.1" }, "peerDependencies": { - "@astrojs/starlight": ">=0.25.0", - "typedoc": ">=0.26.5", - "typedoc-plugin-markdown": ">=4.1.1" - } - }, - "node_modules/stdin-discarder": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", - "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@astrojs/starlight": ">=0.32.0", + "typedoc": ">=0.28.0", + "typedoc-plugin-markdown": ">=4.6.0" } }, "node_modules/stream-replace-string": { @@ -7666,7 +8617,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } @@ -7716,18 +8667,11 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7737,24 +8681,35 @@ "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==" }, + "node_modules/style-to-js": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.19.tgz", + "integrity": "sha512-Ev+SgeqiNGT1ufsXyVC5RrJRXdrkRJ1Gol9Qw7Pb72YCKJXrBvP0ckZhBeVSrw2m06DJpei2528uIpjMb4TsoQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.12" + } + }, "node_modules/style-to-object": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz", - "integrity": "sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.12.tgz", + "integrity": "sha512-ddJqYnoT4t97QvN2C95bCgt+m7AAgXjVnkk/jxAfmp7EAB8nnqqZYEbMd3em7/vEomDb2LAQKAy1RFfv41mdNw==", + "license": "MIT", "dependencies": { - "inline-style-parser": "0.2.4" + "inline-style-parser": "0.2.6" } }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "optional": true + "license": "MIT" }, "node_modules/tar": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", "optional": true, "dependencies": { "chownr": "^2.0.0", @@ -7768,10 +8723,39 @@ "node": ">=10" } }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tar/node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", "optional": true, "engines": { "node": ">=10" @@ -7781,6 +8765,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", "optional": true }, "node_modules/thememirror": { @@ -7793,10 +8778,83 @@ "@codemirror/view": "^6.0.0" } }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, "node_modules/tinyexec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", - "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", "license": "MIT" }, "node_modules/to-regex-range": { @@ -7811,30 +8869,27 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "optional": true, + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "license": "BSD-3-Clause", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "optional": true, + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "license": "MIT", "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/trim-lines": { @@ -7856,9 +8911,9 @@ } }, "node_modules/tsconfck": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.4.tgz", - "integrity": "sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", + "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==", "license": "MIT", "bin": { "tsconfck": "bin/tsconfck.js" @@ -7876,10 +8931,22 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "optional": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } }, "node_modules/type-fest": { "version": "4.26.1", @@ -7894,49 +8961,55 @@ } }, "node_modules/typedoc": { - "version": "0.26.5", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.5.tgz", - "integrity": "sha512-Vn9YKdjKtDZqSk+by7beZ+xzkkr8T8CYoiasqyt4TTRFy5+UHzL/mF/o4wGBjRF+rlWQHDb0t6xCpA3JNL5phg==", + "version": "0.28.11", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.11.tgz", + "integrity": "sha512-1FqgrrUYGNuE3kImAiEDgAVVVacxdO4ZVTKbiOVDGkoeSB4sNwQaDpa8mta+Lw5TEzBFmGXzsg0I1NLRIoaSFw==", + "license": "Apache-2.0", + "peer": true, "dependencies": { + "@gerrit0/mini-shiki": "^3.9.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", - "shiki": "^1.9.1", - "yaml": "^2.4.5" + "yaml": "^2.8.0" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 18" + "node": ">= 18", + "pnpm": ">= 10" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x" } }, "node_modules/typedoc-plugin-markdown": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.1.1.tgz", - "integrity": "sha512-ZQv8FXn1TBZAvhWMgOL8hE472rwv1dzSr/KIIUGPmdNXybeS6jmK7d1OwKhorLuGbPDQGl6U97BwfkFTcydAkw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.7.0.tgz", + "integrity": "sha512-PitbnAps2vpcqK2gargKoiFXLWFttvwUbyns/E6zGIFG5Gz8ZQJGttHnYR9csOlcSjB/uyjd8tnoayrtsXG17w==", + "license": "MIT", + "peer": true, "engines": { "node": ">= 18" }, "peerDependencies": { - "typedoc": "0.26.x" + "typedoc": "0.28.x" } }, "node_modules/typedoc-plugin-no-inherit": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-no-inherit/-/typedoc-plugin-no-inherit-1.4.0.tgz", - "integrity": "sha512-cAvqQ8X9xh1xztVoDKtF4nYRSBx9XwttN3OBbNNpA0YaJSRM8XvpVVhugq8FoO1HdWjF3aizS0JzdUOMDt0y9g==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-no-inherit/-/typedoc-plugin-no-inherit-1.6.1.tgz", + "integrity": "sha512-+qf0RkO5YR9kUBBS1HqzzDOsWOnLcXTtGL0f2ia4jDQAjGrtF0+po/0R8k3UNtBqyDzL273aaV3FIGHEX+U/tg==", "peerDependencies": { - "typedoc": ">=0.23.0" + "typedoc": "0.26.x || 0.27.x || 0.28.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -7964,6 +9037,8 @@ "version": "5.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7985,15 +9060,48 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==" }, + "node_modules/ufo": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "license": "MIT" + }, "node_modules/ultrahtml": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", - "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.6.0.tgz", + "integrity": "sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==" + }, + "node_modules/uncrypto": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", + "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", + "license": "MIT" }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "license": "MIT" + }, + "node_modules/unicode-properties": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", + "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.0", + "unicode-trie": "^2.0.0" + } + }, + "node_modules/unicode-trie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", + "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", + "license": "MIT", + "dependencies": { + "pako": "^0.2.5", + "tiny-inflate": "^1.0.0" + } }, "node_modules/unified": { "version": "11.0.5", @@ -8013,6 +9121,17 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unifont": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/unifont/-/unifont-0.6.0.tgz", + "integrity": "sha512-5Fx50fFQMQL5aeHyWnZX9122sSLckcDvcfFiBf3QYeHa7a1MKJooUy52b67moi2MJYkrfo/TWY+CoLdr/w0tTA==", + "license": "MIT", + "dependencies": { + "css-tree": "^3.0.0", + "ofetch": "^1.4.1", + "ohash": "^2.0.0" + } + }, "node_modules/unist-util-find-after": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz", @@ -8067,6 +9186,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", + "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" }, @@ -8143,15 +9263,16 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "license": "MIT", "optional": true, "engines": { "node": ">= 4.0.0" } }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", "funding": [ { "type": "opencollective", @@ -8166,9 +9287,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -8181,6 +9303,7 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", "optional": true, "dependencies": { "querystringify": "^2.1.1", @@ -8233,20 +9356,24 @@ } }, "node_modules/vite": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", - "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", + "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "license": "MIT", + "peer": true, "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -8255,19 +9382,25 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", - "terser": "^5.4.0" + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "jiti": { + "optional": true + }, "less": { "optional": true }, @@ -8288,20 +9421,54 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/fdir": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", + "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true } } }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/vitefu": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.3.tgz", - "integrity": "sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.1.tgz", + "integrity": "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==", "license": "MIT", "workspaces": [ "tests/deps/*", - "tests/projects/*" + "tests/projects/*", + "tests/projects/workspace/packages/*" ], "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "peerDependenciesMeta": { "vite": { @@ -8534,15 +9701,15 @@ "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", - "optional": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "license": "MIT", "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/web-namespaces": { @@ -8558,60 +9725,50 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "optional": true, + "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "optional": true, + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "optional": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", - "optional": true, + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "license": "MIT", "dependencies": { - "tr46": "^3.0.0", + "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" - } - }, - "node_modules/which-pm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-3.0.0.tgz", - "integrity": "sha512-ysVYmw6+ZBhx3+ZkcPwRuJi38ZOTLJJ33PSHaitLxSKUMsh0LkKd0nC69zZCwt5D+AYUcMK2hhw4yWny20vSGg==", - "dependencies": { - "load-yaml-file": "^0.2.0" - }, - "engines": { - "node": ">=18.12" + "node": ">=18" } }, "node_modules/which-pm-runs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -8620,6 +9777,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", "optional": true, "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" @@ -8629,6 +9787,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -8638,12 +9797,14 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", "optional": true }, "node_modules/wide-align/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "optional": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -8658,6 +9819,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -8714,13 +9876,13 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "optional": true + "license": "ISC" }, "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", - "optional": true, + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -8738,24 +9900,25 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "optional": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "license": "Apache-2.0", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "optional": true + "license": "MIT" }, "node_modules/xxhash-wasm": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz", - "integrity": "sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz", + "integrity": "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==", + "license": "MIT" }, "node_modules/y18n": { "version": "5.0.8", @@ -8768,17 +9931,19 @@ "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" }, "node_modules/yaml": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", - "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yaml-language-server": { @@ -8928,9 +10093,9 @@ } }, "node_modules/yocto-queue": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", - "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", "engines": { "node": ">=12.20" }, @@ -8938,20 +10103,50 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yocto-spinner": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/yocto-spinner/-/yocto-spinner-0.2.3.tgz", + "integrity": "sha512-sqBChb33loEnkoXte1bLg45bEBsOP9N1kzQh5JZNKj/0rik4zAPTNSAVPj3uQAdc6slYJ0Ksc403G2XgxsJQFQ==", + "license": "MIT", + "dependencies": { + "yoctocolors": "^2.1.1" + }, + "engines": { + "node": ">=18.19" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yoctocolors": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", + "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zod-to-json-schema": { - "version": "3.23.5", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.23.5.tgz", - "integrity": "sha512-5wlSS0bXfF/BrL4jPAbz9da5hDlDptdEppYfe+x4eIJ7jioqKG9uUxOwPzqof09u/XeVdrgFu29lZi+8XNDJtA==", + "version": "3.24.6", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.6.tgz", + "integrity": "sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg==", + "license": "ISC", "peerDependencies": { - "zod": "^3.23.3" + "zod": "^3.24.1" } }, "node_modules/zod-to-ts": { diff --git a/package.json b/package.json index 41745b863..f84559344 100644 --- a/package.json +++ b/package.json @@ -10,33 +10,36 @@ "astro": "astro" }, "dependencies": { - "@astrojs/check": "^0.9.4", - "@astrojs/mdx": "^3.1.9", - "@astrojs/react": "^3.6.2", - "@astrojs/starlight": "^0.29.0", + "@astrojs/check": "^0.9.5", + "@astrojs/mdx": "^4.3.10", + "@astrojs/react": "^4.4.2", + "@astrojs/sitemap": "^3.6.0", + "@astrojs/starlight": "^0.36.2", "@codemirror/lang-javascript": "^6.2.2", "@codemirror/state": "^6.4.1", "@types/jsdom": "^21.1.6", - "@types/react": "^18.2.65", - "@types/react-dom": "^18.2.22", - "astro": "^4.16.10", + "@types/node": "^24.3.0", + "@types/react": "^18.x", + "@types/react-dom": "^18.x", + "astro": "^5.15.8", + "canvas": "^3.2.0", "codemirror": "^6.0.1", - "fabric": "^6.4.3", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-helmet": "^6.1.0", - "react-load-script": "^0.0.6", + "fabric": "^6.9.0", + "jsdom": "^26.1.0", + "prettier": "^3.4.2", + "react": "19.2", + "react-dom": "19.2", + "starlight-typedoc": "^0.21.4", "thememirror": "^2.0.1", - "typedoc": "^0.26.2", - "typedoc-plugin-markdown": "^4.1.1", - "typedoc-plugin-no-inherit": "^1.4.0", + "typedoc-plugin-no-inherit": "^1.6.1", "typescript": "^5.4.2" }, "engines": { - "node": "^18.17.1 || ^20.3.0" + "node": "^20.3.0 || ^22.16.0 || ^24.8.0" }, "packageManager": "npm@10.8.1+sha512.0e9d42e92bd2318408ed81eaff2da5f78baf23ee7d12a6eed44a6e2901d0f29d7ab715d1b918ade601f72e769a824d9a5c322383f22bbbda5dd396e79de2a077", "devDependencies": { - "starlight-typedoc": "^0.17.0" + "typedoc": "^0.28.11", + "typedoc-plugin-markdown": "^4.7.0" } } diff --git a/public/article_assets/cache_compare.png b/public/article_assets/cache_compare.png new file mode 100644 index 000000000..9a38a0922 Binary files /dev/null and b/public/article_assets/cache_compare.png differ diff --git a/public/article_assets/cache_min.png b/public/article_assets/cache_min.png new file mode 100644 index 000000000..78dd620b3 Binary files /dev/null and b/public/article_assets/cache_min.png differ diff --git a/public/article_assets/cache_normal.png b/public/article_assets/cache_normal.png new file mode 100644 index 000000000..4aa4fd4cc Binary files /dev/null and b/public/article_assets/cache_normal.png differ diff --git a/public/article_assets/cache_triangle.png b/public/article_assets/cache_triangle.png new file mode 100644 index 000000000..20a6a6aa7 Binary files /dev/null and b/public/article_assets/cache_triangle.png differ diff --git a/public/article_assets/triangle_rotated_cache.png b/public/article_assets/triangle_rotated_cache.png new file mode 100644 index 000000000..204296978 Binary files /dev/null and b/public/article_assets/triangle_rotated_cache.png differ diff --git a/public/article_assets/uncached_normal.png b/public/article_assets/uncached_normal.png new file mode 100644 index 000000000..c5356f9ff Binary files /dev/null and b/public/article_assets/uncached_normal.png differ diff --git a/public/google05bdc2e64ea9b7f6.html b/public/google05bdc2e64ea9b7f6.html new file mode 100644 index 000000000..7d1089303 --- /dev/null +++ b/public/google05bdc2e64ea9b7f6.html @@ -0,0 +1 @@ +google-site-verification: google05bdc2e64ea9b7f6.html \ No newline at end of file diff --git a/public/logos/automatio.ai.webp b/public/logos/automatio.ai.webp new file mode 100644 index 000000000..ac4f8be94 Binary files /dev/null and b/public/logos/automatio.ai.webp differ diff --git a/public/logos/rembg.webp b/public/logos/rembg.webp new file mode 100644 index 000000000..d5fe82b99 Binary files /dev/null and b/public/logos/rembg.webp differ diff --git a/public/logos/warp.webp b/public/logos/warp.webp new file mode 100644 index 000000000..de696824b Binary files /dev/null and b/public/logos/warp.webp differ diff --git a/public/logos/zaparoo.webp b/public/logos/zaparoo.webp new file mode 100644 index 000000000..34e978c7b Binary files /dev/null and b/public/logos/zaparoo.webp differ diff --git a/public/site_assets/big-buck-bunny.mp4 b/public/site_assets/big-buck-bunny.mp4 new file mode 100644 index 000000000..d76ec3801 Binary files /dev/null and b/public/site_assets/big-buck-bunny.mp4 differ diff --git a/public/site_assets/dizzy.mp4 b/public/site_assets/dizzy.mp4 new file mode 100644 index 000000000..c4625d877 Binary files /dev/null and b/public/site_assets/dizzy.mp4 differ diff --git a/public/site_assets/tiger2.svg b/public/site_assets/tiger2.svg new file mode 100644 index 000000000..2d62dc525 --- /dev/null +++ b/public/site_assets/tiger2.svg @@ -0,0 +1,640 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/CarbonAd/InlineCarbonAd.astro b/src/components/CarbonAd/InlineCarbonAd.astro new file mode 100644 index 000000000..2408a9318 --- /dev/null +++ b/src/components/CarbonAd/InlineCarbonAd.astro @@ -0,0 +1,19 @@ +--- +import CarbonAdReminder from './InlineCarbonAdReminder'; +import './InlineCarbonAd.css' + +const props = Astro.props +--- + +
+
+ + - + {canvasDown || children}
- + {canvasDown && children}
); diff --git a/src/components/Companies/Companies.astro b/src/components/Companies/Companies.astro new file mode 100644 index 000000000..6f0a4017e --- /dev/null +++ b/src/components/Companies/Companies.astro @@ -0,0 +1,38 @@ +--- +import './companies.css'; + +const logos = [ + { + link: 'https://automatio.ai', + description: 'Automatio AI', + logo: '/logos/automatio.ai.webp', + }, + { + link: 'https://zaparoo.org/', + description: 'Zaparoo', + logo: '/logos/zaparoo.webp', + }, + { + link: 'https://www.rembg.com/en/apps', + description: 'www.rembg.com', + logo: '/logos/rembg.webp', + }, + { + link: 'https://go.warp.dev/fabric', + description: 'Warp, built for coding with multiple AI agents', + logo: '/logos/warp.webp', + } +] + +--- +
+

Companies using Fabric.js

+
+ {logos.map((logo) => +
+ Company logo +
+

{logo.description}

+
)} +
+
diff --git a/src/components/Companies/companies.css b/src/components/Companies/companies.css new file mode 100644 index 000000000..219fc20ba --- /dev/null +++ b/src/components/Companies/companies.css @@ -0,0 +1,37 @@ +#companies { + display: flex; + flex-direction: column; + align-items: center; + justify-items: center; +} + +#companies #logos { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; + row-gap: 16px; + align-items: center; +} + +#companies a { + justify-content: space-around; + width: 220px; + display: flex; + flex-direction: column; + align-items: center; +} + +#companies .imageContainer { + height: 180px; + width: 180px; + display: flex; + flex-direction: row; + align-items: center; +} + +#companies a img { + max-width: 100%; + display: flex; + justify-content: space-around; +} diff --git a/src/components/ContributorCard/ContributorCard.astro b/src/components/ContributorCard/ContributorCard.astro index 6d0f4e71a..b5588233c 100644 --- a/src/components/ContributorCard/ContributorCard.astro +++ b/src/components/ContributorCard/ContributorCard.astro @@ -14,11 +14,10 @@ const { name, picUrl, url } = Astro.props; rel="noreferrer" target="_blank" href={url} - draggable="false" ondragstart="return false;" > - {name} + {`Profile

{name}

diff --git a/src/components/ContributorCard/contributorCard.css b/src/components/ContributorCard/contributorCard.css index b27b2e9eb..505dfeaa5 100644 --- a/src/components/ContributorCard/contributorCard.css +++ b/src/components/ContributorCard/contributorCard.css @@ -1,15 +1,11 @@ .contributorCard { text-align: center; width: 47%; + max-width: 200px; } .contributorCard img { border-radius: 50%; width: 90%; + height: auto; } - -@media (min-width: 400px) { - .contributorCard { - width: 200px; - } -} \ No newline at end of file diff --git a/src/components/ContributorsList/ContributorsList.astro b/src/components/ContributorsList/ContributorsList.astro index 3f3db3071..924a8c6e4 100644 --- a/src/components/ContributorsList/ContributorsList.astro +++ b/src/components/ContributorsList/ContributorsList.astro @@ -7,7 +7,7 @@ import ContributorCard from '../ContributorCard/ContributorCard.astro';

Contributors

- {list.map(({ login, avatar_url, html_url }) => ( + {list.slice(0, 60).map(({ login, avatar_url, html_url }) => ( +

Contributors

+ +
+ {list.map(({ login, avatar_url, html_url }) => ( + + ))} +
+ \ No newline at end of file diff --git a/src/components/ContributorsList/contributorsList.css b/src/components/ContributorsList/contributorsList.css index ebd77b65f..f418a7885 100644 --- a/src/components/ContributorsList/contributorsList.css +++ b/src/components/ContributorsList/contributorsList.css @@ -1,8 +1,8 @@ .contributor-container { - width: 100%; - display: flex; - flex-wrap: wrap; - justify-content: space-between; + width: 100%; + display: flex; + flex-wrap: wrap; + justify-content: space-around; } #contributors { @@ -10,4 +10,4 @@ flex-direction: column; align-items: center; justify-items: center; -} \ No newline at end of file +} diff --git a/src/components/ContributorsList/data.js b/src/components/ContributorsList/data.js index 6c69b3aca..1857cf204 100644 --- a/src/components/ContributorsList/data.js +++ b/src/components/ContributorsList/data.js @@ -1,6 +1,7 @@ // how to update the data: // paste this link in your browser: -// https://api.github.com/repos/fabricjs/fabric.js/contributors +// https://api.github.com/repos/fabricjs/fabric.js/contributors?page=1&per_page=100 +// https://api.github.com/repos/fabricjs/fabric.js/contributors?page=2&per_page=100 // then copy paste the result down here: export const list = [ @@ -22,6 +23,7 @@ export const list = [ "events_url": "https://api.github.com/users/kangax/events{/privacy}", "received_events_url": "https://api.github.com/users/kangax/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 2000 }, @@ -43,8 +45,9 @@ export const list = [ "events_url": "https://api.github.com/users/asturur/events{/privacy}", "received_events_url": "https://api.github.com/users/asturur/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, - "contributions": 1574 + "contributions": 1664 }, { "login": "ShaMan123", @@ -64,6 +67,7 @@ export const list = [ "events_url": "https://api.github.com/users/ShaMan123/events{/privacy}", "received_events_url": "https://api.github.com/users/ShaMan123/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 343 }, @@ -85,9 +89,32 @@ export const list = [ "events_url": "https://api.github.com/users/Kienz/events{/privacy}", "received_events_url": "https://api.github.com/users/Kienz/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 196 }, + { + "login": "Smrtnyk", + "id": 31451544, + "node_id": "MDQ6VXNlcjMxNDUxNTQ0", + "avatar_url": "https://avatars.githubusercontent.com/u/31451544?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Smrtnyk", + "html_url": "https://github.com/Smrtnyk", + "followers_url": "https://api.github.com/users/Smrtnyk/followers", + "following_url": "https://api.github.com/users/Smrtnyk/following{/other_user}", + "gists_url": "https://api.github.com/users/Smrtnyk/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Smrtnyk/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Smrtnyk/subscriptions", + "organizations_url": "https://api.github.com/users/Smrtnyk/orgs", + "repos_url": "https://api.github.com/users/Smrtnyk/repos", + "events_url": "https://api.github.com/users/Smrtnyk/events{/privacy}", + "received_events_url": "https://api.github.com/users/Smrtnyk/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 73 + }, { "login": "GordoRank", "id": 6388079, @@ -106,6 +133,7 @@ export const list = [ "events_url": "https://api.github.com/users/GordoRank/events{/privacy}", "received_events_url": "https://api.github.com/users/GordoRank/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 50 }, @@ -127,6 +155,7 @@ export const list = [ "events_url": "https://api.github.com/users/inssein/events{/privacy}", "received_events_url": "https://api.github.com/users/inssein/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 40 }, @@ -148,6 +177,7 @@ export const list = [ "events_url": "https://api.github.com/users/twffy/events{/privacy}", "received_events_url": "https://api.github.com/users/twffy/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 39 }, @@ -169,8 +199,9 @@ export const list = [ "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", + "user_view_type": "public", "site_admin": false, - "contributions": 27 + "contributions": 28 }, { "login": "rodovich", @@ -190,6 +221,7 @@ export const list = [ "events_url": "https://api.github.com/users/rodovich/events{/privacy}", "received_events_url": "https://api.github.com/users/rodovich/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 25 }, @@ -211,30 +243,10 @@ export const list = [ "events_url": "https://api.github.com/users/garg/events{/privacy}", "received_events_url": "https://api.github.com/users/garg/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 20 }, - { - "login": "jiayihu", - "id": 10067273, - "node_id": "MDQ6VXNlcjEwMDY3Mjcz", - "avatar_url": "https://avatars.githubusercontent.com/u/10067273?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/jiayihu", - "html_url": "https://github.com/jiayihu", - "followers_url": "https://api.github.com/users/jiayihu/followers", - "following_url": "https://api.github.com/users/jiayihu/following{/other_user}", - "gists_url": "https://api.github.com/users/jiayihu/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jiayihu/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jiayihu/subscriptions", - "organizations_url": "https://api.github.com/users/jiayihu/orgs", - "repos_url": "https://api.github.com/users/jiayihu/repos", - "events_url": "https://api.github.com/users/jiayihu/events{/privacy}", - "received_events_url": "https://api.github.com/users/jiayihu/received_events", - "type": "User", - "site_admin": false, - "contributions": 19 - }, { "login": "sapics", "id": 11169954, @@ -253,6 +265,29 @@ export const list = [ "events_url": "https://api.github.com/users/sapics/events{/privacy}", "received_events_url": "https://api.github.com/users/sapics/received_events", "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 19 + }, + { + "login": "jiayihu", + "id": 10067273, + "node_id": "MDQ6VXNlcjEwMDY3Mjcz", + "avatar_url": "https://avatars.githubusercontent.com/u/10067273?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jiayihu", + "html_url": "https://github.com/jiayihu", + "followers_url": "https://api.github.com/users/jiayihu/followers", + "following_url": "https://api.github.com/users/jiayihu/following{/other_user}", + "gists_url": "https://api.github.com/users/jiayihu/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jiayihu/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jiayihu/subscriptions", + "organizations_url": "https://api.github.com/users/jiayihu/orgs", + "repos_url": "https://api.github.com/users/jiayihu/repos", + "events_url": "https://api.github.com/users/jiayihu/events{/privacy}", + "received_events_url": "https://api.github.com/users/jiayihu/received_events", + "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 19 }, @@ -274,6 +309,7 @@ export const list = [ "events_url": "https://api.github.com/users/stefanhayden/events{/privacy}", "received_events_url": "https://api.github.com/users/stefanhayden/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 18 }, @@ -295,6 +331,7 @@ export const list = [ "events_url": "https://api.github.com/users/melchiar/events{/privacy}", "received_events_url": "https://api.github.com/users/melchiar/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 17 }, @@ -316,9 +353,32 @@ export const list = [ "events_url": "https://api.github.com/users/davidjrice/events{/privacy}", "received_events_url": "https://api.github.com/users/davidjrice/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 15 }, + { + "login": "zhe-he", + "id": 11306583, + "node_id": "MDQ6VXNlcjExMzA2NTgz", + "avatar_url": "https://avatars.githubusercontent.com/u/11306583?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zhe-he", + "html_url": "https://github.com/zhe-he", + "followers_url": "https://api.github.com/users/zhe-he/followers", + "following_url": "https://api.github.com/users/zhe-he/following{/other_user}", + "gists_url": "https://api.github.com/users/zhe-he/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zhe-he/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zhe-he/subscriptions", + "organizations_url": "https://api.github.com/users/zhe-he/orgs", + "repos_url": "https://api.github.com/users/zhe-he/repos", + "events_url": "https://api.github.com/users/zhe-he/events{/privacy}", + "received_events_url": "https://api.github.com/users/zhe-he/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 14 + }, { "login": "sorich87", "id": 230367, @@ -337,6 +397,7 @@ export const list = [ "events_url": "https://api.github.com/users/sorich87/events{/privacy}", "received_events_url": "https://api.github.com/users/sorich87/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 12 }, @@ -358,6 +419,7 @@ export const list = [ "events_url": "https://api.github.com/users/sjpemberton/events{/privacy}", "received_events_url": "https://api.github.com/users/sjpemberton/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 11 }, @@ -379,6 +441,7 @@ export const list = [ "events_url": "https://api.github.com/users/KJTsanaktsidis/events{/privacy}", "received_events_url": "https://api.github.com/users/KJTsanaktsidis/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 10 }, @@ -400,6 +463,7 @@ export const list = [ "events_url": "https://api.github.com/users/rykerwilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/rykerwilliams/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 10 }, @@ -421,6 +485,7 @@ export const list = [ "events_url": "https://api.github.com/users/rockerBOO/events{/privacy}", "received_events_url": "https://api.github.com/users/rockerBOO/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 8 }, @@ -442,48 +507,29 @@ export const list = [ "events_url": "https://api.github.com/users/XhmikosR/events{/privacy}", "received_events_url": "https://api.github.com/users/XhmikosR/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 8 }, { - "login": "zhe-he", - "id": 11306583, - "node_id": "MDQ6VXNlcjExMzA2NTgz", - "avatar_url": "https://avatars.githubusercontent.com/u/11306583?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/zhe-he", - "html_url": "https://github.com/zhe-he", - "followers_url": "https://api.github.com/users/zhe-he/followers", - "following_url": "https://api.github.com/users/zhe-he/following{/other_user}", - "gists_url": "https://api.github.com/users/zhe-he/gists{/gist_id}", - "starred_url": "https://api.github.com/users/zhe-he/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/zhe-he/subscriptions", - "organizations_url": "https://api.github.com/users/zhe-he/orgs", - "repos_url": "https://api.github.com/users/zhe-he/repos", - "events_url": "https://api.github.com/users/zhe-he/events{/privacy}", - "received_events_url": "https://api.github.com/users/zhe-he/received_events", - "type": "User", - "site_admin": false, - "contributions": 8 - }, - { - "login": "timandres", - "id": 2037655, - "node_id": "MDQ6VXNlcjIwMzc2NTU=", - "avatar_url": "https://avatars.githubusercontent.com/u/2037655?v=4", + "login": "MeLight", + "id": 704484, + "node_id": "MDQ6VXNlcjcwNDQ4NA==", + "avatar_url": "https://avatars.githubusercontent.com/u/704484?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/timandres", - "html_url": "https://github.com/timandres", - "followers_url": "https://api.github.com/users/timandres/followers", - "following_url": "https://api.github.com/users/timandres/following{/other_user}", - "gists_url": "https://api.github.com/users/timandres/gists{/gist_id}", - "starred_url": "https://api.github.com/users/timandres/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/timandres/subscriptions", - "organizations_url": "https://api.github.com/users/timandres/orgs", - "repos_url": "https://api.github.com/users/timandres/repos", - "events_url": "https://api.github.com/users/timandres/events{/privacy}", - "received_events_url": "https://api.github.com/users/timandres/received_events", + "url": "https://api.github.com/users/MeLight", + "html_url": "https://github.com/MeLight", + "followers_url": "https://api.github.com/users/MeLight/followers", + "following_url": "https://api.github.com/users/MeLight/following{/other_user}", + "gists_url": "https://api.github.com/users/MeLight/gists{/gist_id}", + "starred_url": "https://api.github.com/users/MeLight/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/MeLight/subscriptions", + "organizations_url": "https://api.github.com/users/MeLight/orgs", + "repos_url": "https://api.github.com/users/MeLight/repos", + "events_url": "https://api.github.com/users/MeLight/events{/privacy}", + "received_events_url": "https://api.github.com/users/MeLight/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 7 }, @@ -505,69 +551,51 @@ export const list = [ "events_url": "https://api.github.com/users/gloriousjob/events{/privacy}", "received_events_url": "https://api.github.com/users/gloriousjob/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 7 }, { - "login": "MeLight", - "id": 704484, - "node_id": "MDQ6VXNlcjcwNDQ4NA==", - "avatar_url": "https://avatars.githubusercontent.com/u/704484?v=4", + "login": "timandres", + "id": 2037655, + "node_id": "MDQ6VXNlcjIwMzc2NTU=", + "avatar_url": "https://avatars.githubusercontent.com/u/2037655?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/MeLight", - "html_url": "https://github.com/MeLight", - "followers_url": "https://api.github.com/users/MeLight/followers", - "following_url": "https://api.github.com/users/MeLight/following{/other_user}", - "gists_url": "https://api.github.com/users/MeLight/gists{/gist_id}", - "starred_url": "https://api.github.com/users/MeLight/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/MeLight/subscriptions", - "organizations_url": "https://api.github.com/users/MeLight/orgs", - "repos_url": "https://api.github.com/users/MeLight/repos", - "events_url": "https://api.github.com/users/MeLight/events{/privacy}", - "received_events_url": "https://api.github.com/users/MeLight/received_events", + "url": "https://api.github.com/users/timandres", + "html_url": "https://github.com/timandres", + "followers_url": "https://api.github.com/users/timandres/followers", + "following_url": "https://api.github.com/users/timandres/following{/other_user}", + "gists_url": "https://api.github.com/users/timandres/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timandres/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timandres/subscriptions", + "organizations_url": "https://api.github.com/users/timandres/orgs", + "repos_url": "https://api.github.com/users/timandres/repos", + "events_url": "https://api.github.com/users/timandres/events{/privacy}", + "received_events_url": "https://api.github.com/users/timandres/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 7 }, { - "login": "zigotica", - "id": 178855, - "node_id": "MDQ6VXNlcjE3ODg1NQ==", - "avatar_url": "https://avatars.githubusercontent.com/u/178855?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/zigotica", - "html_url": "https://github.com/zigotica", - "followers_url": "https://api.github.com/users/zigotica/followers", - "following_url": "https://api.github.com/users/zigotica/following{/other_user}", - "gists_url": "https://api.github.com/users/zigotica/gists{/gist_id}", - "starred_url": "https://api.github.com/users/zigotica/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/zigotica/subscriptions", - "organizations_url": "https://api.github.com/users/zigotica/orgs", - "repos_url": "https://api.github.com/users/zigotica/repos", - "events_url": "https://api.github.com/users/zigotica/events{/privacy}", - "received_events_url": "https://api.github.com/users/zigotica/received_events", - "type": "User", - "site_admin": false, - "contributions": 6 - }, - { - "login": "msievers", - "id": 156371, - "node_id": "MDQ6VXNlcjE1NjM3MQ==", - "avatar_url": "https://avatars.githubusercontent.com/u/156371?v=4", + "login": "jafferhaider", + "id": 793773, + "node_id": "MDQ6VXNlcjc5Mzc3Mw==", + "avatar_url": "https://avatars.githubusercontent.com/u/793773?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/msievers", - "html_url": "https://github.com/msievers", - "followers_url": "https://api.github.com/users/msievers/followers", - "following_url": "https://api.github.com/users/msievers/following{/other_user}", - "gists_url": "https://api.github.com/users/msievers/gists{/gist_id}", - "starred_url": "https://api.github.com/users/msievers/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/msievers/subscriptions", - "organizations_url": "https://api.github.com/users/msievers/orgs", - "repos_url": "https://api.github.com/users/msievers/repos", - "events_url": "https://api.github.com/users/msievers/events{/privacy}", - "received_events_url": "https://api.github.com/users/msievers/received_events", + "url": "https://api.github.com/users/jafferhaider", + "html_url": "https://github.com/jafferhaider", + "followers_url": "https://api.github.com/users/jafferhaider/followers", + "following_url": "https://api.github.com/users/jafferhaider/following{/other_user}", + "gists_url": "https://api.github.com/users/jafferhaider/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jafferhaider/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jafferhaider/subscriptions", + "organizations_url": "https://api.github.com/users/jafferhaider/orgs", + "repos_url": "https://api.github.com/users/jafferhaider/repos", + "events_url": "https://api.github.com/users/jafferhaider/events{/privacy}", + "received_events_url": "https://api.github.com/users/jafferhaider/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 6 }, @@ -589,27 +617,51 @@ export const list = [ "events_url": "https://api.github.com/users/miracle2k/events{/privacy}", "received_events_url": "https://api.github.com/users/miracle2k/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 6 }, { - "login": "jafferhaider", - "id": 793773, - "node_id": "MDQ6VXNlcjc5Mzc3Mw==", - "avatar_url": "https://avatars.githubusercontent.com/u/793773?v=4", + "login": "msievers", + "id": 156371, + "node_id": "MDQ6VXNlcjE1NjM3MQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/156371?v=4", "gravatar_id": "", - "url": "https://api.github.com/users/jafferhaider", - "html_url": "https://github.com/jafferhaider", - "followers_url": "https://api.github.com/users/jafferhaider/followers", - "following_url": "https://api.github.com/users/jafferhaider/following{/other_user}", - "gists_url": "https://api.github.com/users/jafferhaider/gists{/gist_id}", - "starred_url": "https://api.github.com/users/jafferhaider/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/jafferhaider/subscriptions", - "organizations_url": "https://api.github.com/users/jafferhaider/orgs", - "repos_url": "https://api.github.com/users/jafferhaider/repos", - "events_url": "https://api.github.com/users/jafferhaider/events{/privacy}", - "received_events_url": "https://api.github.com/users/jafferhaider/received_events", + "url": "https://api.github.com/users/msievers", + "html_url": "https://github.com/msievers", + "followers_url": "https://api.github.com/users/msievers/followers", + "following_url": "https://api.github.com/users/msievers/following{/other_user}", + "gists_url": "https://api.github.com/users/msievers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/msievers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/msievers/subscriptions", + "organizations_url": "https://api.github.com/users/msievers/orgs", + "repos_url": "https://api.github.com/users/msievers/repos", + "events_url": "https://api.github.com/users/msievers/events{/privacy}", + "received_events_url": "https://api.github.com/users/msievers/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 6 + }, + { + "login": "zigotica", + "id": 178855, + "node_id": "MDQ6VXNlcjE3ODg1NQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/178855?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zigotica", + "html_url": "https://github.com/zigotica", + "followers_url": "https://api.github.com/users/zigotica/followers", + "following_url": "https://api.github.com/users/zigotica/following{/other_user}", + "gists_url": "https://api.github.com/users/zigotica/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zigotica/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zigotica/subscriptions", + "organizations_url": "https://api.github.com/users/zigotica/orgs", + "repos_url": "https://api.github.com/users/zigotica/repos", + "events_url": "https://api.github.com/users/zigotica/events{/privacy}", + "received_events_url": "https://api.github.com/users/zigotica/received_events", "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 6 }, @@ -631,7 +683,3726 @@ export const list = [ "events_url": "https://api.github.com/users/baltauger/events{/privacy}", "received_events_url": "https://api.github.com/users/baltauger/received_events", "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "durga598", + "id": 7346576, + "node_id": "MDQ6VXNlcjczNDY1NzY=", + "avatar_url": "https://avatars.githubusercontent.com/u/7346576?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/durga598", + "html_url": "https://github.com/durga598", + "followers_url": "https://api.github.com/users/durga598/followers", + "following_url": "https://api.github.com/users/durga598/following{/other_user}", + "gists_url": "https://api.github.com/users/durga598/gists{/gist_id}", + "starred_url": "https://api.github.com/users/durga598/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/durga598/subscriptions", + "organizations_url": "https://api.github.com/users/durga598/orgs", + "repos_url": "https://api.github.com/users/durga598/repos", + "events_url": "https://api.github.com/users/durga598/events{/privacy}", + "received_events_url": "https://api.github.com/users/durga598/received_events", + "type": "User", + "user_view_type": "public", "site_admin": false, "contributions": 5 + }, + { + "login": "Incuuu", + "id": 9252506, + "node_id": "MDQ6VXNlcjkyNTI1MDY=", + "avatar_url": "https://avatars.githubusercontent.com/u/9252506?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Incuuu", + "html_url": "https://github.com/Incuuu", + "followers_url": "https://api.github.com/users/Incuuu/followers", + "following_url": "https://api.github.com/users/Incuuu/following{/other_user}", + "gists_url": "https://api.github.com/users/Incuuu/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Incuuu/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Incuuu/subscriptions", + "organizations_url": "https://api.github.com/users/Incuuu/orgs", + "repos_url": "https://api.github.com/users/Incuuu/repos", + "events_url": "https://api.github.com/users/Incuuu/events{/privacy}", + "received_events_url": "https://api.github.com/users/Incuuu/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "Lazauya", + "id": 12001517, + "node_id": "MDQ6VXNlcjEyMDAxNTE3", + "avatar_url": "https://avatars.githubusercontent.com/u/12001517?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Lazauya", + "html_url": "https://github.com/Lazauya", + "followers_url": "https://api.github.com/users/Lazauya/followers", + "following_url": "https://api.github.com/users/Lazauya/following{/other_user}", + "gists_url": "https://api.github.com/users/Lazauya/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Lazauya/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Lazauya/subscriptions", + "organizations_url": "https://api.github.com/users/Lazauya/orgs", + "repos_url": "https://api.github.com/users/Lazauya/repos", + "events_url": "https://api.github.com/users/Lazauya/events{/privacy}", + "received_events_url": "https://api.github.com/users/Lazauya/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "ncou", + "id": 16743322, + "node_id": "MDQ6VXNlcjE2NzQzMzIy", + "avatar_url": "https://avatars.githubusercontent.com/u/16743322?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ncou", + "html_url": "https://github.com/ncou", + "followers_url": "https://api.github.com/users/ncou/followers", + "following_url": "https://api.github.com/users/ncou/following{/other_user}", + "gists_url": "https://api.github.com/users/ncou/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ncou/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ncou/subscriptions", + "organizations_url": "https://api.github.com/users/ncou/orgs", + "repos_url": "https://api.github.com/users/ncou/repos", + "events_url": "https://api.github.com/users/ncou/events{/privacy}", + "received_events_url": "https://api.github.com/users/ncou/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "xxorax", + "id": 205049, + "node_id": "MDQ6VXNlcjIwNTA0OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/205049?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/xxorax", + "html_url": "https://github.com/xxorax", + "followers_url": "https://api.github.com/users/xxorax/followers", + "following_url": "https://api.github.com/users/xxorax/following{/other_user}", + "gists_url": "https://api.github.com/users/xxorax/gists{/gist_id}", + "starred_url": "https://api.github.com/users/xxorax/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/xxorax/subscriptions", + "organizations_url": "https://api.github.com/users/xxorax/orgs", + "repos_url": "https://api.github.com/users/xxorax/repos", + "events_url": "https://api.github.com/users/xxorax/events{/privacy}", + "received_events_url": "https://api.github.com/users/xxorax/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "gregtap", + "id": 26057, + "node_id": "MDQ6VXNlcjI2MDU3", + "avatar_url": "https://avatars.githubusercontent.com/u/26057?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gregtap", + "html_url": "https://github.com/gregtap", + "followers_url": "https://api.github.com/users/gregtap/followers", + "following_url": "https://api.github.com/users/gregtap/following{/other_user}", + "gists_url": "https://api.github.com/users/gregtap/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gregtap/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gregtap/subscriptions", + "organizations_url": "https://api.github.com/users/gregtap/orgs", + "repos_url": "https://api.github.com/users/gregtap/repos", + "events_url": "https://api.github.com/users/gregtap/events{/privacy}", + "received_events_url": "https://api.github.com/users/gregtap/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 5 + }, + { + "login": "luizzappa", + "id": 65685842, + "node_id": "MDQ6VXNlcjY1Njg1ODQy", + "avatar_url": "https://avatars.githubusercontent.com/u/65685842?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/luizzappa", + "html_url": "https://github.com/luizzappa", + "followers_url": "https://api.github.com/users/luizzappa/followers", + "following_url": "https://api.github.com/users/luizzappa/following{/other_user}", + "gists_url": "https://api.github.com/users/luizzappa/gists{/gist_id}", + "starred_url": "https://api.github.com/users/luizzappa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/luizzappa/subscriptions", + "organizations_url": "https://api.github.com/users/luizzappa/orgs", + "repos_url": "https://api.github.com/users/luizzappa/repos", + "events_url": "https://api.github.com/users/luizzappa/events{/privacy}", + "received_events_url": "https://api.github.com/users/luizzappa/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 4 + }, + { + "login": "shanawho", + "id": 2282524, + "node_id": "MDQ6VXNlcjIyODI1MjQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/2282524?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/shanawho", + "html_url": "https://github.com/shanawho", + "followers_url": "https://api.github.com/users/shanawho/followers", + "following_url": "https://api.github.com/users/shanawho/following{/other_user}", + "gists_url": "https://api.github.com/users/shanawho/gists{/gist_id}", + "starred_url": "https://api.github.com/users/shanawho/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/shanawho/subscriptions", + "organizations_url": "https://api.github.com/users/shanawho/orgs", + "repos_url": "https://api.github.com/users/shanawho/repos", + "events_url": "https://api.github.com/users/shanawho/events{/privacy}", + "received_events_url": "https://api.github.com/users/shanawho/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 4 + }, + { + "login": "dependabot[bot]", + "id": 49699333, + "node_id": "MDM6Qm90NDk2OTkzMzM=", + "avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dependabot%5Bbot%5D", + "html_url": "https://github.com/apps/dependabot", + "followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false, + "contributions": 4 + }, + { + "login": "boonkerz", + "id": 277321, + "node_id": "MDQ6VXNlcjI3NzMyMQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/277321?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/boonkerz", + "html_url": "https://github.com/boonkerz", + "followers_url": "https://api.github.com/users/boonkerz/followers", + "following_url": "https://api.github.com/users/boonkerz/following{/other_user}", + "gists_url": "https://api.github.com/users/boonkerz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/boonkerz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/boonkerz/subscriptions", + "organizations_url": "https://api.github.com/users/boonkerz/orgs", + "repos_url": "https://api.github.com/users/boonkerz/repos", + "events_url": "https://api.github.com/users/boonkerz/events{/privacy}", + "received_events_url": "https://api.github.com/users/boonkerz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 4 + }, + { + "login": "TomKaltz", + "id": 2965281, + "node_id": "MDQ6VXNlcjI5NjUyODE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2965281?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/TomKaltz", + "html_url": "https://github.com/TomKaltz", + "followers_url": "https://api.github.com/users/TomKaltz/followers", + "following_url": "https://api.github.com/users/TomKaltz/following{/other_user}", + "gists_url": "https://api.github.com/users/TomKaltz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/TomKaltz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/TomKaltz/subscriptions", + "organizations_url": "https://api.github.com/users/TomKaltz/orgs", + "repos_url": "https://api.github.com/users/TomKaltz/repos", + "events_url": "https://api.github.com/users/TomKaltz/events{/privacy}", + "received_events_url": "https://api.github.com/users/TomKaltz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "maxim", + "id": 7758, + "node_id": "MDQ6VXNlcjc3NTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/7758?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/maxim", + "html_url": "https://github.com/maxim", + "followers_url": "https://api.github.com/users/maxim/followers", + "following_url": "https://api.github.com/users/maxim/following{/other_user}", + "gists_url": "https://api.github.com/users/maxim/gists{/gist_id}", + "starred_url": "https://api.github.com/users/maxim/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/maxim/subscriptions", + "organizations_url": "https://api.github.com/users/maxim/orgs", + "repos_url": "https://api.github.com/users/maxim/repos", + "events_url": "https://api.github.com/users/maxim/events{/privacy}", + "received_events_url": "https://api.github.com/users/maxim/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "joshpearce", + "id": 1420169, + "node_id": "MDQ6VXNlcjE0MjAxNjk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1420169?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/joshpearce", + "html_url": "https://github.com/joshpearce", + "followers_url": "https://api.github.com/users/joshpearce/followers", + "following_url": "https://api.github.com/users/joshpearce/following{/other_user}", + "gists_url": "https://api.github.com/users/joshpearce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/joshpearce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/joshpearce/subscriptions", + "organizations_url": "https://api.github.com/users/joshpearce/orgs", + "repos_url": "https://api.github.com/users/joshpearce/repos", + "events_url": "https://api.github.com/users/joshpearce/events{/privacy}", + "received_events_url": "https://api.github.com/users/joshpearce/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "avra-m3", + "id": 14171749, + "node_id": "MDQ6VXNlcjE0MTcxNzQ5", + "avatar_url": "https://avatars.githubusercontent.com/u/14171749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/avra-m3", + "html_url": "https://github.com/avra-m3", + "followers_url": "https://api.github.com/users/avra-m3/followers", + "following_url": "https://api.github.com/users/avra-m3/following{/other_user}", + "gists_url": "https://api.github.com/users/avra-m3/gists{/gist_id}", + "starred_url": "https://api.github.com/users/avra-m3/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/avra-m3/subscriptions", + "organizations_url": "https://api.github.com/users/avra-m3/orgs", + "repos_url": "https://api.github.com/users/avra-m3/repos", + "events_url": "https://api.github.com/users/avra-m3/events{/privacy}", + "received_events_url": "https://api.github.com/users/avra-m3/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "jarek-itmore", + "id": 1212280, + "node_id": "MDQ6VXNlcjEyMTIyODA=", + "avatar_url": "https://avatars.githubusercontent.com/u/1212280?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jarek-itmore", + "html_url": "https://github.com/jarek-itmore", + "followers_url": "https://api.github.com/users/jarek-itmore/followers", + "following_url": "https://api.github.com/users/jarek-itmore/following{/other_user}", + "gists_url": "https://api.github.com/users/jarek-itmore/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jarek-itmore/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jarek-itmore/subscriptions", + "organizations_url": "https://api.github.com/users/jarek-itmore/orgs", + "repos_url": "https://api.github.com/users/jarek-itmore/repos", + "events_url": "https://api.github.com/users/jarek-itmore/events{/privacy}", + "received_events_url": "https://api.github.com/users/jarek-itmore/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "bbudd", + "id": 637211, + "node_id": "MDQ6VXNlcjYzNzIxMQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/637211?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bbudd", + "html_url": "https://github.com/bbudd", + "followers_url": "https://api.github.com/users/bbudd/followers", + "following_url": "https://api.github.com/users/bbudd/following{/other_user}", + "gists_url": "https://api.github.com/users/bbudd/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bbudd/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bbudd/subscriptions", + "organizations_url": "https://api.github.com/users/bbudd/orgs", + "repos_url": "https://api.github.com/users/bbudd/repos", + "events_url": "https://api.github.com/users/bbudd/events{/privacy}", + "received_events_url": "https://api.github.com/users/bbudd/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "aswind7", + "id": 12571054, + "node_id": "MDQ6VXNlcjEyNTcxMDU0", + "avatar_url": "https://avatars.githubusercontent.com/u/12571054?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/aswind7", + "html_url": "https://github.com/aswind7", + "followers_url": "https://api.github.com/users/aswind7/followers", + "following_url": "https://api.github.com/users/aswind7/following{/other_user}", + "gists_url": "https://api.github.com/users/aswind7/gists{/gist_id}", + "starred_url": "https://api.github.com/users/aswind7/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/aswind7/subscriptions", + "organizations_url": "https://api.github.com/users/aswind7/orgs", + "repos_url": "https://api.github.com/users/aswind7/repos", + "events_url": "https://api.github.com/users/aswind7/events{/privacy}", + "received_events_url": "https://api.github.com/users/aswind7/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "AlexSergey", + "id": 6189375, + "node_id": "MDQ6VXNlcjYxODkzNzU=", + "avatar_url": "https://avatars.githubusercontent.com/u/6189375?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/AlexSergey", + "html_url": "https://github.com/AlexSergey", + "followers_url": "https://api.github.com/users/AlexSergey/followers", + "following_url": "https://api.github.com/users/AlexSergey/following{/other_user}", + "gists_url": "https://api.github.com/users/AlexSergey/gists{/gist_id}", + "starred_url": "https://api.github.com/users/AlexSergey/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/AlexSergey/subscriptions", + "organizations_url": "https://api.github.com/users/AlexSergey/orgs", + "repos_url": "https://api.github.com/users/AlexSergey/repos", + "events_url": "https://api.github.com/users/AlexSergey/events{/privacy}", + "received_events_url": "https://api.github.com/users/AlexSergey/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "jedateach", + "id": 1356335, + "node_id": "MDQ6VXNlcjEzNTYzMzU=", + "avatar_url": "https://avatars.githubusercontent.com/u/1356335?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jedateach", + "html_url": "https://github.com/jedateach", + "followers_url": "https://api.github.com/users/jedateach/followers", + "following_url": "https://api.github.com/users/jedateach/following{/other_user}", + "gists_url": "https://api.github.com/users/jedateach/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jedateach/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jedateach/subscriptions", + "organizations_url": "https://api.github.com/users/jedateach/orgs", + "repos_url": "https://api.github.com/users/jedateach/repos", + "events_url": "https://api.github.com/users/jedateach/events{/privacy}", + "received_events_url": "https://api.github.com/users/jedateach/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "jasonsturges", + "id": 1213591, + "node_id": "MDQ6VXNlcjEyMTM1OTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1213591?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jasonsturges", + "html_url": "https://github.com/jasonsturges", + "followers_url": "https://api.github.com/users/jasonsturges/followers", + "following_url": "https://api.github.com/users/jasonsturges/following{/other_user}", + "gists_url": "https://api.github.com/users/jasonsturges/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jasonsturges/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jasonsturges/subscriptions", + "organizations_url": "https://api.github.com/users/jasonsturges/orgs", + "repos_url": "https://api.github.com/users/jasonsturges/repos", + "events_url": "https://api.github.com/users/jasonsturges/events{/privacy}", + "received_events_url": "https://api.github.com/users/jasonsturges/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "brianhernandez", + "id": 1489880, + "node_id": "MDQ6VXNlcjE0ODk4ODA=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489880?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/brianhernandez", + "html_url": "https://github.com/brianhernandez", + "followers_url": "https://api.github.com/users/brianhernandez/followers", + "following_url": "https://api.github.com/users/brianhernandez/following{/other_user}", + "gists_url": "https://api.github.com/users/brianhernandez/gists{/gist_id}", + "starred_url": "https://api.github.com/users/brianhernandez/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/brianhernandez/subscriptions", + "organizations_url": "https://api.github.com/users/brianhernandez/orgs", + "repos_url": "https://api.github.com/users/brianhernandez/repos", + "events_url": "https://api.github.com/users/brianhernandez/events{/privacy}", + "received_events_url": "https://api.github.com/users/brianhernandez/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "arcatdmz", + "id": 627194, + "node_id": "MDQ6VXNlcjYyNzE5NA==", + "avatar_url": "https://avatars.githubusercontent.com/u/627194?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/arcatdmz", + "html_url": "https://github.com/arcatdmz", + "followers_url": "https://api.github.com/users/arcatdmz/followers", + "following_url": "https://api.github.com/users/arcatdmz/following{/other_user}", + "gists_url": "https://api.github.com/users/arcatdmz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/arcatdmz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/arcatdmz/subscriptions", + "organizations_url": "https://api.github.com/users/arcatdmz/orgs", + "repos_url": "https://api.github.com/users/arcatdmz/repos", + "events_url": "https://api.github.com/users/arcatdmz/events{/privacy}", + "received_events_url": "https://api.github.com/users/arcatdmz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "jparkrr", + "id": 872456, + "node_id": "MDQ6VXNlcjg3MjQ1Ng==", + "avatar_url": "https://avatars.githubusercontent.com/u/872456?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jparkrr", + "html_url": "https://github.com/jparkrr", + "followers_url": "https://api.github.com/users/jparkrr/followers", + "following_url": "https://api.github.com/users/jparkrr/following{/other_user}", + "gists_url": "https://api.github.com/users/jparkrr/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jparkrr/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jparkrr/subscriptions", + "organizations_url": "https://api.github.com/users/jparkrr/orgs", + "repos_url": "https://api.github.com/users/jparkrr/repos", + "events_url": "https://api.github.com/users/jparkrr/events{/privacy}", + "received_events_url": "https://api.github.com/users/jparkrr/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "JSteunou", + "id": 2323127, + "node_id": "MDQ6VXNlcjIzMjMxMjc=", + "avatar_url": "https://avatars.githubusercontent.com/u/2323127?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/JSteunou", + "html_url": "https://github.com/JSteunou", + "followers_url": "https://api.github.com/users/JSteunou/followers", + "following_url": "https://api.github.com/users/JSteunou/following{/other_user}", + "gists_url": "https://api.github.com/users/JSteunou/gists{/gist_id}", + "starred_url": "https://api.github.com/users/JSteunou/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/JSteunou/subscriptions", + "organizations_url": "https://api.github.com/users/JSteunou/orgs", + "repos_url": "https://api.github.com/users/JSteunou/repos", + "events_url": "https://api.github.com/users/JSteunou/events{/privacy}", + "received_events_url": "https://api.github.com/users/JSteunou/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "nathan-muir", + "id": 3112329, + "node_id": "MDQ6VXNlcjMxMTIzMjk=", + "avatar_url": "https://avatars.githubusercontent.com/u/3112329?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nathan-muir", + "html_url": "https://github.com/nathan-muir", + "followers_url": "https://api.github.com/users/nathan-muir/followers", + "following_url": "https://api.github.com/users/nathan-muir/following{/other_user}", + "gists_url": "https://api.github.com/users/nathan-muir/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nathan-muir/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nathan-muir/subscriptions", + "organizations_url": "https://api.github.com/users/nathan-muir/orgs", + "repos_url": "https://api.github.com/users/nathan-muir/repos", + "events_url": "https://api.github.com/users/nathan-muir/events{/privacy}", + "received_events_url": "https://api.github.com/users/nathan-muir/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "nazar-pc", + "id": 928965, + "node_id": "MDQ6VXNlcjkyODk2NQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/928965?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nazar-pc", + "html_url": "https://github.com/nazar-pc", + "followers_url": "https://api.github.com/users/nazar-pc/followers", + "following_url": "https://api.github.com/users/nazar-pc/following{/other_user}", + "gists_url": "https://api.github.com/users/nazar-pc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nazar-pc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nazar-pc/subscriptions", + "organizations_url": "https://api.github.com/users/nazar-pc/orgs", + "repos_url": "https://api.github.com/users/nazar-pc/repos", + "events_url": "https://api.github.com/users/nazar-pc/events{/privacy}", + "received_events_url": "https://api.github.com/users/nazar-pc/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "paulkaplan", + "id": 654102, + "node_id": "MDQ6VXNlcjY1NDEwMg==", + "avatar_url": "https://avatars.githubusercontent.com/u/654102?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/paulkaplan", + "html_url": "https://github.com/paulkaplan", + "followers_url": "https://api.github.com/users/paulkaplan/followers", + "following_url": "https://api.github.com/users/paulkaplan/following{/other_user}", + "gists_url": "https://api.github.com/users/paulkaplan/gists{/gist_id}", + "starred_url": "https://api.github.com/users/paulkaplan/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/paulkaplan/subscriptions", + "organizations_url": "https://api.github.com/users/paulkaplan/orgs", + "repos_url": "https://api.github.com/users/paulkaplan/repos", + "events_url": "https://api.github.com/users/paulkaplan/events{/privacy}", + "received_events_url": "https://api.github.com/users/paulkaplan/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 3 + }, + { + "login": "ajvincent", + "id": 1527783, + "node_id": "MDQ6VXNlcjE1Mjc3ODM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1527783?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ajvincent", + "html_url": "https://github.com/ajvincent", + "followers_url": "https://api.github.com/users/ajvincent/followers", + "following_url": "https://api.github.com/users/ajvincent/following{/other_user}", + "gists_url": "https://api.github.com/users/ajvincent/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ajvincent/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ajvincent/subscriptions", + "organizations_url": "https://api.github.com/users/ajvincent/orgs", + "repos_url": "https://api.github.com/users/ajvincent/repos", + "events_url": "https://api.github.com/users/ajvincent/events{/privacy}", + "received_events_url": "https://api.github.com/users/ajvincent/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "sirrodgepodge", + "id": 7177292, + "node_id": "MDQ6VXNlcjcxNzcyOTI=", + "avatar_url": "https://avatars.githubusercontent.com/u/7177292?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/sirrodgepodge", + "html_url": "https://github.com/sirrodgepodge", + "followers_url": "https://api.github.com/users/sirrodgepodge/followers", + "following_url": "https://api.github.com/users/sirrodgepodge/following{/other_user}", + "gists_url": "https://api.github.com/users/sirrodgepodge/gists{/gist_id}", + "starred_url": "https://api.github.com/users/sirrodgepodge/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/sirrodgepodge/subscriptions", + "organizations_url": "https://api.github.com/users/sirrodgepodge/orgs", + "repos_url": "https://api.github.com/users/sirrodgepodge/repos", + "events_url": "https://api.github.com/users/sirrodgepodge/events{/privacy}", + "received_events_url": "https://api.github.com/users/sirrodgepodge/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "SLKnutson", + "id": 49452862, + "node_id": "MDQ6VXNlcjQ5NDUyODYy", + "avatar_url": "https://avatars.githubusercontent.com/u/49452862?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/SLKnutson", + "html_url": "https://github.com/SLKnutson", + "followers_url": "https://api.github.com/users/SLKnutson/followers", + "following_url": "https://api.github.com/users/SLKnutson/following{/other_user}", + "gists_url": "https://api.github.com/users/SLKnutson/gists{/gist_id}", + "starred_url": "https://api.github.com/users/SLKnutson/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/SLKnutson/subscriptions", + "organizations_url": "https://api.github.com/users/SLKnutson/orgs", + "repos_url": "https://api.github.com/users/SLKnutson/repos", + "events_url": "https://api.github.com/users/SLKnutson/events{/privacy}", + "received_events_url": "https://api.github.com/users/SLKnutson/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "Serene47", + "id": 24951939, + "node_id": "MDQ6VXNlcjI0OTUxOTM5", + "avatar_url": "https://avatars.githubusercontent.com/u/24951939?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Serene47", + "html_url": "https://github.com/Serene47", + "followers_url": "https://api.github.com/users/Serene47/followers", + "following_url": "https://api.github.com/users/Serene47/following{/other_user}", + "gists_url": "https://api.github.com/users/Serene47/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Serene47/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Serene47/subscriptions", + "organizations_url": "https://api.github.com/users/Serene47/orgs", + "repos_url": "https://api.github.com/users/Serene47/repos", + "events_url": "https://api.github.com/users/Serene47/events{/privacy}", + "received_events_url": "https://api.github.com/users/Serene47/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "StephanBijzitter", + "id": 1649903, + "node_id": "MDQ6VXNlcjE2NDk5MDM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1649903?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/StephanBijzitter", + "html_url": "https://github.com/StephanBijzitter", + "followers_url": "https://api.github.com/users/StephanBijzitter/followers", + "following_url": "https://api.github.com/users/StephanBijzitter/following{/other_user}", + "gists_url": "https://api.github.com/users/StephanBijzitter/gists{/gist_id}", + "starred_url": "https://api.github.com/users/StephanBijzitter/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/StephanBijzitter/subscriptions", + "organizations_url": "https://api.github.com/users/StephanBijzitter/orgs", + "repos_url": "https://api.github.com/users/StephanBijzitter/repos", + "events_url": "https://api.github.com/users/StephanBijzitter/events{/privacy}", + "received_events_url": "https://api.github.com/users/StephanBijzitter/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "timgates42", + "id": 47873678, + "node_id": "MDQ6VXNlcjQ3ODczNjc4", + "avatar_url": "https://avatars.githubusercontent.com/u/47873678?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timgates42", + "html_url": "https://github.com/timgates42", + "followers_url": "https://api.github.com/users/timgates42/followers", + "following_url": "https://api.github.com/users/timgates42/following{/other_user}", + "gists_url": "https://api.github.com/users/timgates42/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timgates42/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timgates42/subscriptions", + "organizations_url": "https://api.github.com/users/timgates42/orgs", + "repos_url": "https://api.github.com/users/timgates42/repos", + "events_url": "https://api.github.com/users/timgates42/events{/privacy}", + "received_events_url": "https://api.github.com/users/timgates42/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "TimNZ", + "id": 1051701, + "node_id": "MDQ6VXNlcjEwNTE3MDE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1051701?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/TimNZ", + "html_url": "https://github.com/TimNZ", + "followers_url": "https://api.github.com/users/TimNZ/followers", + "following_url": "https://api.github.com/users/TimNZ/following{/other_user}", + "gists_url": "https://api.github.com/users/TimNZ/gists{/gist_id}", + "starred_url": "https://api.github.com/users/TimNZ/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/TimNZ/subscriptions", + "organizations_url": "https://api.github.com/users/TimNZ/orgs", + "repos_url": "https://api.github.com/users/TimNZ/repos", + "events_url": "https://api.github.com/users/TimNZ/events{/privacy}", + "received_events_url": "https://api.github.com/users/TimNZ/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "travispaul", + "id": 2118993, + "node_id": "MDQ6VXNlcjIxMTg5OTM=", + "avatar_url": "https://avatars.githubusercontent.com/u/2118993?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/travispaul", + "html_url": "https://github.com/travispaul", + "followers_url": "https://api.github.com/users/travispaul/followers", + "following_url": "https://api.github.com/users/travispaul/following{/other_user}", + "gists_url": "https://api.github.com/users/travispaul/gists{/gist_id}", + "starred_url": "https://api.github.com/users/travispaul/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/travispaul/subscriptions", + "organizations_url": "https://api.github.com/users/travispaul/orgs", + "repos_url": "https://api.github.com/users/travispaul/repos", + "events_url": "https://api.github.com/users/travispaul/events{/privacy}", + "received_events_url": "https://api.github.com/users/travispaul/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "dersphere", + "id": 549063, + "node_id": "MDQ6VXNlcjU0OTA2Mw==", + "avatar_url": "https://avatars.githubusercontent.com/u/549063?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dersphere", + "html_url": "https://github.com/dersphere", + "followers_url": "https://api.github.com/users/dersphere/followers", + "following_url": "https://api.github.com/users/dersphere/following{/other_user}", + "gists_url": "https://api.github.com/users/dersphere/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dersphere/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dersphere/subscriptions", + "organizations_url": "https://api.github.com/users/dersphere/orgs", + "repos_url": "https://api.github.com/users/dersphere/repos", + "events_url": "https://api.github.com/users/dersphere/events{/privacy}", + "received_events_url": "https://api.github.com/users/dersphere/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "yassilah", + "id": 13403295, + "node_id": "MDQ6VXNlcjEzNDAzMjk1", + "avatar_url": "https://avatars.githubusercontent.com/u/13403295?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yassilah", + "html_url": "https://github.com/yassilah", + "followers_url": "https://api.github.com/users/yassilah/followers", + "following_url": "https://api.github.com/users/yassilah/following{/other_user}", + "gists_url": "https://api.github.com/users/yassilah/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yassilah/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yassilah/subscriptions", + "organizations_url": "https://api.github.com/users/yassilah/orgs", + "repos_url": "https://api.github.com/users/yassilah/repos", + "events_url": "https://api.github.com/users/yassilah/events{/privacy}", + "received_events_url": "https://api.github.com/users/yassilah/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "kingschnulli", + "id": 673805, + "node_id": "MDQ6VXNlcjY3MzgwNQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/673805?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kingschnulli", + "html_url": "https://github.com/kingschnulli", + "followers_url": "https://api.github.com/users/kingschnulli/followers", + "following_url": "https://api.github.com/users/kingschnulli/following{/other_user}", + "gists_url": "https://api.github.com/users/kingschnulli/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kingschnulli/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kingschnulli/subscriptions", + "organizations_url": "https://api.github.com/users/kingschnulli/orgs", + "repos_url": "https://api.github.com/users/kingschnulli/repos", + "events_url": "https://api.github.com/users/kingschnulli/events{/privacy}", + "received_events_url": "https://api.github.com/users/kingschnulli/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "by12", + "id": 16643776, + "node_id": "MDQ6VXNlcjE2NjQzNzc2", + "avatar_url": "https://avatars.githubusercontent.com/u/16643776?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/by12", + "html_url": "https://github.com/by12", + "followers_url": "https://api.github.com/users/by12/followers", + "following_url": "https://api.github.com/users/by12/following{/other_user}", + "gists_url": "https://api.github.com/users/by12/gists{/gist_id}", + "starred_url": "https://api.github.com/users/by12/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/by12/subscriptions", + "organizations_url": "https://api.github.com/users/by12/orgs", + "repos_url": "https://api.github.com/users/by12/repos", + "events_url": "https://api.github.com/users/by12/events{/privacy}", + "received_events_url": "https://api.github.com/users/by12/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "dennisrjohn", + "id": 8462346, + "node_id": "MDQ6VXNlcjg0NjIzNDY=", + "avatar_url": "https://avatars.githubusercontent.com/u/8462346?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dennisrjohn", + "html_url": "https://github.com/dennisrjohn", + "followers_url": "https://api.github.com/users/dennisrjohn/followers", + "following_url": "https://api.github.com/users/dennisrjohn/following{/other_user}", + "gists_url": "https://api.github.com/users/dennisrjohn/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dennisrjohn/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dennisrjohn/subscriptions", + "organizations_url": "https://api.github.com/users/dennisrjohn/orgs", + "repos_url": "https://api.github.com/users/dennisrjohn/repos", + "events_url": "https://api.github.com/users/dennisrjohn/events{/privacy}", + "received_events_url": "https://api.github.com/users/dennisrjohn/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "gordyr", + "id": 1015403, + "node_id": "MDQ6VXNlcjEwMTU0MDM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1015403?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gordyr", + "html_url": "https://github.com/gordyr", + "followers_url": "https://api.github.com/users/gordyr/followers", + "following_url": "https://api.github.com/users/gordyr/following{/other_user}", + "gists_url": "https://api.github.com/users/gordyr/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gordyr/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gordyr/subscriptions", + "organizations_url": "https://api.github.com/users/gordyr/orgs", + "repos_url": "https://api.github.com/users/gordyr/repos", + "events_url": "https://api.github.com/users/gordyr/events{/privacy}", + "received_events_url": "https://api.github.com/users/gordyr/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "keyurpatel", + "id": 2897751, + "node_id": "MDQ6VXNlcjI4OTc3NTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2897751?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/keyurpatel", + "html_url": "https://github.com/keyurpatel", + "followers_url": "https://api.github.com/users/keyurpatel/followers", + "following_url": "https://api.github.com/users/keyurpatel/following{/other_user}", + "gists_url": "https://api.github.com/users/keyurpatel/gists{/gist_id}", + "starred_url": "https://api.github.com/users/keyurpatel/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/keyurpatel/subscriptions", + "organizations_url": "https://api.github.com/users/keyurpatel/orgs", + "repos_url": "https://api.github.com/users/keyurpatel/repos", + "events_url": "https://api.github.com/users/keyurpatel/events{/privacy}", + "received_events_url": "https://api.github.com/users/keyurpatel/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "kibao", + "id": 1156678, + "node_id": "MDQ6VXNlcjExNTY2Nzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1156678?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kibao", + "html_url": "https://github.com/kibao", + "followers_url": "https://api.github.com/users/kibao/followers", + "following_url": "https://api.github.com/users/kibao/following{/other_user}", + "gists_url": "https://api.github.com/users/kibao/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kibao/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kibao/subscriptions", + "organizations_url": "https://api.github.com/users/kibao/orgs", + "repos_url": "https://api.github.com/users/kibao/repos", + "events_url": "https://api.github.com/users/kibao/events{/privacy}", + "received_events_url": "https://api.github.com/users/kibao/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "korzo89", + "id": 2965511, + "node_id": "MDQ6VXNlcjI5NjU1MTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2965511?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/korzo89", + "html_url": "https://github.com/korzo89", + "followers_url": "https://api.github.com/users/korzo89/followers", + "following_url": "https://api.github.com/users/korzo89/following{/other_user}", + "gists_url": "https://api.github.com/users/korzo89/gists{/gist_id}", + "starred_url": "https://api.github.com/users/korzo89/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/korzo89/subscriptions", + "organizations_url": "https://api.github.com/users/korzo89/orgs", + "repos_url": "https://api.github.com/users/korzo89/repos", + "events_url": "https://api.github.com/users/korzo89/events{/privacy}", + "received_events_url": "https://api.github.com/users/korzo89/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "llocust", + "id": 3769972, + "node_id": "MDQ6VXNlcjM3Njk5NzI=", + "avatar_url": "https://avatars.githubusercontent.com/u/3769972?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/llocust", + "html_url": "https://github.com/llocust", + "followers_url": "https://api.github.com/users/llocust/followers", + "following_url": "https://api.github.com/users/llocust/following{/other_user}", + "gists_url": "https://api.github.com/users/llocust/gists{/gist_id}", + "starred_url": "https://api.github.com/users/llocust/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/llocust/subscriptions", + "organizations_url": "https://api.github.com/users/llocust/orgs", + "repos_url": "https://api.github.com/users/llocust/repos", + "events_url": "https://api.github.com/users/llocust/events{/privacy}", + "received_events_url": "https://api.github.com/users/llocust/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "mizzack", + "id": 1423246, + "node_id": "MDQ6VXNlcjE0MjMyNDY=", + "avatar_url": "https://avatars.githubusercontent.com/u/1423246?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mizzack", + "html_url": "https://github.com/mizzack", + "followers_url": "https://api.github.com/users/mizzack/followers", + "following_url": "https://api.github.com/users/mizzack/following{/other_user}", + "gists_url": "https://api.github.com/users/mizzack/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mizzack/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mizzack/subscriptions", + "organizations_url": "https://api.github.com/users/mizzack/orgs", + "repos_url": "https://api.github.com/users/mizzack/repos", + "events_url": "https://api.github.com/users/mizzack/events{/privacy}", + "received_events_url": "https://api.github.com/users/mizzack/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "scriptspry", + "id": 19214202, + "node_id": "MDQ6VXNlcjE5MjE0MjAy", + "avatar_url": "https://avatars.githubusercontent.com/u/19214202?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/scriptspry", + "html_url": "https://github.com/scriptspry", + "followers_url": "https://api.github.com/users/scriptspry/followers", + "following_url": "https://api.github.com/users/scriptspry/following{/other_user}", + "gists_url": "https://api.github.com/users/scriptspry/gists{/gist_id}", + "starred_url": "https://api.github.com/users/scriptspry/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/scriptspry/subscriptions", + "organizations_url": "https://api.github.com/users/scriptspry/orgs", + "repos_url": "https://api.github.com/users/scriptspry/repos", + "events_url": "https://api.github.com/users/scriptspry/events{/privacy}", + "received_events_url": "https://api.github.com/users/scriptspry/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "shiloa", + "id": 52377, + "node_id": "MDQ6VXNlcjUyMzc3", + "avatar_url": "https://avatars.githubusercontent.com/u/52377?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/shiloa", + "html_url": "https://github.com/shiloa", + "followers_url": "https://api.github.com/users/shiloa/followers", + "following_url": "https://api.github.com/users/shiloa/following{/other_user}", + "gists_url": "https://api.github.com/users/shiloa/gists{/gist_id}", + "starred_url": "https://api.github.com/users/shiloa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/shiloa/subscriptions", + "organizations_url": "https://api.github.com/users/shiloa/orgs", + "repos_url": "https://api.github.com/users/shiloa/repos", + "events_url": "https://api.github.com/users/shiloa/events{/privacy}", + "received_events_url": "https://api.github.com/users/shiloa/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "andrejslogins", + "id": 22314074, + "node_id": "MDQ6VXNlcjIyMzE0MDc0", + "avatar_url": "https://avatars.githubusercontent.com/u/22314074?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/andrejslogins", + "html_url": "https://github.com/andrejslogins", + "followers_url": "https://api.github.com/users/andrejslogins/followers", + "following_url": "https://api.github.com/users/andrejslogins/following{/other_user}", + "gists_url": "https://api.github.com/users/andrejslogins/gists{/gist_id}", + "starred_url": "https://api.github.com/users/andrejslogins/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/andrejslogins/subscriptions", + "organizations_url": "https://api.github.com/users/andrejslogins/orgs", + "repos_url": "https://api.github.com/users/andrejslogins/repos", + "events_url": "https://api.github.com/users/andrejslogins/events{/privacy}", + "received_events_url": "https://api.github.com/users/andrejslogins/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "proYang", + "id": 16184782, + "node_id": "MDQ6VXNlcjE2MTg0Nzgy", + "avatar_url": "https://avatars.githubusercontent.com/u/16184782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/proYang", + "html_url": "https://github.com/proYang", + "followers_url": "https://api.github.com/users/proYang/followers", + "following_url": "https://api.github.com/users/proYang/following{/other_user}", + "gists_url": "https://api.github.com/users/proYang/gists{/gist_id}", + "starred_url": "https://api.github.com/users/proYang/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/proYang/subscriptions", + "organizations_url": "https://api.github.com/users/proYang/orgs", + "repos_url": "https://api.github.com/users/proYang/repos", + "events_url": "https://api.github.com/users/proYang/events{/privacy}", + "received_events_url": "https://api.github.com/users/proYang/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "tushuhei", + "id": 734905, + "node_id": "MDQ6VXNlcjczNDkwNQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/734905?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tushuhei", + "html_url": "https://github.com/tushuhei", + "followers_url": "https://api.github.com/users/tushuhei/followers", + "following_url": "https://api.github.com/users/tushuhei/following{/other_user}", + "gists_url": "https://api.github.com/users/tushuhei/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tushuhei/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tushuhei/subscriptions", + "organizations_url": "https://api.github.com/users/tushuhei/orgs", + "repos_url": "https://api.github.com/users/tushuhei/repos", + "events_url": "https://api.github.com/users/tushuhei/events{/privacy}", + "received_events_url": "https://api.github.com/users/tushuhei/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "abruzzihraig", + "id": 3356523, + "node_id": "MDQ6VXNlcjMzNTY1MjM=", + "avatar_url": "https://avatars.githubusercontent.com/u/3356523?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/abruzzihraig", + "html_url": "https://github.com/abruzzihraig", + "followers_url": "https://api.github.com/users/abruzzihraig/followers", + "following_url": "https://api.github.com/users/abruzzihraig/following{/other_user}", + "gists_url": "https://api.github.com/users/abruzzihraig/gists{/gist_id}", + "starred_url": "https://api.github.com/users/abruzzihraig/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/abruzzihraig/subscriptions", + "organizations_url": "https://api.github.com/users/abruzzihraig/orgs", + "repos_url": "https://api.github.com/users/abruzzihraig/repos", + "events_url": "https://api.github.com/users/abruzzihraig/events{/privacy}", + "received_events_url": "https://api.github.com/users/abruzzihraig/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "AndrewJDR", + "id": 1588857, + "node_id": "MDQ6VXNlcjE1ODg4NTc=", + "avatar_url": "https://avatars.githubusercontent.com/u/1588857?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/AndrewJDR", + "html_url": "https://github.com/AndrewJDR", + "followers_url": "https://api.github.com/users/AndrewJDR/followers", + "following_url": "https://api.github.com/users/AndrewJDR/following{/other_user}", + "gists_url": "https://api.github.com/users/AndrewJDR/gists{/gist_id}", + "starred_url": "https://api.github.com/users/AndrewJDR/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/AndrewJDR/subscriptions", + "organizations_url": "https://api.github.com/users/AndrewJDR/orgs", + "repos_url": "https://api.github.com/users/AndrewJDR/repos", + "events_url": "https://api.github.com/users/AndrewJDR/events{/privacy}", + "received_events_url": "https://api.github.com/users/AndrewJDR/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "bedeoverend", + "id": 594822, + "node_id": "MDQ6VXNlcjU5NDgyMg==", + "avatar_url": "https://avatars.githubusercontent.com/u/594822?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bedeoverend", + "html_url": "https://github.com/bedeoverend", + "followers_url": "https://api.github.com/users/bedeoverend/followers", + "following_url": "https://api.github.com/users/bedeoverend/following{/other_user}", + "gists_url": "https://api.github.com/users/bedeoverend/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bedeoverend/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bedeoverend/subscriptions", + "organizations_url": "https://api.github.com/users/bedeoverend/orgs", + "repos_url": "https://api.github.com/users/bedeoverend/repos", + "events_url": "https://api.github.com/users/bedeoverend/events{/privacy}", + "received_events_url": "https://api.github.com/users/bedeoverend/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "BradleyHill", + "id": 2738291, + "node_id": "MDQ6VXNlcjI3MzgyOTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2738291?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/BradleyHill", + "html_url": "https://github.com/BradleyHill", + "followers_url": "https://api.github.com/users/BradleyHill/followers", + "following_url": "https://api.github.com/users/BradleyHill/following{/other_user}", + "gists_url": "https://api.github.com/users/BradleyHill/gists{/gist_id}", + "starred_url": "https://api.github.com/users/BradleyHill/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/BradleyHill/subscriptions", + "organizations_url": "https://api.github.com/users/BradleyHill/orgs", + "repos_url": "https://api.github.com/users/BradleyHill/repos", + "events_url": "https://api.github.com/users/BradleyHill/events{/privacy}", + "received_events_url": "https://api.github.com/users/BradleyHill/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "charlie-s", + "id": 563379, + "node_id": "MDQ6VXNlcjU2MzM3OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/563379?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/charlie-s", + "html_url": "https://github.com/charlie-s", + "followers_url": "https://api.github.com/users/charlie-s/followers", + "following_url": "https://api.github.com/users/charlie-s/following{/other_user}", + "gists_url": "https://api.github.com/users/charlie-s/gists{/gist_id}", + "starred_url": "https://api.github.com/users/charlie-s/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/charlie-s/subscriptions", + "organizations_url": "https://api.github.com/users/charlie-s/orgs", + "repos_url": "https://api.github.com/users/charlie-s/repos", + "events_url": "https://api.github.com/users/charlie-s/events{/privacy}", + "received_events_url": "https://api.github.com/users/charlie-s/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "danielbeardsley", + "id": 26855, + "node_id": "MDQ6VXNlcjI2ODU1", + "avatar_url": "https://avatars.githubusercontent.com/u/26855?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/danielbeardsley", + "html_url": "https://github.com/danielbeardsley", + "followers_url": "https://api.github.com/users/danielbeardsley/followers", + "following_url": "https://api.github.com/users/danielbeardsley/following{/other_user}", + "gists_url": "https://api.github.com/users/danielbeardsley/gists{/gist_id}", + "starred_url": "https://api.github.com/users/danielbeardsley/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/danielbeardsley/subscriptions", + "organizations_url": "https://api.github.com/users/danielbeardsley/orgs", + "repos_url": "https://api.github.com/users/danielbeardsley/repos", + "events_url": "https://api.github.com/users/danielbeardsley/events{/privacy}", + "received_events_url": "https://api.github.com/users/danielbeardsley/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "DanieleSassoli", + "id": 4007741, + "node_id": "MDQ6VXNlcjQwMDc3NDE=", + "avatar_url": "https://avatars.githubusercontent.com/u/4007741?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/DanieleSassoli", + "html_url": "https://github.com/DanieleSassoli", + "followers_url": "https://api.github.com/users/DanieleSassoli/followers", + "following_url": "https://api.github.com/users/DanieleSassoli/following{/other_user}", + "gists_url": "https://api.github.com/users/DanieleSassoli/gists{/gist_id}", + "starred_url": "https://api.github.com/users/DanieleSassoli/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/DanieleSassoli/subscriptions", + "organizations_url": "https://api.github.com/users/DanieleSassoli/orgs", + "repos_url": "https://api.github.com/users/DanieleSassoli/repos", + "events_url": "https://api.github.com/users/DanieleSassoli/events{/privacy}", + "received_events_url": "https://api.github.com/users/DanieleSassoli/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "DaxGama", + "id": 11871242, + "node_id": "MDQ6VXNlcjExODcxMjQy", + "avatar_url": "https://avatars.githubusercontent.com/u/11871242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/DaxGama", + "html_url": "https://github.com/DaxGama", + "followers_url": "https://api.github.com/users/DaxGama/followers", + "following_url": "https://api.github.com/users/DaxGama/following{/other_user}", + "gists_url": "https://api.github.com/users/DaxGama/gists{/gist_id}", + "starred_url": "https://api.github.com/users/DaxGama/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/DaxGama/subscriptions", + "organizations_url": "https://api.github.com/users/DaxGama/orgs", + "repos_url": "https://api.github.com/users/DaxGama/repos", + "events_url": "https://api.github.com/users/DaxGama/events{/privacy}", + "received_events_url": "https://api.github.com/users/DaxGama/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "finfin", + "id": 2639232, + "node_id": "MDQ6VXNlcjI2MzkyMzI=", + "avatar_url": "https://avatars.githubusercontent.com/u/2639232?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/finfin", + "html_url": "https://github.com/finfin", + "followers_url": "https://api.github.com/users/finfin/followers", + "following_url": "https://api.github.com/users/finfin/following{/other_user}", + "gists_url": "https://api.github.com/users/finfin/gists{/gist_id}", + "starred_url": "https://api.github.com/users/finfin/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/finfin/subscriptions", + "organizations_url": "https://api.github.com/users/finfin/orgs", + "repos_url": "https://api.github.com/users/finfin/repos", + "events_url": "https://api.github.com/users/finfin/events{/privacy}", + "received_events_url": "https://api.github.com/users/finfin/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "FremyCompany", + "id": 364405, + "node_id": "MDQ6VXNlcjM2NDQwNQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/364405?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/FremyCompany", + "html_url": "https://github.com/FremyCompany", + "followers_url": "https://api.github.com/users/FremyCompany/followers", + "following_url": "https://api.github.com/users/FremyCompany/following{/other_user}", + "gists_url": "https://api.github.com/users/FremyCompany/gists{/gist_id}", + "starred_url": "https://api.github.com/users/FremyCompany/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/FremyCompany/subscriptions", + "organizations_url": "https://api.github.com/users/FremyCompany/orgs", + "repos_url": "https://api.github.com/users/FremyCompany/repos", + "events_url": "https://api.github.com/users/FremyCompany/events{/privacy}", + "received_events_url": "https://api.github.com/users/FremyCompany/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "jpomykala", + "id": 1548104, + "node_id": "MDQ6VXNlcjE1NDgxMDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/1548104?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jpomykala", + "html_url": "https://github.com/jpomykala", + "followers_url": "https://api.github.com/users/jpomykala/followers", + "following_url": "https://api.github.com/users/jpomykala/following{/other_user}", + "gists_url": "https://api.github.com/users/jpomykala/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jpomykala/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jpomykala/subscriptions", + "organizations_url": "https://api.github.com/users/jpomykala/orgs", + "repos_url": "https://api.github.com/users/jpomykala/repos", + "events_url": "https://api.github.com/users/jpomykala/events{/privacy}", + "received_events_url": "https://api.github.com/users/jpomykala/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "nmorel", + "id": 1496039, + "node_id": "MDQ6VXNlcjE0OTYwMzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1496039?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nmorel", + "html_url": "https://github.com/nmorel", + "followers_url": "https://api.github.com/users/nmorel/followers", + "following_url": "https://api.github.com/users/nmorel/following{/other_user}", + "gists_url": "https://api.github.com/users/nmorel/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nmorel/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nmorel/subscriptions", + "organizations_url": "https://api.github.com/users/nmorel/orgs", + "repos_url": "https://api.github.com/users/nmorel/repos", + "events_url": "https://api.github.com/users/nmorel/events{/privacy}", + "received_events_url": "https://api.github.com/users/nmorel/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "physiocoder", + "id": 3730813, + "node_id": "MDQ6VXNlcjM3MzA4MTM=", + "avatar_url": "https://avatars.githubusercontent.com/u/3730813?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/physiocoder", + "html_url": "https://github.com/physiocoder", + "followers_url": "https://api.github.com/users/physiocoder/followers", + "following_url": "https://api.github.com/users/physiocoder/following{/other_user}", + "gists_url": "https://api.github.com/users/physiocoder/gists{/gist_id}", + "starred_url": "https://api.github.com/users/physiocoder/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/physiocoder/subscriptions", + "organizations_url": "https://api.github.com/users/physiocoder/orgs", + "repos_url": "https://api.github.com/users/physiocoder/repos", + "events_url": "https://api.github.com/users/physiocoder/events{/privacy}", + "received_events_url": "https://api.github.com/users/physiocoder/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "PeterDaveHello", + "id": 3691490, + "node_id": "MDQ6VXNlcjM2OTE0OTA=", + "avatar_url": "https://avatars.githubusercontent.com/u/3691490?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PeterDaveHello", + "html_url": "https://github.com/PeterDaveHello", + "followers_url": "https://api.github.com/users/PeterDaveHello/followers", + "following_url": "https://api.github.com/users/PeterDaveHello/following{/other_user}", + "gists_url": "https://api.github.com/users/PeterDaveHello/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PeterDaveHello/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PeterDaveHello/subscriptions", + "organizations_url": "https://api.github.com/users/PeterDaveHello/orgs", + "repos_url": "https://api.github.com/users/PeterDaveHello/repos", + "events_url": "https://api.github.com/users/PeterDaveHello/events{/privacy}", + "received_events_url": "https://api.github.com/users/PeterDaveHello/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "shkaper", + "id": 2895432, + "node_id": "MDQ6VXNlcjI4OTU0MzI=", + "avatar_url": "https://avatars.githubusercontent.com/u/2895432?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/shkaper", + "html_url": "https://github.com/shkaper", + "followers_url": "https://api.github.com/users/shkaper/followers", + "following_url": "https://api.github.com/users/shkaper/following{/other_user}", + "gists_url": "https://api.github.com/users/shkaper/gists{/gist_id}", + "starred_url": "https://api.github.com/users/shkaper/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/shkaper/subscriptions", + "organizations_url": "https://api.github.com/users/shkaper/orgs", + "repos_url": "https://api.github.com/users/shkaper/repos", + "events_url": "https://api.github.com/users/shkaper/events{/privacy}", + "received_events_url": "https://api.github.com/users/shkaper/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "nateevans", + "id": 1561006, + "node_id": "MDQ6VXNlcjE1NjEwMDY=", + "avatar_url": "https://avatars.githubusercontent.com/u/1561006?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nateevans", + "html_url": "https://github.com/nateevans", + "followers_url": "https://api.github.com/users/nateevans/followers", + "following_url": "https://api.github.com/users/nateevans/following{/other_user}", + "gists_url": "https://api.github.com/users/nateevans/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nateevans/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nateevans/subscriptions", + "organizations_url": "https://api.github.com/users/nateevans/orgs", + "repos_url": "https://api.github.com/users/nateevans/repos", + "events_url": "https://api.github.com/users/nateevans/events{/privacy}", + "received_events_url": "https://api.github.com/users/nateevans/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "mortonfox", + "id": 495892, + "node_id": "MDQ6VXNlcjQ5NTg5Mg==", + "avatar_url": "https://avatars.githubusercontent.com/u/495892?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mortonfox", + "html_url": "https://github.com/mortonfox", + "followers_url": "https://api.github.com/users/mortonfox/followers", + "following_url": "https://api.github.com/users/mortonfox/following{/other_user}", + "gists_url": "https://api.github.com/users/mortonfox/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mortonfox/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mortonfox/subscriptions", + "organizations_url": "https://api.github.com/users/mortonfox/orgs", + "repos_url": "https://api.github.com/users/mortonfox/repos", + "events_url": "https://api.github.com/users/mortonfox/events{/privacy}", + "received_events_url": "https://api.github.com/users/mortonfox/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "mtharrison", + "id": 916064, + "node_id": "MDQ6VXNlcjkxNjA2NA==", + "avatar_url": "https://avatars.githubusercontent.com/u/916064?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mtharrison", + "html_url": "https://github.com/mtharrison", + "followers_url": "https://api.github.com/users/mtharrison/followers", + "following_url": "https://api.github.com/users/mtharrison/following{/other_user}", + "gists_url": "https://api.github.com/users/mtharrison/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mtharrison/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mtharrison/subscriptions", + "organizations_url": "https://api.github.com/users/mtharrison/orgs", + "repos_url": "https://api.github.com/users/mtharrison/repos", + "events_url": "https://api.github.com/users/mtharrison/events{/privacy}", + "received_events_url": "https://api.github.com/users/mtharrison/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "belfz", + "id": 5827079, + "node_id": "MDQ6VXNlcjU4MjcwNzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/5827079?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/belfz", + "html_url": "https://github.com/belfz", + "followers_url": "https://api.github.com/users/belfz/followers", + "following_url": "https://api.github.com/users/belfz/following{/other_user}", + "gists_url": "https://api.github.com/users/belfz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/belfz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/belfz/subscriptions", + "organizations_url": "https://api.github.com/users/belfz/orgs", + "repos_url": "https://api.github.com/users/belfz/repos", + "events_url": "https://api.github.com/users/belfz/events{/privacy}", + "received_events_url": "https://api.github.com/users/belfz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "konieczkow", + "id": 581399, + "node_id": "MDQ6VXNlcjU4MTM5OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/581399?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/konieczkow", + "html_url": "https://github.com/konieczkow", + "followers_url": "https://api.github.com/users/konieczkow/followers", + "following_url": "https://api.github.com/users/konieczkow/following{/other_user}", + "gists_url": "https://api.github.com/users/konieczkow/gists{/gist_id}", + "starred_url": "https://api.github.com/users/konieczkow/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/konieczkow/subscriptions", + "organizations_url": "https://api.github.com/users/konieczkow/orgs", + "repos_url": "https://api.github.com/users/konieczkow/repos", + "events_url": "https://api.github.com/users/konieczkow/events{/privacy}", + "received_events_url": "https://api.github.com/users/konieczkow/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "kherock", + "id": 4993980, + "node_id": "MDQ6VXNlcjQ5OTM5ODA=", + "avatar_url": "https://avatars.githubusercontent.com/u/4993980?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kherock", + "html_url": "https://github.com/kherock", + "followers_url": "https://api.github.com/users/kherock/followers", + "following_url": "https://api.github.com/users/kherock/following{/other_user}", + "gists_url": "https://api.github.com/users/kherock/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kherock/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kherock/subscriptions", + "organizations_url": "https://api.github.com/users/kherock/orgs", + "repos_url": "https://api.github.com/users/kherock/repos", + "events_url": "https://api.github.com/users/kherock/events{/privacy}", + "received_events_url": "https://api.github.com/users/kherock/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "kuldipem", + "id": 2017625, + "node_id": "MDQ6VXNlcjIwMTc2MjU=", + "avatar_url": "https://avatars.githubusercontent.com/u/2017625?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kuldipem", + "html_url": "https://github.com/kuldipem", + "followers_url": "https://api.github.com/users/kuldipem/followers", + "following_url": "https://api.github.com/users/kuldipem/following{/other_user}", + "gists_url": "https://api.github.com/users/kuldipem/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kuldipem/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kuldipem/subscriptions", + "organizations_url": "https://api.github.com/users/kuldipem/orgs", + "repos_url": "https://api.github.com/users/kuldipem/repos", + "events_url": "https://api.github.com/users/kuldipem/events{/privacy}", + "received_events_url": "https://api.github.com/users/kuldipem/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "earlyster", + "id": 813090, + "node_id": "MDQ6VXNlcjgxMzA5MA==", + "avatar_url": "https://avatars.githubusercontent.com/u/813090?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/earlyster", + "html_url": "https://github.com/earlyster", + "followers_url": "https://api.github.com/users/earlyster/followers", + "following_url": "https://api.github.com/users/earlyster/following{/other_user}", + "gists_url": "https://api.github.com/users/earlyster/gists{/gist_id}", + "starred_url": "https://api.github.com/users/earlyster/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/earlyster/subscriptions", + "organizations_url": "https://api.github.com/users/earlyster/orgs", + "repos_url": "https://api.github.com/users/earlyster/repos", + "events_url": "https://api.github.com/users/earlyster/events{/privacy}", + "received_events_url": "https://api.github.com/users/earlyster/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "vegasje", + "id": 1513431, + "node_id": "MDQ6VXNlcjE1MTM0MzE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1513431?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vegasje", + "html_url": "https://github.com/vegasje", + "followers_url": "https://api.github.com/users/vegasje/followers", + "following_url": "https://api.github.com/users/vegasje/following{/other_user}", + "gists_url": "https://api.github.com/users/vegasje/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vegasje/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vegasje/subscriptions", + "organizations_url": "https://api.github.com/users/vegasje/orgs", + "repos_url": "https://api.github.com/users/vegasje/repos", + "events_url": "https://api.github.com/users/vegasje/events{/privacy}", + "received_events_url": "https://api.github.com/users/vegasje/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 2 + }, + { + "login": "lbordowitz", + "id": 9062490, + "node_id": "MDQ6VXNlcjkwNjI0OTA=", + "avatar_url": "https://avatars.githubusercontent.com/u/9062490?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/lbordowitz", + "html_url": "https://github.com/lbordowitz", + "followers_url": "https://api.github.com/users/lbordowitz/followers", + "following_url": "https://api.github.com/users/lbordowitz/following{/other_user}", + "gists_url": "https://api.github.com/users/lbordowitz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/lbordowitz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/lbordowitz/subscriptions", + "organizations_url": "https://api.github.com/users/lbordowitz/orgs", + "repos_url": "https://api.github.com/users/lbordowitz/repos", + "events_url": "https://api.github.com/users/lbordowitz/events{/privacy}", + "received_events_url": "https://api.github.com/users/lbordowitz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rhoffmann8", + "id": 1182331, + "node_id": "MDQ6VXNlcjExODIzMzE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1182331?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rhoffmann8", + "html_url": "https://github.com/rhoffmann8", + "followers_url": "https://api.github.com/users/rhoffmann8/followers", + "following_url": "https://api.github.com/users/rhoffmann8/following{/other_user}", + "gists_url": "https://api.github.com/users/rhoffmann8/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rhoffmann8/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rhoffmann8/subscriptions", + "organizations_url": "https://api.github.com/users/rhoffmann8/orgs", + "repos_url": "https://api.github.com/users/rhoffmann8/repos", + "events_url": "https://api.github.com/users/rhoffmann8/events{/privacy}", + "received_events_url": "https://api.github.com/users/rhoffmann8/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Robbie-Cook", + "id": 13477291, + "node_id": "MDQ6VXNlcjEzNDc3Mjkx", + "avatar_url": "https://avatars.githubusercontent.com/u/13477291?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Robbie-Cook", + "html_url": "https://github.com/Robbie-Cook", + "followers_url": "https://api.github.com/users/Robbie-Cook/followers", + "following_url": "https://api.github.com/users/Robbie-Cook/following{/other_user}", + "gists_url": "https://api.github.com/users/Robbie-Cook/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Robbie-Cook/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Robbie-Cook/subscriptions", + "organizations_url": "https://api.github.com/users/Robbie-Cook/orgs", + "repos_url": "https://api.github.com/users/Robbie-Cook/repos", + "events_url": "https://api.github.com/users/Robbie-Cook/events{/privacy}", + "received_events_url": "https://api.github.com/users/Robbie-Cook/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rubenlagatie", + "id": 3558417, + "node_id": "MDQ6VXNlcjM1NTg0MTc=", + "avatar_url": "https://avatars.githubusercontent.com/u/3558417?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rubenlagatie", + "html_url": "https://github.com/rubenlagatie", + "followers_url": "https://api.github.com/users/rubenlagatie/followers", + "following_url": "https://api.github.com/users/rubenlagatie/following{/other_user}", + "gists_url": "https://api.github.com/users/rubenlagatie/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rubenlagatie/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rubenlagatie/subscriptions", + "organizations_url": "https://api.github.com/users/rubenlagatie/orgs", + "repos_url": "https://api.github.com/users/rubenlagatie/repos", + "events_url": "https://api.github.com/users/rubenlagatie/events{/privacy}", + "received_events_url": "https://api.github.com/users/rubenlagatie/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "ozooner", + "id": 2709373, + "node_id": "MDQ6VXNlcjI3MDkzNzM=", + "avatar_url": "https://avatars.githubusercontent.com/u/2709373?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ozooner", + "html_url": "https://github.com/ozooner", + "followers_url": "https://api.github.com/users/ozooner/followers", + "following_url": "https://api.github.com/users/ozooner/following{/other_user}", + "gists_url": "https://api.github.com/users/ozooner/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ozooner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ozooner/subscriptions", + "organizations_url": "https://api.github.com/users/ozooner/orgs", + "repos_url": "https://api.github.com/users/ozooner/repos", + "events_url": "https://api.github.com/users/ozooner/events{/privacy}", + "received_events_url": "https://api.github.com/users/ozooner/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "seanhussey", + "id": 10438, + "node_id": "MDQ6VXNlcjEwNDM4", + "avatar_url": "https://avatars.githubusercontent.com/u/10438?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/seanhussey", + "html_url": "https://github.com/seanhussey", + "followers_url": "https://api.github.com/users/seanhussey/followers", + "following_url": "https://api.github.com/users/seanhussey/following{/other_user}", + "gists_url": "https://api.github.com/users/seanhussey/gists{/gist_id}", + "starred_url": "https://api.github.com/users/seanhussey/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/seanhussey/subscriptions", + "organizations_url": "https://api.github.com/users/seanhussey/orgs", + "repos_url": "https://api.github.com/users/seanhussey/repos", + "events_url": "https://api.github.com/users/seanhussey/events{/privacy}", + "received_events_url": "https://api.github.com/users/seanhussey/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "TanukiSharp", + "id": 4018313, + "node_id": "MDQ6VXNlcjQwMTgzMTM=", + "avatar_url": "https://avatars.githubusercontent.com/u/4018313?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/TanukiSharp", + "html_url": "https://github.com/TanukiSharp", + "followers_url": "https://api.github.com/users/TanukiSharp/followers", + "following_url": "https://api.github.com/users/TanukiSharp/following{/other_user}", + "gists_url": "https://api.github.com/users/TanukiSharp/gists{/gist_id}", + "starred_url": "https://api.github.com/users/TanukiSharp/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/TanukiSharp/subscriptions", + "organizations_url": "https://api.github.com/users/TanukiSharp/orgs", + "repos_url": "https://api.github.com/users/TanukiSharp/repos", + "events_url": "https://api.github.com/users/TanukiSharp/events{/privacy}", + "received_events_url": "https://api.github.com/users/TanukiSharp/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "shshaw", + "id": 777155, + "node_id": "MDQ6VXNlcjc3NzE1NQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/777155?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/shshaw", + "html_url": "https://github.com/shshaw", + "followers_url": "https://api.github.com/users/shshaw/followers", + "following_url": "https://api.github.com/users/shshaw/following{/other_user}", + "gists_url": "https://api.github.com/users/shshaw/gists{/gist_id}", + "starred_url": "https://api.github.com/users/shshaw/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/shshaw/subscriptions", + "organizations_url": "https://api.github.com/users/shshaw/orgs", + "repos_url": "https://api.github.com/users/shshaw/repos", + "events_url": "https://api.github.com/users/shshaw/events{/privacy}", + "received_events_url": "https://api.github.com/users/shshaw/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "SvenFackert", + "id": 12274825, + "node_id": "MDQ6VXNlcjEyMjc0ODI1", + "avatar_url": "https://avatars.githubusercontent.com/u/12274825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/SvenFackert", + "html_url": "https://github.com/SvenFackert", + "followers_url": "https://api.github.com/users/SvenFackert/followers", + "following_url": "https://api.github.com/users/SvenFackert/following{/other_user}", + "gists_url": "https://api.github.com/users/SvenFackert/gists{/gist_id}", + "starred_url": "https://api.github.com/users/SvenFackert/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/SvenFackert/subscriptions", + "organizations_url": "https://api.github.com/users/SvenFackert/orgs", + "repos_url": "https://api.github.com/users/SvenFackert/repos", + "events_url": "https://api.github.com/users/SvenFackert/events{/privacy}", + "received_events_url": "https://api.github.com/users/SvenFackert/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Swedish-li", + "id": 17829108, + "node_id": "MDQ6VXNlcjE3ODI5MTA4", + "avatar_url": "https://avatars.githubusercontent.com/u/17829108?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Swedish-li", + "html_url": "https://github.com/Swedish-li", + "followers_url": "https://api.github.com/users/Swedish-li/followers", + "following_url": "https://api.github.com/users/Swedish-li/following{/other_user}", + "gists_url": "https://api.github.com/users/Swedish-li/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Swedish-li/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Swedish-li/subscriptions", + "organizations_url": "https://api.github.com/users/Swedish-li/orgs", + "repos_url": "https://api.github.com/users/Swedish-li/repos", + "events_url": "https://api.github.com/users/Swedish-li/events{/privacy}", + "received_events_url": "https://api.github.com/users/Swedish-li/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "taherh", + "id": 853745, + "node_id": "MDQ6VXNlcjg1Mzc0NQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/853745?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/taherh", + "html_url": "https://github.com/taherh", + "followers_url": "https://api.github.com/users/taherh/followers", + "following_url": "https://api.github.com/users/taherh/following{/other_user}", + "gists_url": "https://api.github.com/users/taherh/gists{/gist_id}", + "starred_url": "https://api.github.com/users/taherh/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/taherh/subscriptions", + "organizations_url": "https://api.github.com/users/taherh/orgs", + "repos_url": "https://api.github.com/users/taherh/repos", + "events_url": "https://api.github.com/users/taherh/events{/privacy}", + "received_events_url": "https://api.github.com/users/taherh/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "taqimustafa", + "id": 8524942, + "node_id": "MDQ6VXNlcjg1MjQ5NDI=", + "avatar_url": "https://avatars.githubusercontent.com/u/8524942?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/taqimustafa", + "html_url": "https://github.com/taqimustafa", + "followers_url": "https://api.github.com/users/taqimustafa/followers", + "following_url": "https://api.github.com/users/taqimustafa/following{/other_user}", + "gists_url": "https://api.github.com/users/taqimustafa/gists{/gist_id}", + "starred_url": "https://api.github.com/users/taqimustafa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/taqimustafa/subscriptions", + "organizations_url": "https://api.github.com/users/taqimustafa/orgs", + "repos_url": "https://api.github.com/users/taqimustafa/repos", + "events_url": "https://api.github.com/users/taqimustafa/events{/privacy}", + "received_events_url": "https://api.github.com/users/taqimustafa/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "gitter-badger", + "id": 8518239, + "node_id": "MDQ6VXNlcjg1MTgyMzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/8518239?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gitter-badger", + "html_url": "https://github.com/gitter-badger", + "followers_url": "https://api.github.com/users/gitter-badger/followers", + "following_url": "https://api.github.com/users/gitter-badger/following{/other_user}", + "gists_url": "https://api.github.com/users/gitter-badger/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gitter-badger/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitter-badger/subscriptions", + "organizations_url": "https://api.github.com/users/gitter-badger/orgs", + "repos_url": "https://api.github.com/users/gitter-badger/repos", + "events_url": "https://api.github.com/users/gitter-badger/events{/privacy}", + "received_events_url": "https://api.github.com/users/gitter-badger/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "thheller", + "id": 144930, + "node_id": "MDQ6VXNlcjE0NDkzMA==", + "avatar_url": "https://avatars.githubusercontent.com/u/144930?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/thheller", + "html_url": "https://github.com/thheller", + "followers_url": "https://api.github.com/users/thheller/followers", + "following_url": "https://api.github.com/users/thheller/following{/other_user}", + "gists_url": "https://api.github.com/users/thheller/gists{/gist_id}", + "starred_url": "https://api.github.com/users/thheller/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/thheller/subscriptions", + "organizations_url": "https://api.github.com/users/thheller/orgs", + "repos_url": "https://api.github.com/users/thheller/repos", + "events_url": "https://api.github.com/users/thheller/events{/privacy}", + "received_events_url": "https://api.github.com/users/thheller/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Chaoste", + "id": 9327071, + "node_id": "MDQ6VXNlcjkzMjcwNzE=", + "avatar_url": "https://avatars.githubusercontent.com/u/9327071?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Chaoste", + "html_url": "https://github.com/Chaoste", + "followers_url": "https://api.github.com/users/Chaoste/followers", + "following_url": "https://api.github.com/users/Chaoste/following{/other_user}", + "gists_url": "https://api.github.com/users/Chaoste/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Chaoste/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Chaoste/subscriptions", + "organizations_url": "https://api.github.com/users/Chaoste/orgs", + "repos_url": "https://api.github.com/users/Chaoste/repos", + "events_url": "https://api.github.com/users/Chaoste/events{/privacy}", + "received_events_url": "https://api.github.com/users/Chaoste/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "thoepfner", + "id": 77366, + "node_id": "MDQ6VXNlcjc3MzY2", + "avatar_url": "https://avatars.githubusercontent.com/u/77366?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/thoepfner", + "html_url": "https://github.com/thoepfner", + "followers_url": "https://api.github.com/users/thoepfner/followers", + "following_url": "https://api.github.com/users/thoepfner/following{/other_user}", + "gists_url": "https://api.github.com/users/thoepfner/gists{/gist_id}", + "starred_url": "https://api.github.com/users/thoepfner/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/thoepfner/subscriptions", + "organizations_url": "https://api.github.com/users/thoepfner/orgs", + "repos_url": "https://api.github.com/users/thoepfner/repos", + "events_url": "https://api.github.com/users/thoepfner/events{/privacy}", + "received_events_url": "https://api.github.com/users/thoepfner/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "TiraO", + "id": 6477161, + "node_id": "MDQ6VXNlcjY0NzcxNjE=", + "avatar_url": "https://avatars.githubusercontent.com/u/6477161?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/TiraO", + "html_url": "https://github.com/TiraO", + "followers_url": "https://api.github.com/users/TiraO/followers", + "following_url": "https://api.github.com/users/TiraO/following{/other_user}", + "gists_url": "https://api.github.com/users/TiraO/gists{/gist_id}", + "starred_url": "https://api.github.com/users/TiraO/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/TiraO/subscriptions", + "organizations_url": "https://api.github.com/users/TiraO/orgs", + "repos_url": "https://api.github.com/users/TiraO/repos", + "events_url": "https://api.github.com/users/TiraO/events{/privacy}", + "received_events_url": "https://api.github.com/users/TiraO/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "toddbc", + "id": 1657421, + "node_id": "MDQ6VXNlcjE2NTc0MjE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1657421?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/toddbc", + "html_url": "https://github.com/toddbc", + "followers_url": "https://api.github.com/users/toddbc/followers", + "following_url": "https://api.github.com/users/toddbc/following{/other_user}", + "gists_url": "https://api.github.com/users/toddbc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/toddbc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/toddbc/subscriptions", + "organizations_url": "https://api.github.com/users/toddbc/orgs", + "repos_url": "https://api.github.com/users/toddbc/repos", + "events_url": "https://api.github.com/users/toddbc/events{/privacy}", + "received_events_url": "https://api.github.com/users/toddbc/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "virror", + "id": 5832988, + "node_id": "MDQ6VXNlcjU4MzI5ODg=", + "avatar_url": "https://avatars.githubusercontent.com/u/5832988?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/virror", + "html_url": "https://github.com/virror", + "followers_url": "https://api.github.com/users/virror/followers", + "following_url": "https://api.github.com/users/virror/following{/other_user}", + "gists_url": "https://api.github.com/users/virror/gists{/gist_id}", + "starred_url": "https://api.github.com/users/virror/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/virror/subscriptions", + "organizations_url": "https://api.github.com/users/virror/orgs", + "repos_url": "https://api.github.com/users/virror/repos", + "events_url": "https://api.github.com/users/virror/events{/privacy}", + "received_events_url": "https://api.github.com/users/virror/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "WietseWind", + "id": 4756161, + "node_id": "MDQ6VXNlcjQ3NTYxNjE=", + "avatar_url": "https://avatars.githubusercontent.com/u/4756161?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/WietseWind", + "html_url": "https://github.com/WietseWind", + "followers_url": "https://api.github.com/users/WietseWind/followers", + "following_url": "https://api.github.com/users/WietseWind/following{/other_user}", + "gists_url": "https://api.github.com/users/WietseWind/gists{/gist_id}", + "starred_url": "https://api.github.com/users/WietseWind/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/WietseWind/subscriptions", + "organizations_url": "https://api.github.com/users/WietseWind/orgs", + "repos_url": "https://api.github.com/users/WietseWind/repos", + "events_url": "https://api.github.com/users/WietseWind/events{/privacy}", + "received_events_url": "https://api.github.com/users/WietseWind/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "zakarialaoui10", + "id": 63521765, + "node_id": "MDQ6VXNlcjYzNTIxNzY1", + "avatar_url": "https://avatars.githubusercontent.com/u/63521765?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zakarialaoui10", + "html_url": "https://github.com/zakarialaoui10", + "followers_url": "https://api.github.com/users/zakarialaoui10/followers", + "following_url": "https://api.github.com/users/zakarialaoui10/following{/other_user}", + "gists_url": "https://api.github.com/users/zakarialaoui10/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zakarialaoui10/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zakarialaoui10/subscriptions", + "organizations_url": "https://api.github.com/users/zakarialaoui10/orgs", + "repos_url": "https://api.github.com/users/zakarialaoui10/repos", + "events_url": "https://api.github.com/users/zakarialaoui10/events{/privacy}", + "received_events_url": "https://api.github.com/users/zakarialaoui10/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "lorenzopolidori", + "id": 2437709, + "node_id": "MDQ6VXNlcjI0Mzc3MDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/2437709?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/lorenzopolidori", + "html_url": "https://github.com/lorenzopolidori", + "followers_url": "https://api.github.com/users/lorenzopolidori/followers", + "following_url": "https://api.github.com/users/lorenzopolidori/following{/other_user}", + "gists_url": "https://api.github.com/users/lorenzopolidori/gists{/gist_id}", + "starred_url": "https://api.github.com/users/lorenzopolidori/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/lorenzopolidori/subscriptions", + "organizations_url": "https://api.github.com/users/lorenzopolidori/orgs", + "repos_url": "https://api.github.com/users/lorenzopolidori/repos", + "events_url": "https://api.github.com/users/lorenzopolidori/events{/privacy}", + "received_events_url": "https://api.github.com/users/lorenzopolidori/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Mansehej", + "id": 18641196, + "node_id": "MDQ6VXNlcjE4NjQxMTk2", + "avatar_url": "https://avatars.githubusercontent.com/u/18641196?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Mansehej", + "html_url": "https://github.com/Mansehej", + "followers_url": "https://api.github.com/users/Mansehej/followers", + "following_url": "https://api.github.com/users/Mansehej/following{/other_user}", + "gists_url": "https://api.github.com/users/Mansehej/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Mansehej/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Mansehej/subscriptions", + "organizations_url": "https://api.github.com/users/Mansehej/orgs", + "repos_url": "https://api.github.com/users/Mansehej/repos", + "events_url": "https://api.github.com/users/Mansehej/events{/privacy}", + "received_events_url": "https://api.github.com/users/Mansehej/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "MarcoMiltenburg", + "id": 6213937, + "node_id": "MDQ6VXNlcjYyMTM5Mzc=", + "avatar_url": "https://avatars.githubusercontent.com/u/6213937?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/MarcoMiltenburg", + "html_url": "https://github.com/MarcoMiltenburg", + "followers_url": "https://api.github.com/users/MarcoMiltenburg/followers", + "following_url": "https://api.github.com/users/MarcoMiltenburg/following{/other_user}", + "gists_url": "https://api.github.com/users/MarcoMiltenburg/gists{/gist_id}", + "starred_url": "https://api.github.com/users/MarcoMiltenburg/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/MarcoMiltenburg/subscriptions", + "organizations_url": "https://api.github.com/users/MarcoMiltenburg/orgs", + "repos_url": "https://api.github.com/users/MarcoMiltenburg/repos", + "events_url": "https://api.github.com/users/MarcoMiltenburg/events{/privacy}", + "received_events_url": "https://api.github.com/users/MarcoMiltenburg/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "m14t", + "id": 207950, + "node_id": "MDQ6VXNlcjIwNzk1MA==", + "avatar_url": "https://avatars.githubusercontent.com/u/207950?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/m14t", + "html_url": "https://github.com/m14t", + "followers_url": "https://api.github.com/users/m14t/followers", + "following_url": "https://api.github.com/users/m14t/following{/other_user}", + "gists_url": "https://api.github.com/users/m14t/gists{/gist_id}", + "starred_url": "https://api.github.com/users/m14t/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/m14t/subscriptions", + "organizations_url": "https://api.github.com/users/m14t/orgs", + "repos_url": "https://api.github.com/users/m14t/repos", + "events_url": "https://api.github.com/users/m14t/events{/privacy}", + "received_events_url": "https://api.github.com/users/m14t/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "sn3p", + "id": 935529, + "node_id": "MDQ6VXNlcjkzNTUyOQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/935529?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/sn3p", + "html_url": "https://github.com/sn3p", + "followers_url": "https://api.github.com/users/sn3p/followers", + "following_url": "https://api.github.com/users/sn3p/following{/other_user}", + "gists_url": "https://api.github.com/users/sn3p/gists{/gist_id}", + "starred_url": "https://api.github.com/users/sn3p/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/sn3p/subscriptions", + "organizations_url": "https://api.github.com/users/sn3p/orgs", + "repos_url": "https://api.github.com/users/sn3p/repos", + "events_url": "https://api.github.com/users/sn3p/events{/privacy}", + "received_events_url": "https://api.github.com/users/sn3p/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "melvynhills", + "id": 417315, + "node_id": "MDQ6VXNlcjQxNzMxNQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/417315?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/melvynhills", + "html_url": "https://github.com/melvynhills", + "followers_url": "https://api.github.com/users/melvynhills/followers", + "following_url": "https://api.github.com/users/melvynhills/following{/other_user}", + "gists_url": "https://api.github.com/users/melvynhills/gists{/gist_id}", + "starred_url": "https://api.github.com/users/melvynhills/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/melvynhills/subscriptions", + "organizations_url": "https://api.github.com/users/melvynhills/orgs", + "repos_url": "https://api.github.com/users/melvynhills/repos", + "events_url": "https://api.github.com/users/melvynhills/events{/privacy}", + "received_events_url": "https://api.github.com/users/melvynhills/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "mrienstra", + "id": 669326, + "node_id": "MDQ6VXNlcjY2OTMyNg==", + "avatar_url": "https://avatars.githubusercontent.com/u/669326?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mrienstra", + "html_url": "https://github.com/mrienstra", + "followers_url": "https://api.github.com/users/mrienstra/followers", + "following_url": "https://api.github.com/users/mrienstra/following{/other_user}", + "gists_url": "https://api.github.com/users/mrienstra/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mrienstra/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mrienstra/subscriptions", + "organizations_url": "https://api.github.com/users/mrienstra/orgs", + "repos_url": "https://api.github.com/users/mrienstra/repos", + "events_url": "https://api.github.com/users/mrienstra/events{/privacy}", + "received_events_url": "https://api.github.com/users/mrienstra/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "macrosak", + "id": 475311, + "node_id": "MDQ6VXNlcjQ3NTMxMQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/475311?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/macrosak", + "html_url": "https://github.com/macrosak", + "followers_url": "https://api.github.com/users/macrosak/followers", + "following_url": "https://api.github.com/users/macrosak/following{/other_user}", + "gists_url": "https://api.github.com/users/macrosak/gists{/gist_id}", + "starred_url": "https://api.github.com/users/macrosak/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/macrosak/subscriptions", + "organizations_url": "https://api.github.com/users/macrosak/orgs", + "repos_url": "https://api.github.com/users/macrosak/repos", + "events_url": "https://api.github.com/users/macrosak/events{/privacy}", + "received_events_url": "https://api.github.com/users/macrosak/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "milkcask", + "id": 1572863, + "node_id": "MDQ6VXNlcjE1NzI4NjM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1572863?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/milkcask", + "html_url": "https://github.com/milkcask", + "followers_url": "https://api.github.com/users/milkcask/followers", + "following_url": "https://api.github.com/users/milkcask/following{/other_user}", + "gists_url": "https://api.github.com/users/milkcask/gists{/gist_id}", + "starred_url": "https://api.github.com/users/milkcask/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/milkcask/subscriptions", + "organizations_url": "https://api.github.com/users/milkcask/orgs", + "repos_url": "https://api.github.com/users/milkcask/repos", + "events_url": "https://api.github.com/users/milkcask/events{/privacy}", + "received_events_url": "https://api.github.com/users/milkcask/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "miroljub1995", + "id": 46632388, + "node_id": "MDQ6VXNlcjQ2NjMyMzg4", + "avatar_url": "https://avatars.githubusercontent.com/u/46632388?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/miroljub1995", + "html_url": "https://github.com/miroljub1995", + "followers_url": "https://api.github.com/users/miroljub1995/followers", + "following_url": "https://api.github.com/users/miroljub1995/following{/other_user}", + "gists_url": "https://api.github.com/users/miroljub1995/gists{/gist_id}", + "starred_url": "https://api.github.com/users/miroljub1995/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/miroljub1995/subscriptions", + "organizations_url": "https://api.github.com/users/miroljub1995/orgs", + "repos_url": "https://api.github.com/users/miroljub1995/repos", + "events_url": "https://api.github.com/users/miroljub1995/events{/privacy}", + "received_events_url": "https://api.github.com/users/miroljub1995/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "swider", + "id": 482460, + "node_id": "MDQ6VXNlcjQ4MjQ2MA==", + "avatar_url": "https://avatars.githubusercontent.com/u/482460?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/swider", + "html_url": "https://github.com/swider", + "followers_url": "https://api.github.com/users/swider/followers", + "following_url": "https://api.github.com/users/swider/following{/other_user}", + "gists_url": "https://api.github.com/users/swider/gists{/gist_id}", + "starred_url": "https://api.github.com/users/swider/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/swider/subscriptions", + "organizations_url": "https://api.github.com/users/swider/orgs", + "repos_url": "https://api.github.com/users/swider/repos", + "events_url": "https://api.github.com/users/swider/events{/privacy}", + "received_events_url": "https://api.github.com/users/swider/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "niels-van-den-broeck", + "id": 39048448, + "node_id": "MDQ6VXNlcjM5MDQ4NDQ4", + "avatar_url": "https://avatars.githubusercontent.com/u/39048448?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/niels-van-den-broeck", + "html_url": "https://github.com/niels-van-den-broeck", + "followers_url": "https://api.github.com/users/niels-van-den-broeck/followers", + "following_url": "https://api.github.com/users/niels-van-den-broeck/following{/other_user}", + "gists_url": "https://api.github.com/users/niels-van-den-broeck/gists{/gist_id}", + "starred_url": "https://api.github.com/users/niels-van-den-broeck/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/niels-van-den-broeck/subscriptions", + "organizations_url": "https://api.github.com/users/niels-van-den-broeck/orgs", + "repos_url": "https://api.github.com/users/niels-van-den-broeck/repos", + "events_url": "https://api.github.com/users/niels-van-den-broeck/events{/privacy}", + "received_events_url": "https://api.github.com/users/niels-van-den-broeck/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "nisarhassan12", + "id": 46004116, + "node_id": "MDQ6VXNlcjQ2MDA0MTE2", + "avatar_url": "https://avatars.githubusercontent.com/u/46004116?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nisarhassan12", + "html_url": "https://github.com/nisarhassan12", + "followers_url": "https://api.github.com/users/nisarhassan12/followers", + "following_url": "https://api.github.com/users/nisarhassan12/following{/other_user}", + "gists_url": "https://api.github.com/users/nisarhassan12/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nisarhassan12/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nisarhassan12/subscriptions", + "organizations_url": "https://api.github.com/users/nisarhassan12/orgs", + "repos_url": "https://api.github.com/users/nisarhassan12/repos", + "events_url": "https://api.github.com/users/nisarhassan12/events{/privacy}", + "received_events_url": "https://api.github.com/users/nisarhassan12/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "ollym", + "id": 143771, + "node_id": "MDQ6VXNlcjE0Mzc3MQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/143771?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ollym", + "html_url": "https://github.com/ollym", + "followers_url": "https://api.github.com/users/ollym/followers", + "following_url": "https://api.github.com/users/ollym/following{/other_user}", + "gists_url": "https://api.github.com/users/ollym/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ollym/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ollym/subscriptions", + "organizations_url": "https://api.github.com/users/ollym/orgs", + "repos_url": "https://api.github.com/users/ollym/repos", + "events_url": "https://api.github.com/users/ollym/events{/privacy}", + "received_events_url": "https://api.github.com/users/ollym/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "paulconlin", + "id": 10995964, + "node_id": "MDQ6VXNlcjEwOTk1OTY0", + "avatar_url": "https://avatars.githubusercontent.com/u/10995964?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/paulconlin", + "html_url": "https://github.com/paulconlin", + "followers_url": "https://api.github.com/users/paulconlin/followers", + "following_url": "https://api.github.com/users/paulconlin/following{/other_user}", + "gists_url": "https://api.github.com/users/paulconlin/gists{/gist_id}", + "starred_url": "https://api.github.com/users/paulconlin/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/paulconlin/subscriptions", + "organizations_url": "https://api.github.com/users/paulconlin/orgs", + "repos_url": "https://api.github.com/users/paulconlin/repos", + "events_url": "https://api.github.com/users/paulconlin/events{/privacy}", + "received_events_url": "https://api.github.com/users/paulconlin/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "pimpin", + "id": 462084, + "node_id": "MDQ6VXNlcjQ2MjA4NA==", + "avatar_url": "https://avatars.githubusercontent.com/u/462084?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pimpin", + "html_url": "https://github.com/pimpin", + "followers_url": "https://api.github.com/users/pimpin/followers", + "following_url": "https://api.github.com/users/pimpin/following{/other_user}", + "gists_url": "https://api.github.com/users/pimpin/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pimpin/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pimpin/subscriptions", + "organizations_url": "https://api.github.com/users/pimpin/orgs", + "repos_url": "https://api.github.com/users/pimpin/repos", + "events_url": "https://api.github.com/users/pimpin/events{/privacy}", + "received_events_url": "https://api.github.com/users/pimpin/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "SamuelQZQ", + "id": 19623228, + "node_id": "MDQ6VXNlcjE5NjIzMjI4", + "avatar_url": "https://avatars.githubusercontent.com/u/19623228?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/SamuelQZQ", + "html_url": "https://github.com/SamuelQZQ", + "followers_url": "https://api.github.com/users/SamuelQZQ/followers", + "following_url": "https://api.github.com/users/SamuelQZQ/following{/other_user}", + "gists_url": "https://api.github.com/users/SamuelQZQ/gists{/gist_id}", + "starred_url": "https://api.github.com/users/SamuelQZQ/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/SamuelQZQ/subscriptions", + "organizations_url": "https://api.github.com/users/SamuelQZQ/orgs", + "repos_url": "https://api.github.com/users/SamuelQZQ/repos", + "events_url": "https://api.github.com/users/SamuelQZQ/events{/privacy}", + "received_events_url": "https://api.github.com/users/SamuelQZQ/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "prog-rajkamal", + "id": 11518519, + "node_id": "MDQ6VXNlcjExNTE4NTE5", + "avatar_url": "https://avatars.githubusercontent.com/u/11518519?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/prog-rajkamal", + "html_url": "https://github.com/prog-rajkamal", + "followers_url": "https://api.github.com/users/prog-rajkamal/followers", + "following_url": "https://api.github.com/users/prog-rajkamal/following{/other_user}", + "gists_url": "https://api.github.com/users/prog-rajkamal/gists{/gist_id}", + "starred_url": "https://api.github.com/users/prog-rajkamal/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/prog-rajkamal/subscriptions", + "organizations_url": "https://api.github.com/users/prog-rajkamal/orgs", + "repos_url": "https://api.github.com/users/prog-rajkamal/repos", + "events_url": "https://api.github.com/users/prog-rajkamal/events{/privacy}", + "received_events_url": "https://api.github.com/users/prog-rajkamal/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "CODE-AXION", + "id": 97381867, + "node_id": "U_kgDOBc3t6w", + "avatar_url": "https://avatars.githubusercontent.com/u/97381867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/CODE-AXION", + "html_url": "https://github.com/CODE-AXION", + "followers_url": "https://api.github.com/users/CODE-AXION/followers", + "following_url": "https://api.github.com/users/CODE-AXION/following{/other_user}", + "gists_url": "https://api.github.com/users/CODE-AXION/gists{/gist_id}", + "starred_url": "https://api.github.com/users/CODE-AXION/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/CODE-AXION/subscriptions", + "organizations_url": "https://api.github.com/users/CODE-AXION/orgs", + "repos_url": "https://api.github.com/users/CODE-AXION/repos", + "events_url": "https://api.github.com/users/CODE-AXION/events{/privacy}", + "received_events_url": "https://api.github.com/users/CODE-AXION/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rpFilipe", + "id": 12675825, + "node_id": "MDQ6VXNlcjEyNjc1ODI1", + "avatar_url": "https://avatars.githubusercontent.com/u/12675825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rpFilipe", + "html_url": "https://github.com/rpFilipe", + "followers_url": "https://api.github.com/users/rpFilipe/followers", + "following_url": "https://api.github.com/users/rpFilipe/following{/other_user}", + "gists_url": "https://api.github.com/users/rpFilipe/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rpFilipe/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rpFilipe/subscriptions", + "organizations_url": "https://api.github.com/users/rpFilipe/orgs", + "repos_url": "https://api.github.com/users/rpFilipe/repos", + "events_url": "https://api.github.com/users/rpFilipe/events{/privacy}", + "received_events_url": "https://api.github.com/users/rpFilipe/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rileydutton", + "id": 396888, + "node_id": "MDQ6VXNlcjM5Njg4OA==", + "avatar_url": "https://avatars.githubusercontent.com/u/396888?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rileydutton", + "html_url": "https://github.com/rileydutton", + "followers_url": "https://api.github.com/users/rileydutton/followers", + "following_url": "https://api.github.com/users/rileydutton/following{/other_user}", + "gists_url": "https://api.github.com/users/rileydutton/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rileydutton/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rileydutton/subscriptions", + "organizations_url": "https://api.github.com/users/rileydutton/orgs", + "repos_url": "https://api.github.com/users/rileydutton/repos", + "events_url": "https://api.github.com/users/rileydutton/events{/privacy}", + "received_events_url": "https://api.github.com/users/rileydutton/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rileygowan", + "id": 28757259, + "node_id": "MDQ6VXNlcjI4NzU3MjU5", + "avatar_url": "https://avatars.githubusercontent.com/u/28757259?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rileygowan", + "html_url": "https://github.com/rileygowan", + "followers_url": "https://api.github.com/users/rileygowan/followers", + "following_url": "https://api.github.com/users/rileygowan/following{/other_user}", + "gists_url": "https://api.github.com/users/rileygowan/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rileygowan/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rileygowan/subscriptions", + "organizations_url": "https://api.github.com/users/rileygowan/orgs", + "repos_url": "https://api.github.com/users/rileygowan/repos", + "events_url": "https://api.github.com/users/rileygowan/events{/privacy}", + "received_events_url": "https://api.github.com/users/rileygowan/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "nickvans", + "id": 9273051, + "node_id": "MDQ6VXNlcjkyNzMwNTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/9273051?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nickvans", + "html_url": "https://github.com/nickvans", + "followers_url": "https://api.github.com/users/nickvans/followers", + "following_url": "https://api.github.com/users/nickvans/following{/other_user}", + "gists_url": "https://api.github.com/users/nickvans/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nickvans/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nickvans/subscriptions", + "organizations_url": "https://api.github.com/users/nickvans/orgs", + "repos_url": "https://api.github.com/users/nickvans/repos", + "events_url": "https://api.github.com/users/nickvans/events{/privacy}", + "received_events_url": "https://api.github.com/users/nickvans/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "nurbson", + "id": 105279089, + "node_id": "U_kgDOBkZucQ", + "avatar_url": "https://avatars.githubusercontent.com/u/105279089?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/nurbson", + "html_url": "https://github.com/nurbson", + "followers_url": "https://api.github.com/users/nurbson/followers", + "following_url": "https://api.github.com/users/nurbson/following{/other_user}", + "gists_url": "https://api.github.com/users/nurbson/gists{/gist_id}", + "starred_url": "https://api.github.com/users/nurbson/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/nurbson/subscriptions", + "organizations_url": "https://api.github.com/users/nurbson/orgs", + "repos_url": "https://api.github.com/users/nurbson/repos", + "events_url": "https://api.github.com/users/nurbson/events{/privacy}", + "received_events_url": "https://api.github.com/users/nurbson/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "pppp606", + "id": 7203958, + "node_id": "MDQ6VXNlcjcyMDM5NTg=", + "avatar_url": "https://avatars.githubusercontent.com/u/7203958?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pppp606", + "html_url": "https://github.com/pppp606", + "followers_url": "https://api.github.com/users/pppp606/followers", + "following_url": "https://api.github.com/users/pppp606/following{/other_user}", + "gists_url": "https://api.github.com/users/pppp606/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pppp606/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pppp606/subscriptions", + "organizations_url": "https://api.github.com/users/pppp606/orgs", + "repos_url": "https://api.github.com/users/pppp606/repos", + "events_url": "https://api.github.com/users/pppp606/events{/privacy}", + "received_events_url": "https://api.github.com/users/pppp606/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "r-a-c-h-e-l", + "id": 9353578, + "node_id": "MDQ6VXNlcjkzNTM1Nzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/9353578?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/r-a-c-h-e-l", + "html_url": "https://github.com/r-a-c-h-e-l", + "followers_url": "https://api.github.com/users/r-a-c-h-e-l/followers", + "following_url": "https://api.github.com/users/r-a-c-h-e-l/following{/other_user}", + "gists_url": "https://api.github.com/users/r-a-c-h-e-l/gists{/gist_id}", + "starred_url": "https://api.github.com/users/r-a-c-h-e-l/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/r-a-c-h-e-l/subscriptions", + "organizations_url": "https://api.github.com/users/r-a-c-h-e-l/orgs", + "repos_url": "https://api.github.com/users/r-a-c-h-e-l/repos", + "events_url": "https://api.github.com/users/r-a-c-h-e-l/events{/privacy}", + "received_events_url": "https://api.github.com/users/r-a-c-h-e-l/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "rfinck", + "id": 1189568, + "node_id": "MDQ6VXNlcjExODk1Njg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1189568?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/rfinck", + "html_url": "https://github.com/rfinck", + "followers_url": "https://api.github.com/users/rfinck/followers", + "following_url": "https://api.github.com/users/rfinck/following{/other_user}", + "gists_url": "https://api.github.com/users/rfinck/gists{/gist_id}", + "starred_url": "https://api.github.com/users/rfinck/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/rfinck/subscriptions", + "organizations_url": "https://api.github.com/users/rfinck/orgs", + "repos_url": "https://api.github.com/users/rfinck/repos", + "events_url": "https://api.github.com/users/rfinck/events{/privacy}", + "received_events_url": "https://api.github.com/users/rfinck/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "tnishino", + "id": 2861943, + "node_id": "MDQ6VXNlcjI4NjE5NDM=", + "avatar_url": "https://avatars.githubusercontent.com/u/2861943?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tnishino", + "html_url": "https://github.com/tnishino", + "followers_url": "https://api.github.com/users/tnishino/followers", + "following_url": "https://api.github.com/users/tnishino/following{/other_user}", + "gists_url": "https://api.github.com/users/tnishino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tnishino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tnishino/subscriptions", + "organizations_url": "https://api.github.com/users/tnishino/orgs", + "repos_url": "https://api.github.com/users/tnishino/repos", + "events_url": "https://api.github.com/users/tnishino/events{/privacy}", + "received_events_url": "https://api.github.com/users/tnishino/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "silverwind", + "id": 115237, + "node_id": "MDQ6VXNlcjExNTIzNw==", + "avatar_url": "https://avatars.githubusercontent.com/u/115237?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/silverwind", + "html_url": "https://github.com/silverwind", + "followers_url": "https://api.github.com/users/silverwind/followers", + "following_url": "https://api.github.com/users/silverwind/following{/other_user}", + "gists_url": "https://api.github.com/users/silverwind/gists{/gist_id}", + "starred_url": "https://api.github.com/users/silverwind/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/silverwind/subscriptions", + "organizations_url": "https://api.github.com/users/silverwind/orgs", + "repos_url": "https://api.github.com/users/silverwind/repos", + "events_url": "https://api.github.com/users/silverwind/events{/privacy}", + "received_events_url": "https://api.github.com/users/silverwind/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "thuytv-gl", + "id": 107306319, + "node_id": "U_kgDOBmVdTw", + "avatar_url": "https://avatars.githubusercontent.com/u/107306319?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/thuytv-gl", + "html_url": "https://github.com/thuytv-gl", + "followers_url": "https://api.github.com/users/thuytv-gl/followers", + "following_url": "https://api.github.com/users/thuytv-gl/following{/other_user}", + "gists_url": "https://api.github.com/users/thuytv-gl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/thuytv-gl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/thuytv-gl/subscriptions", + "organizations_url": "https://api.github.com/users/thuytv-gl/orgs", + "repos_url": "https://api.github.com/users/thuytv-gl/repos", + "events_url": "https://api.github.com/users/thuytv-gl/events{/privacy}", + "received_events_url": "https://api.github.com/users/thuytv-gl/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "tka", + "id": 65579, + "node_id": "MDQ6VXNlcjY1NTc5", + "avatar_url": "https://avatars.githubusercontent.com/u/65579?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tka", + "html_url": "https://github.com/tka", + "followers_url": "https://api.github.com/users/tka/followers", + "following_url": "https://api.github.com/users/tka/following{/other_user}", + "gists_url": "https://api.github.com/users/tka/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tka/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tka/subscriptions", + "organizations_url": "https://api.github.com/users/tka/orgs", + "repos_url": "https://api.github.com/users/tka/repos", + "events_url": "https://api.github.com/users/tka/events{/privacy}", + "received_events_url": "https://api.github.com/users/tka/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "tyutjohn", + "id": 36732345, + "node_id": "MDQ6VXNlcjM2NzMyMzQ1", + "avatar_url": "https://avatars.githubusercontent.com/u/36732345?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tyutjohn", + "html_url": "https://github.com/tyutjohn", + "followers_url": "https://api.github.com/users/tyutjohn/followers", + "following_url": "https://api.github.com/users/tyutjohn/following{/other_user}", + "gists_url": "https://api.github.com/users/tyutjohn/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tyutjohn/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tyutjohn/subscriptions", + "organizations_url": "https://api.github.com/users/tyutjohn/orgs", + "repos_url": "https://api.github.com/users/tyutjohn/repos", + "events_url": "https://api.github.com/users/tyutjohn/events{/privacy}", + "received_events_url": "https://api.github.com/users/tyutjohn/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "vitonsky", + "id": 86191922, + "node_id": "MDQ6VXNlcjg2MTkxOTIy", + "avatar_url": "https://avatars.githubusercontent.com/u/86191922?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vitonsky", + "html_url": "https://github.com/vitonsky", + "followers_url": "https://api.github.com/users/vitonsky/followers", + "following_url": "https://api.github.com/users/vitonsky/following{/other_user}", + "gists_url": "https://api.github.com/users/vitonsky/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vitonsky/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vitonsky/subscriptions", + "organizations_url": "https://api.github.com/users/vitonsky/orgs", + "repos_url": "https://api.github.com/users/vitonsky/repos", + "events_url": "https://api.github.com/users/vitonsky/events{/privacy}", + "received_events_url": "https://api.github.com/users/vitonsky/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "vmmoorthy", + "id": 58259989, + "node_id": "MDQ6VXNlcjU4MjU5OTg5", + "avatar_url": "https://avatars.githubusercontent.com/u/58259989?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vmmoorthy", + "html_url": "https://github.com/vmmoorthy", + "followers_url": "https://api.github.com/users/vmmoorthy/followers", + "following_url": "https://api.github.com/users/vmmoorthy/following{/other_user}", + "gists_url": "https://api.github.com/users/vmmoorthy/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vmmoorthy/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vmmoorthy/subscriptions", + "organizations_url": "https://api.github.com/users/vmmoorthy/orgs", + "repos_url": "https://api.github.com/users/vmmoorthy/repos", + "events_url": "https://api.github.com/users/vmmoorthy/events{/privacy}", + "received_events_url": "https://api.github.com/users/vmmoorthy/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "williamforster", + "id": 22677980, + "node_id": "MDQ6VXNlcjIyNjc3OTgw", + "avatar_url": "https://avatars.githubusercontent.com/u/22677980?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/williamforster", + "html_url": "https://github.com/williamforster", + "followers_url": "https://api.github.com/users/williamforster/followers", + "following_url": "https://api.github.com/users/williamforster/following{/other_user}", + "gists_url": "https://api.github.com/users/williamforster/gists{/gist_id}", + "starred_url": "https://api.github.com/users/williamforster/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/williamforster/subscriptions", + "organizations_url": "https://api.github.com/users/williamforster/orgs", + "repos_url": "https://api.github.com/users/williamforster/repos", + "events_url": "https://api.github.com/users/williamforster/events{/privacy}", + "received_events_url": "https://api.github.com/users/williamforster/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "wvddrss", + "id": 2890010, + "node_id": "MDQ6VXNlcjI4OTAwMTA=", + "avatar_url": "https://avatars.githubusercontent.com/u/2890010?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/wvddrss", + "html_url": "https://github.com/wvddrss", + "followers_url": "https://api.github.com/users/wvddrss/followers", + "following_url": "https://api.github.com/users/wvddrss/following{/other_user}", + "gists_url": "https://api.github.com/users/wvddrss/gists{/gist_id}", + "starred_url": "https://api.github.com/users/wvddrss/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/wvddrss/subscriptions", + "organizations_url": "https://api.github.com/users/wvddrss/orgs", + "repos_url": "https://api.github.com/users/wvddrss/repos", + "events_url": "https://api.github.com/users/wvddrss/events{/privacy}", + "received_events_url": "https://api.github.com/users/wvddrss/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "xushengfeng", + "id": 28475549, + "node_id": "MDQ6VXNlcjI4NDc1NTQ5", + "avatar_url": "https://avatars.githubusercontent.com/u/28475549?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/xushengfeng", + "html_url": "https://github.com/xushengfeng", + "followers_url": "https://api.github.com/users/xushengfeng/followers", + "following_url": "https://api.github.com/users/xushengfeng/following{/other_user}", + "gists_url": "https://api.github.com/users/xushengfeng/gists{/gist_id}", + "starred_url": "https://api.github.com/users/xushengfeng/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/xushengfeng/subscriptions", + "organizations_url": "https://api.github.com/users/xushengfeng/orgs", + "repos_url": "https://api.github.com/users/xushengfeng/repos", + "events_url": "https://api.github.com/users/xushengfeng/events{/privacy}", + "received_events_url": "https://api.github.com/users/xushengfeng/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "y-yagi", + "id": 987638, + "node_id": "MDQ6VXNlcjk4NzYzOA==", + "avatar_url": "https://avatars.githubusercontent.com/u/987638?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/y-yagi", + "html_url": "https://github.com/y-yagi", + "followers_url": "https://api.github.com/users/y-yagi/followers", + "following_url": "https://api.github.com/users/y-yagi/following{/other_user}", + "gists_url": "https://api.github.com/users/y-yagi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/y-yagi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/y-yagi/subscriptions", + "organizations_url": "https://api.github.com/users/y-yagi/orgs", + "repos_url": "https://api.github.com/users/y-yagi/repos", + "events_url": "https://api.github.com/users/y-yagi/events{/privacy}", + "received_events_url": "https://api.github.com/users/y-yagi/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "boomyao", + "id": 11887118, + "node_id": "MDQ6VXNlcjExODg3MTE4", + "avatar_url": "https://avatars.githubusercontent.com/u/11887118?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/boomyao", + "html_url": "https://github.com/boomyao", + "followers_url": "https://api.github.com/users/boomyao/followers", + "following_url": "https://api.github.com/users/boomyao/following{/other_user}", + "gists_url": "https://api.github.com/users/boomyao/gists{/gist_id}", + "starred_url": "https://api.github.com/users/boomyao/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/boomyao/subscriptions", + "organizations_url": "https://api.github.com/users/boomyao/orgs", + "repos_url": "https://api.github.com/users/boomyao/repos", + "events_url": "https://api.github.com/users/boomyao/events{/privacy}", + "received_events_url": "https://api.github.com/users/boomyao/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "zntus", + "id": 15321422, + "node_id": "MDQ6VXNlcjE1MzIxNDIy", + "avatar_url": "https://avatars.githubusercontent.com/u/15321422?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zntus", + "html_url": "https://github.com/zntus", + "followers_url": "https://api.github.com/users/zntus/followers", + "following_url": "https://api.github.com/users/zntus/following{/other_user}", + "gists_url": "https://api.github.com/users/zntus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zntus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zntus/subscriptions", + "organizations_url": "https://api.github.com/users/zntus/orgs", + "repos_url": "https://api.github.com/users/zntus/repos", + "events_url": "https://api.github.com/users/zntus/events{/privacy}", + "received_events_url": "https://api.github.com/users/zntus/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "xiaofeiniuuu", + "id": 29246287, + "node_id": "MDQ6VXNlcjI5MjQ2Mjg3", + "avatar_url": "https://avatars.githubusercontent.com/u/29246287?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/xiaofeiniuuu", + "html_url": "https://github.com/xiaofeiniuuu", + "followers_url": "https://api.github.com/users/xiaofeiniuuu/followers", + "following_url": "https://api.github.com/users/xiaofeiniuuu/following{/other_user}", + "gists_url": "https://api.github.com/users/xiaofeiniuuu/gists{/gist_id}", + "starred_url": "https://api.github.com/users/xiaofeiniuuu/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/xiaofeiniuuu/subscriptions", + "organizations_url": "https://api.github.com/users/xiaofeiniuuu/orgs", + "repos_url": "https://api.github.com/users/xiaofeiniuuu/repos", + "events_url": "https://api.github.com/users/xiaofeiniuuu/events{/privacy}", + "received_events_url": "https://api.github.com/users/xiaofeiniuuu/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "juzhiyuan", + "id": 2106987, + "node_id": "MDQ6VXNlcjIxMDY5ODc=", + "avatar_url": "https://avatars.githubusercontent.com/u/2106987?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/juzhiyuan", + "html_url": "https://github.com/juzhiyuan", + "followers_url": "https://api.github.com/users/juzhiyuan/followers", + "following_url": "https://api.github.com/users/juzhiyuan/following{/other_user}", + "gists_url": "https://api.github.com/users/juzhiyuan/gists{/gist_id}", + "starred_url": "https://api.github.com/users/juzhiyuan/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/juzhiyuan/subscriptions", + "organizations_url": "https://api.github.com/users/juzhiyuan/orgs", + "repos_url": "https://api.github.com/users/juzhiyuan/repos", + "events_url": "https://api.github.com/users/juzhiyuan/events{/privacy}", + "received_events_url": "https://api.github.com/users/juzhiyuan/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "robothot", + "id": 91561865, + "node_id": "U_kgDOBXUfiQ", + "avatar_url": "https://avatars.githubusercontent.com/u/91561865?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/robothot", + "html_url": "https://github.com/robothot", + "followers_url": "https://api.github.com/users/robothot/followers", + "following_url": "https://api.github.com/users/robothot/following{/other_user}", + "gists_url": "https://api.github.com/users/robothot/gists{/gist_id}", + "starred_url": "https://api.github.com/users/robothot/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/robothot/subscriptions", + "organizations_url": "https://api.github.com/users/robothot/orgs", + "repos_url": "https://api.github.com/users/robothot/repos", + "events_url": "https://api.github.com/users/robothot/events{/privacy}", + "received_events_url": "https://api.github.com/users/robothot/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "junghwan-park", + "id": 7088720, + "node_id": "MDQ6VXNlcjcwODg3MjA=", + "avatar_url": "https://avatars.githubusercontent.com/u/7088720?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/junghwan-park", + "html_url": "https://github.com/junghwan-park", + "followers_url": "https://api.github.com/users/junghwan-park/followers", + "following_url": "https://api.github.com/users/junghwan-park/following{/other_user}", + "gists_url": "https://api.github.com/users/junghwan-park/gists{/gist_id}", + "starred_url": "https://api.github.com/users/junghwan-park/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/junghwan-park/subscriptions", + "organizations_url": "https://api.github.com/users/junghwan-park/orgs", + "repos_url": "https://api.github.com/users/junghwan-park/repos", + "events_url": "https://api.github.com/users/junghwan-park/events{/privacy}", + "received_events_url": "https://api.github.com/users/junghwan-park/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "zhangshine", + "id": 1389213, + "node_id": "MDQ6VXNlcjEzODkyMTM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1389213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/zhangshine", + "html_url": "https://github.com/zhangshine", + "followers_url": "https://api.github.com/users/zhangshine/followers", + "following_url": "https://api.github.com/users/zhangshine/following{/other_user}", + "gists_url": "https://api.github.com/users/zhangshine/gists{/gist_id}", + "starred_url": "https://api.github.com/users/zhangshine/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/zhangshine/subscriptions", + "organizations_url": "https://api.github.com/users/zhangshine/orgs", + "repos_url": "https://api.github.com/users/zhangshine/repos", + "events_url": "https://api.github.com/users/zhangshine/events{/privacy}", + "received_events_url": "https://api.github.com/users/zhangshine/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "sartoshi-foot-dao", + "id": 99770068, + "node_id": "U_kgDOBfJe1A", + "avatar_url": "https://avatars.githubusercontent.com/u/99770068?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/sartoshi-foot-dao", + "html_url": "https://github.com/sartoshi-foot-dao", + "followers_url": "https://api.github.com/users/sartoshi-foot-dao/followers", + "following_url": "https://api.github.com/users/sartoshi-foot-dao/following{/other_user}", + "gists_url": "https://api.github.com/users/sartoshi-foot-dao/gists{/gist_id}", + "starred_url": "https://api.github.com/users/sartoshi-foot-dao/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/sartoshi-foot-dao/subscriptions", + "organizations_url": "https://api.github.com/users/sartoshi-foot-dao/orgs", + "repos_url": "https://api.github.com/users/sartoshi-foot-dao/repos", + "events_url": "https://api.github.com/users/sartoshi-foot-dao/events{/privacy}", + "received_events_url": "https://api.github.com/users/sartoshi-foot-dao/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "linrz", + "id": 33575974, + "node_id": "MDQ6VXNlcjMzNTc1OTc0", + "avatar_url": "https://avatars.githubusercontent.com/u/33575974?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/linrz", + "html_url": "https://github.com/linrz", + "followers_url": "https://api.github.com/users/linrz/followers", + "following_url": "https://api.github.com/users/linrz/following{/other_user}", + "gists_url": "https://api.github.com/users/linrz/gists{/gist_id}", + "starred_url": "https://api.github.com/users/linrz/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/linrz/subscriptions", + "organizations_url": "https://api.github.com/users/linrz/orgs", + "repos_url": "https://api.github.com/users/linrz/repos", + "events_url": "https://api.github.com/users/linrz/events{/privacy}", + "received_events_url": "https://api.github.com/users/linrz/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "llamadeus", + "id": 43172445, + "node_id": "MDQ6VXNlcjQzMTcyNDQ1", + "avatar_url": "https://avatars.githubusercontent.com/u/43172445?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/llamadeus", + "html_url": "https://github.com/llamadeus", + "followers_url": "https://api.github.com/users/llamadeus/followers", + "following_url": "https://api.github.com/users/llamadeus/following{/other_user}", + "gists_url": "https://api.github.com/users/llamadeus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/llamadeus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/llamadeus/subscriptions", + "organizations_url": "https://api.github.com/users/llamadeus/orgs", + "repos_url": "https://api.github.com/users/llamadeus/repos", + "events_url": "https://api.github.com/users/llamadeus/events{/privacy}", + "received_events_url": "https://api.github.com/users/llamadeus/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "antucg", + "id": 2089578, + "node_id": "MDQ6VXNlcjIwODk1Nzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/2089578?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/antucg", + "html_url": "https://github.com/antucg", + "followers_url": "https://api.github.com/users/antucg/followers", + "following_url": "https://api.github.com/users/antucg/following{/other_user}", + "gists_url": "https://api.github.com/users/antucg/gists{/gist_id}", + "starred_url": "https://api.github.com/users/antucg/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/antucg/subscriptions", + "organizations_url": "https://api.github.com/users/antucg/orgs", + "repos_url": "https://api.github.com/users/antucg/repos", + "events_url": "https://api.github.com/users/antucg/events{/privacy}", + "received_events_url": "https://api.github.com/users/antucg/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "anvaka", + "id": 225407, + "node_id": "MDQ6VXNlcjIyNTQwNw==", + "avatar_url": "https://avatars.githubusercontent.com/u/225407?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/anvaka", + "html_url": "https://github.com/anvaka", + "followers_url": "https://api.github.com/users/anvaka/followers", + "following_url": "https://api.github.com/users/anvaka/following{/other_user}", + "gists_url": "https://api.github.com/users/anvaka/gists{/gist_id}", + "starred_url": "https://api.github.com/users/anvaka/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/anvaka/subscriptions", + "organizations_url": "https://api.github.com/users/anvaka/orgs", + "repos_url": "https://api.github.com/users/anvaka/repos", + "events_url": "https://api.github.com/users/anvaka/events{/privacy}", + "received_events_url": "https://api.github.com/users/anvaka/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "apgeo", + "id": 20897311, + "node_id": "MDQ6VXNlcjIwODk3MzEx", + "avatar_url": "https://avatars.githubusercontent.com/u/20897311?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/apgeo", + "html_url": "https://github.com/apgeo", + "followers_url": "https://api.github.com/users/apgeo/followers", + "following_url": "https://api.github.com/users/apgeo/following{/other_user}", + "gists_url": "https://api.github.com/users/apgeo/gists{/gist_id}", + "starred_url": "https://api.github.com/users/apgeo/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/apgeo/subscriptions", + "organizations_url": "https://api.github.com/users/apgeo/orgs", + "repos_url": "https://api.github.com/users/apgeo/repos", + "events_url": "https://api.github.com/users/apgeo/events{/privacy}", + "received_events_url": "https://api.github.com/users/apgeo/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "asteriskman7", + "id": 11001745, + "node_id": "MDQ6VXNlcjExMDAxNzQ1", + "avatar_url": "https://avatars.githubusercontent.com/u/11001745?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asteriskman7", + "html_url": "https://github.com/asteriskman7", + "followers_url": "https://api.github.com/users/asteriskman7/followers", + "following_url": "https://api.github.com/users/asteriskman7/following{/other_user}", + "gists_url": "https://api.github.com/users/asteriskman7/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asteriskman7/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asteriskman7/subscriptions", + "organizations_url": "https://api.github.com/users/asteriskman7/orgs", + "repos_url": "https://api.github.com/users/asteriskman7/repos", + "events_url": "https://api.github.com/users/asteriskman7/events{/privacy}", + "received_events_url": "https://api.github.com/users/asteriskman7/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "blucobalto", + "id": 2766247, + "node_id": "MDQ6VXNlcjI3NjYyNDc=", + "avatar_url": "https://avatars.githubusercontent.com/u/2766247?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/blucobalto", + "html_url": "https://github.com/blucobalto", + "followers_url": "https://api.github.com/users/blucobalto/followers", + "following_url": "https://api.github.com/users/blucobalto/following{/other_user}", + "gists_url": "https://api.github.com/users/blucobalto/gists{/gist_id}", + "starred_url": "https://api.github.com/users/blucobalto/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/blucobalto/subscriptions", + "organizations_url": "https://api.github.com/users/blucobalto/orgs", + "repos_url": "https://api.github.com/users/blucobalto/repos", + "events_url": "https://api.github.com/users/blucobalto/events{/privacy}", + "received_events_url": "https://api.github.com/users/blucobalto/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "bountysource-support", + "id": 5995486, + "node_id": "MDQ6VXNlcjU5OTU0ODY=", + "avatar_url": "https://avatars.githubusercontent.com/u/5995486?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bountysource-support", + "html_url": "https://github.com/bountysource-support", + "followers_url": "https://api.github.com/users/bountysource-support/followers", + "following_url": "https://api.github.com/users/bountysource-support/following{/other_user}", + "gists_url": "https://api.github.com/users/bountysource-support/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bountysource-support/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bountysource-support/subscriptions", + "organizations_url": "https://api.github.com/users/bountysource-support/orgs", + "repos_url": "https://api.github.com/users/bountysource-support/repos", + "events_url": "https://api.github.com/users/bountysource-support/events{/privacy}", + "received_events_url": "https://api.github.com/users/bountysource-support/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "brexis", + "id": 3931753, + "node_id": "MDQ6VXNlcjM5MzE3NTM=", + "avatar_url": "https://avatars.githubusercontent.com/u/3931753?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/brexis", + "html_url": "https://github.com/brexis", + "followers_url": "https://api.github.com/users/brexis/followers", + "following_url": "https://api.github.com/users/brexis/following{/other_user}", + "gists_url": "https://api.github.com/users/brexis/gists{/gist_id}", + "starred_url": "https://api.github.com/users/brexis/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/brexis/subscriptions", + "organizations_url": "https://api.github.com/users/brexis/orgs", + "repos_url": "https://api.github.com/users/brexis/repos", + "events_url": "https://api.github.com/users/brexis/events{/privacy}", + "received_events_url": "https://api.github.com/users/brexis/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "claas-c", + "id": 42590301, + "node_id": "MDQ6VXNlcjQyNTkwMzAx", + "avatar_url": "https://avatars.githubusercontent.com/u/42590301?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/claas-c", + "html_url": "https://github.com/claas-c", + "followers_url": "https://api.github.com/users/claas-c/followers", + "following_url": "https://api.github.com/users/claas-c/following{/other_user}", + "gists_url": "https://api.github.com/users/claas-c/gists{/gist_id}", + "starred_url": "https://api.github.com/users/claas-c/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/claas-c/subscriptions", + "organizations_url": "https://api.github.com/users/claas-c/orgs", + "repos_url": "https://api.github.com/users/claas-c/repos", + "events_url": "https://api.github.com/users/claas-c/events{/privacy}", + "received_events_url": "https://api.github.com/users/claas-c/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "doouding", + "id": 9301743, + "node_id": "MDQ6VXNlcjkzMDE3NDM=", + "avatar_url": "https://avatars.githubusercontent.com/u/9301743?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/doouding", + "html_url": "https://github.com/doouding", + "followers_url": "https://api.github.com/users/doouding/followers", + "following_url": "https://api.github.com/users/doouding/following{/other_user}", + "gists_url": "https://api.github.com/users/doouding/gists{/gist_id}", + "starred_url": "https://api.github.com/users/doouding/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/doouding/subscriptions", + "organizations_url": "https://api.github.com/users/doouding/orgs", + "repos_url": "https://api.github.com/users/doouding/repos", + "events_url": "https://api.github.com/users/doouding/events{/privacy}", + "received_events_url": "https://api.github.com/users/doouding/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "corleone113", + "id": 31824702, + "node_id": "MDQ6VXNlcjMxODI0NzAy", + "avatar_url": "https://avatars.githubusercontent.com/u/31824702?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/corleone113", + "html_url": "https://github.com/corleone113", + "followers_url": "https://api.github.com/users/corleone113/followers", + "following_url": "https://api.github.com/users/corleone113/following{/other_user}", + "gists_url": "https://api.github.com/users/corleone113/gists{/gist_id}", + "starred_url": "https://api.github.com/users/corleone113/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/corleone113/subscriptions", + "organizations_url": "https://api.github.com/users/corleone113/orgs", + "repos_url": "https://api.github.com/users/corleone113/repos", + "events_url": "https://api.github.com/users/corleone113/events{/privacy}", + "received_events_url": "https://api.github.com/users/corleone113/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "elohmeier", + "id": 2536303, + "node_id": "MDQ6VXNlcjI1MzYzMDM=", + "avatar_url": "https://avatars.githubusercontent.com/u/2536303?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/elohmeier", + "html_url": "https://github.com/elohmeier", + "followers_url": "https://api.github.com/users/elohmeier/followers", + "following_url": "https://api.github.com/users/elohmeier/following{/other_user}", + "gists_url": "https://api.github.com/users/elohmeier/gists{/gist_id}", + "starred_url": "https://api.github.com/users/elohmeier/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/elohmeier/subscriptions", + "organizations_url": "https://api.github.com/users/elohmeier/orgs", + "repos_url": "https://api.github.com/users/elohmeier/repos", + "events_url": "https://api.github.com/users/elohmeier/events{/privacy}", + "received_events_url": "https://api.github.com/users/elohmeier/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "geekduck", + "id": 1033311, + "node_id": "MDQ6VXNlcjEwMzMzMTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/1033311?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/geekduck", + "html_url": "https://github.com/geekduck", + "followers_url": "https://api.github.com/users/geekduck/followers", + "following_url": "https://api.github.com/users/geekduck/following{/other_user}", + "gists_url": "https://api.github.com/users/geekduck/gists{/gist_id}", + "starred_url": "https://api.github.com/users/geekduck/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/geekduck/subscriptions", + "organizations_url": "https://api.github.com/users/geekduck/orgs", + "repos_url": "https://api.github.com/users/geekduck/repos", + "events_url": "https://api.github.com/users/geekduck/events{/privacy}", + "received_events_url": "https://api.github.com/users/geekduck/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "jrking4", + "id": 1873583, + "node_id": "MDQ6VXNlcjE4NzM1ODM=", + "avatar_url": "https://avatars.githubusercontent.com/u/1873583?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jrking4", + "html_url": "https://github.com/jrking4", + "followers_url": "https://api.github.com/users/jrking4/followers", + "following_url": "https://api.github.com/users/jrking4/following{/other_user}", + "gists_url": "https://api.github.com/users/jrking4/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jrking4/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jrking4/subscriptions", + "organizations_url": "https://api.github.com/users/jrking4/orgs", + "repos_url": "https://api.github.com/users/jrking4/repos", + "events_url": "https://api.github.com/users/jrking4/events{/privacy}", + "received_events_url": "https://api.github.com/users/jrking4/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "kghandi", + "id": 6336722, + "node_id": "MDQ6VXNlcjYzMzY3MjI=", + "avatar_url": "https://avatars.githubusercontent.com/u/6336722?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kghandi", + "html_url": "https://github.com/kghandi", + "followers_url": "https://api.github.com/users/kghandi/followers", + "following_url": "https://api.github.com/users/kghandi/following{/other_user}", + "gists_url": "https://api.github.com/users/kghandi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kghandi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kghandi/subscriptions", + "organizations_url": "https://api.github.com/users/kghandi/orgs", + "repos_url": "https://api.github.com/users/kghandi/repos", + "events_url": "https://api.github.com/users/kghandi/events{/privacy}", + "received_events_url": "https://api.github.com/users/kghandi/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "laof", + "id": 8061178, + "node_id": "MDQ6VXNlcjgwNjExNzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/8061178?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/laof", + "html_url": "https://github.com/laof", + "followers_url": "https://api.github.com/users/laof/followers", + "following_url": "https://api.github.com/users/laof/following{/other_user}", + "gists_url": "https://api.github.com/users/laof/gists{/gist_id}", + "starred_url": "https://api.github.com/users/laof/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/laof/subscriptions", + "organizations_url": "https://api.github.com/users/laof/orgs", + "repos_url": "https://api.github.com/users/laof/repos", + "events_url": "https://api.github.com/users/laof/events{/privacy}", + "received_events_url": "https://api.github.com/users/laof/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "luciemars", + "id": 24876905, + "node_id": "MDQ6VXNlcjI0ODc2OTA1", + "avatar_url": "https://avatars.githubusercontent.com/u/24876905?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/luciemars", + "html_url": "https://github.com/luciemars", + "followers_url": "https://api.github.com/users/luciemars/followers", + "following_url": "https://api.github.com/users/luciemars/following{/other_user}", + "gists_url": "https://api.github.com/users/luciemars/gists{/gist_id}", + "starred_url": "https://api.github.com/users/luciemars/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/luciemars/subscriptions", + "organizations_url": "https://api.github.com/users/luciemars/orgs", + "repos_url": "https://api.github.com/users/luciemars/repos", + "events_url": "https://api.github.com/users/luciemars/events{/privacy}", + "received_events_url": "https://api.github.com/users/luciemars/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "meetwhere-dev", + "id": 65750209, + "node_id": "MDQ6VXNlcjY1NzUwMjA5", + "avatar_url": "https://avatars.githubusercontent.com/u/65750209?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/meetwhere-dev", + "html_url": "https://github.com/meetwhere-dev", + "followers_url": "https://api.github.com/users/meetwhere-dev/followers", + "following_url": "https://api.github.com/users/meetwhere-dev/following{/other_user}", + "gists_url": "https://api.github.com/users/meetwhere-dev/gists{/gist_id}", + "starred_url": "https://api.github.com/users/meetwhere-dev/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/meetwhere-dev/subscriptions", + "organizations_url": "https://api.github.com/users/meetwhere-dev/orgs", + "repos_url": "https://api.github.com/users/meetwhere-dev/repos", + "events_url": "https://api.github.com/users/meetwhere-dev/events{/privacy}", + "received_events_url": "https://api.github.com/users/meetwhere-dev/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "milonic", + "id": 43644601, + "node_id": "MDQ6VXNlcjQzNjQ0NjAx", + "avatar_url": "https://avatars.githubusercontent.com/u/43644601?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/milonic", + "html_url": "https://github.com/milonic", + "followers_url": "https://api.github.com/users/milonic/followers", + "following_url": "https://api.github.com/users/milonic/following{/other_user}", + "gists_url": "https://api.github.com/users/milonic/gists{/gist_id}", + "starred_url": "https://api.github.com/users/milonic/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/milonic/subscriptions", + "organizations_url": "https://api.github.com/users/milonic/orgs", + "repos_url": "https://api.github.com/users/milonic/repos", + "events_url": "https://api.github.com/users/milonic/events{/privacy}", + "received_events_url": "https://api.github.com/users/milonic/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "0s1r1s", + "id": 3586378, + "node_id": "MDQ6VXNlcjM1ODYzNzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/3586378?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/0s1r1s", + "html_url": "https://github.com/0s1r1s", + "followers_url": "https://api.github.com/users/0s1r1s/followers", + "following_url": "https://api.github.com/users/0s1r1s/following{/other_user}", + "gists_url": "https://api.github.com/users/0s1r1s/gists{/gist_id}", + "starred_url": "https://api.github.com/users/0s1r1s/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/0s1r1s/subscriptions", + "organizations_url": "https://api.github.com/users/0s1r1s/orgs", + "repos_url": "https://api.github.com/users/0s1r1s/repos", + "events_url": "https://api.github.com/users/0s1r1s/events{/privacy}", + "received_events_url": "https://api.github.com/users/0s1r1s/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Basa0", + "id": 36052820, + "node_id": "MDQ6VXNlcjM2MDUyODIw", + "avatar_url": "https://avatars.githubusercontent.com/u/36052820?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Basa0", + "html_url": "https://github.com/Basa0", + "followers_url": "https://api.github.com/users/Basa0/followers", + "following_url": "https://api.github.com/users/Basa0/following{/other_user}", + "gists_url": "https://api.github.com/users/Basa0/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Basa0/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Basa0/subscriptions", + "organizations_url": "https://api.github.com/users/Basa0/orgs", + "repos_url": "https://api.github.com/users/Basa0/repos", + "events_url": "https://api.github.com/users/Basa0/events{/privacy}", + "received_events_url": "https://api.github.com/users/Basa0/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "BinaryMoon", + "id": 1004130, + "node_id": "MDQ6VXNlcjEwMDQxMzA=", + "avatar_url": "https://avatars.githubusercontent.com/u/1004130?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/BinaryMoon", + "html_url": "https://github.com/BinaryMoon", + "followers_url": "https://api.github.com/users/BinaryMoon/followers", + "following_url": "https://api.github.com/users/BinaryMoon/following{/other_user}", + "gists_url": "https://api.github.com/users/BinaryMoon/gists{/gist_id}", + "starred_url": "https://api.github.com/users/BinaryMoon/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/BinaryMoon/subscriptions", + "organizations_url": "https://api.github.com/users/BinaryMoon/orgs", + "repos_url": "https://api.github.com/users/BinaryMoon/repos", + "events_url": "https://api.github.com/users/BinaryMoon/events{/privacy}", + "received_events_url": "https://api.github.com/users/BinaryMoon/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "bernardofd", + "id": 2365802, + "node_id": "MDQ6VXNlcjIzNjU4MDI=", + "avatar_url": "https://avatars.githubusercontent.com/u/2365802?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bernardofd", + "html_url": "https://github.com/bernardofd", + "followers_url": "https://api.github.com/users/bernardofd/followers", + "following_url": "https://api.github.com/users/bernardofd/following{/other_user}", + "gists_url": "https://api.github.com/users/bernardofd/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bernardofd/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bernardofd/subscriptions", + "organizations_url": "https://api.github.com/users/bernardofd/orgs", + "repos_url": "https://api.github.com/users/bernardofd/repos", + "events_url": "https://api.github.com/users/bernardofd/events{/privacy}", + "received_events_url": "https://api.github.com/users/bernardofd/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "bitdeli-chef", + "id": 3092978, + "node_id": "MDQ6VXNlcjMwOTI5Nzg=", + "avatar_url": "https://avatars.githubusercontent.com/u/3092978?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitdeli-chef", + "html_url": "https://github.com/bitdeli-chef", + "followers_url": "https://api.github.com/users/bitdeli-chef/followers", + "following_url": "https://api.github.com/users/bitdeli-chef/following{/other_user}", + "gists_url": "https://api.github.com/users/bitdeli-chef/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitdeli-chef/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitdeli-chef/subscriptions", + "organizations_url": "https://api.github.com/users/bitdeli-chef/orgs", + "repos_url": "https://api.github.com/users/bitdeli-chef/repos", + "events_url": "https://api.github.com/users/bitdeli-chef/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitdeli-chef/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "blobinabottle", + "id": 8090162, + "node_id": "MDQ6VXNlcjgwOTAxNjI=", + "avatar_url": "https://avatars.githubusercontent.com/u/8090162?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/blobinabottle", + "html_url": "https://github.com/blobinabottle", + "followers_url": "https://api.github.com/users/blobinabottle/followers", + "following_url": "https://api.github.com/users/blobinabottle/following{/other_user}", + "gists_url": "https://api.github.com/users/blobinabottle/gists{/gist_id}", + "starred_url": "https://api.github.com/users/blobinabottle/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/blobinabottle/subscriptions", + "organizations_url": "https://api.github.com/users/blobinabottle/orgs", + "repos_url": "https://api.github.com/users/blobinabottle/repos", + "events_url": "https://api.github.com/users/blobinabottle/events{/privacy}", + "received_events_url": "https://api.github.com/users/blobinabottle/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 + }, + { + "login": "Brandn-H", + "id": 16454412, + "node_id": "MDQ6VXNlcjE2NDU0NDEy", + "avatar_url": "https://avatars.githubusercontent.com/u/16454412?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Brandn-H", + "html_url": "https://github.com/Brandn-H", + "followers_url": "https://api.github.com/users/Brandn-H/followers", + "following_url": "https://api.github.com/users/Brandn-H/following{/other_user}", + "gists_url": "https://api.github.com/users/Brandn-H/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Brandn-H/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Brandn-H/subscriptions", + "organizations_url": "https://api.github.com/users/Brandn-H/orgs", + "repos_url": "https://api.github.com/users/Brandn-H/repos", + "events_url": "https://api.github.com/users/Brandn-H/events{/privacy}", + "received_events_url": "https://api.github.com/users/Brandn-H/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false, + "contributions": 1 } ] \ No newline at end of file diff --git a/src/components/CoolCanvasBanner/setupCanvasBanner.js b/src/components/CoolCanvasBanner/setupCanvasBanner.js index 3d92d3094..034a473ce 100644 --- a/src/components/CoolCanvasBanner/setupCanvasBanner.js +++ b/src/components/CoolCanvasBanner/setupCanvasBanner.js @@ -12,11 +12,25 @@ import { Ellipse, Group, FabricObject, -} from 'fabric'; + Path, + Gradient, + classRegistry, +} from 'fabric/es'; + + export const setupCanvasBanner = ({ canvasEl, container }) => { + classRegistry.setClass(Path); + classRegistry.setSVGClass(Path); + classRegistry.setClass(Gradient, 'gradient'); + classRegistry.setClass(Gradient, 'linear'); + classRegistry.setClass(Gradient, 'radial'); FabricObject.ownDefaults.originX = 'center'; FabricObject.ownDefaults.originY = 'center'; + FabricObject.ownDefaults.cornerStrokeColor = 'white'; + FabricObject.ownDefaults.cornerStyle = 'circle'; + FabricObject.ownDefaults.cornerColor = '#0C7CAC'; + FabricObject.ownDefaults.transparentCorners = false; const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { if (entry.target === container) { diff --git a/src/components/FeaturedBanner/FeaturedBanner.astro b/src/components/FeaturedBanner/FeaturedBanner.astro index 43beb90e4..1d7661a09 100644 --- a/src/components/FeaturedBanner/FeaturedBanner.astro +++ b/src/components/FeaturedBanner/FeaturedBanner.astro @@ -3,7 +3,6 @@ import './featuredBanner.css'; import { CoolCanvasBanner } from '../CoolCanvasBanner/CoolCanvasBanner'; ---
-

Fabric.js is a powerful and simple Javascript HTML5 canvas library

@@ -12,4 +11,5 @@ import { CoolCanvasBanner } from '../CoolCanvasBanner/CoolCanvasBanner'; also provide serialization and has SVG-to-canvas (and canvas-to-SVG) parser

+
diff --git a/src/components/GithubEditLink/index.astro b/src/components/GithubEditLink/index.astro index 42c894aae..bb161a292 100644 --- a/src/components/GithubEditLink/index.astro +++ b/src/components/GithubEditLink/index.astro @@ -9,7 +9,7 @@ const { relativePath } = Astro.props; class="github-edit-link" target="_blank" rel="noreferrer" - href={`https://github.com/fabricjs/fabricjs.github.io/tree/development/src/content/${relativePath}`} + href={`https://github.com/fabricjs/fabricjs.github.io/edit/main/src/content/${relativePath}`} > Edit this page on Github - \ No newline at end of file + diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index 22206f152..64b40c5da 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -1,40 +1,33 @@ + + + + - \ No newline at end of file + diff --git a/src/components/Header/HeaderWithSearch.astro b/src/components/Header/HeaderWithSearch.astro index a827cbbab..afbc3f174 100644 --- a/src/components/Header/HeaderWithSearch.astro +++ b/src/components/Header/HeaderWithSearch.astro @@ -4,5 +4,5 @@ import Header from './Header.astro'; ---
- -
\ No newline at end of file + + diff --git a/src/components/LatestRelease/LatestRelease.astro b/src/components/LatestRelease/LatestRelease.astro new file mode 100644 index 000000000..072f4bbc2 --- /dev/null +++ b/src/components/LatestRelease/LatestRelease.astro @@ -0,0 +1,72 @@ +--- +export interface Props { + version?: string; + url?: string; + subtitle?: string; +} +const { + version = '6.9.0', + url = 'https://github.com/fabricjs/fabric.js/releases', + subtitle = 'Download latest release from GitHub', +} = Astro.props as Props; +--- + + + + + Latest release {version} + {subtitle} + + + + diff --git a/src/components/PageTitleDocs/PageTitle.astro b/src/components/PageTitleDocs/PageTitle.astro index 80dd1b1ea..824be54e0 100644 --- a/src/components/PageTitleDocs/PageTitle.astro +++ b/src/components/PageTitleDocs/PageTitle.astro @@ -1,9 +1,9 @@ --- import RealPageTitle from '@astrojs/starlight/components/PageTitle.astro'; -import CarbonAd from '../CarbonAd/InlineCarbonAd'; +import CarbonAd from '../CarbonAd/InlineCarbonAd.astro'; const props = Astro.props --- - + \ No newline at end of file diff --git a/src/components/Resources/Resources.astro b/src/components/Resources/Resources.astro new file mode 100644 index 000000000..a9ca3e8a2 --- /dev/null +++ b/src/components/Resources/Resources.astro @@ -0,0 +1,32 @@ +--- +import './resources.css'; +const links = [ + { + link: 'https://github.com/fabricjs/fabric.js', + name: '@fabricjs/fabric.js', + description: ' - The powerful and simple javascript HTML Canvas library', + }, + { + link: 'https://github.com/cs-open/react-fabric', + description: + ' - A high-extensibility library with a composite style, built with React', + name: '@cs-open/react-fabric', + }, +]; +--- + +
+

Resources

+ +
diff --git a/src/components/Resources/resources.css b/src/components/Resources/resources.css new file mode 100644 index 000000000..f36c7ec56 --- /dev/null +++ b/src/components/Resources/resources.css @@ -0,0 +1,19 @@ +#resources { + display: flex; + flex-direction: column; + align-items: center; + justify-items: center; +} +#resources ul { + display: flex; + flex-direction: column; + row-gap: 1rem; +} +#resources li { + display: flex; + flex-direction: row; + gap: 1rem; +} +#resources .resource-label { + color: var(--primary-color); +} diff --git a/src/components/TeamMember/index.astro b/src/components/TeamMember/index.astro index 15b0cad39..afb1670ad 100644 --- a/src/components/TeamMember/index.astro +++ b/src/components/TeamMember/index.astro @@ -1,12 +1,19 @@ --- import './index.css'; -export interface Props { - withSponsor?: boolean; - githubName?: typeof withSponsor extends true ? string : never; - imgSrc: string; - children: any; -} +type Props = + | { + withSponsor: true; + githubName: string; + imgSrc: string; + children: any; + } + | { + withSponsor?: false; + githubName?: never; + imgSrc: string; + children: any; + }; const { withSponsor, githubName, imgSrc } = Astro.props; --- @@ -35,4 +42,4 @@ const { withSponsor, githubName, imgSrc } = Astro.props; )}
- \ No newline at end of file + diff --git a/src/components/ThumbnailCard/index.css b/src/components/ThumbnailCard/index.css index 5ee96c9de..3215afa40 100644 --- a/src/components/ThumbnailCard/index.css +++ b/src/components/ThumbnailCard/index.css @@ -4,6 +4,7 @@ height: 0; padding-bottom: 60%; /*50*/ overflow: hidden; + border: 1px dashed var(--info-color); } .thumbCntnr > .img-wrapper { /*margin-top:-20%;/*-25*/ diff --git a/src/components/ThumbnailList/index.css b/src/components/ThumbnailList/index.css index 280f39b92..9a43b4eb0 100644 --- a/src/components/ThumbnailList/index.css +++ b/src/components/ThumbnailList/index.css @@ -1,5 +1,4 @@ ul.thumbList { - background-color: var(--offwhite-color); padding: 30px var(--padding-left-right); } ul.thumbList > li { diff --git a/src/content/demo/animating-crosses/index.mdx b/src/content/demo/animating-crosses/index.mdx index fa4c47911..18ff2026d 100644 --- a/src/content/demo/animating-crosses/index.mdx +++ b/src/content/demo/animating-crosses/index.mdx @@ -1,7 +1,7 @@ --- date: '2011-9-1' title: 'Animating crosses' -description: 'Animating crosses using FabricJS' +description: 'Animating crosses using Fabric.js' thumbnail: 'animating-crosses.png' tags: ['subclassing', 'animation'] --- diff --git a/src/content/demo/animation-easing/index.mdx b/src/content/demo/animation-easing/index.mdx index 71d2f7993..5e7e3e22b 100644 --- a/src/content/demo/animation-easing/index.mdx +++ b/src/content/demo/animation-easing/index.mdx @@ -1,7 +1,7 @@ --- date: '2012-07-25' title: 'Animation easing' -description: 'Animating easing in FabricJS' +description: 'Animating easing in Fabric.js' thumbnail: 'animation-easing.png' tags: ['animation', 'easing'] --- diff --git a/src/content/demo/clipping/index.mdx b/src/content/demo/clipping/index.mdx index 2748d779a..011cdce7d 100644 --- a/src/content/demo/clipping/index.mdx +++ b/src/content/demo/clipping/index.mdx @@ -1,7 +1,7 @@ --- date: '2013-03-15' title: 'Clipping and masking' -description: 'Clipping and masking in FabricJS' +description: 'Clipping and masking in Fabric.js' thumbnail: 'clipping.png' tags: ['clipping', 'masking', 'animation'] --- diff --git a/src/content/demo/copy-and-paste/index.mdx b/src/content/demo/copy-and-paste/index.mdx index 6eea91e87..c926236ed 100644 --- a/src/content/demo/copy-and-paste/index.mdx +++ b/src/content/demo/copy-and-paste/index.mdx @@ -1,7 +1,7 @@ --- date: '2017-08-29' title: 'Copy and paste' -description: 'Copy and paste in FabricJS' +description: 'Copy and paste in Fabric.js' thumbnail: 'copy-paste.png' tags: ['clipboard', 'copy', 'paste', 'text'] --- diff --git a/src/content/demo/duotone-filter/index.mdx b/src/content/demo/duotone-filter/index.mdx index c39f6ab25..1eb83a969 100644 --- a/src/content/demo/duotone-filter/index.mdx +++ b/src/content/demo/duotone-filter/index.mdx @@ -25,7 +25,7 @@ The logic is as follow: 3. blend a light color with multiply mode 4. blend a dark color with lighten mode -What follows is a simple FabricJS implementation of this technique. +What follows is a simple Fabric.js implementation of this technique. Above the canvas we place two color pickers in order to change the input values to obtain different outputs. diff --git a/src/content/demo/dynamic-patterns/code.js b/src/content/demo/dynamic-patterns/code.js new file mode 100644 index 000000000..a1c80c36a --- /dev/null +++ b/src/content/demo/dynamic-patterns/code.js @@ -0,0 +1,73 @@ +const canvas = new fabric.Canvas(canvasEl); +fabric.FabricObject.ownDefaults.transparentCorners = false; +const $ = (id) => document.getElementById(id); +const padding = 0; + +fabric.Image.fromURL('../assets/pug.jpg').then((img) => { + img.scaleToWidth(20); + const patternSourceCanvas = new fabric.StaticCanvas(); + patternSourceCanvas.setDimensions({ + width: img.getScaledWidth() + padding, + height: img.getScaledHeight() + padding, + }); + patternSourceCanvas.add(img); + patternSourceCanvas.renderAll(); + const pattern = new fabric.Pattern({ + source: patternSourceCanvas.getElement(), + repeat: 'repeat', + }); + canvas.add( + new fabric.Polygon( + [ + { x: 185, y: 0 }, + { x: 250, y: 100 }, + { x: 385, y: 170 }, + { x: 0, y: 245 }, + ], + { + left: 0, + top: 200, + angle: -30, + fill: pattern, + objectCaching: false, + stroke: 'black' + }, + ), + ); + + $('img-width').oninput = function () { + img.scaleToWidth(parseInt(this.value, 10)); + patternSourceCanvas.setDimensions({ + width: img.getScaledWidth() + padding, + height: img.getScaledHeight() + padding, + }); + patternSourceCanvas.renderAll(); + canvas.requestRenderAll(); + }; + $('img-angle').oninput = function () { + img.set('angle', this.value); + patternSourceCanvas.renderAll(); + canvas.requestRenderAll(); + }; + $('img-padding').oninput = function () { + padding = parseInt(this.value, 10); + patternSourceCanvas.setDimensions({ + width: img.getScaledWidth() + padding, + height: img.getScaledHeight() + padding, + }); + patternSourceCanvas.renderAll(); + canvas.requestRenderAll(); + }; + $('img-offset-x').oninput = function () { + pattern.offsetX = parseInt(this.value, 10); + canvas.requestRenderAll(); + }; + $('img-offset-y').oninput = function () { + pattern.offsetY = parseInt(this.value, 10); + canvas.requestRenderAll(); + }; + $('img-repeat').onclick = function () { + pattern.repeat = this.checked ? 'repeat' : 'no-repeat'; + canvas.requestRenderAll(); + }; +}); \ No newline at end of file diff --git a/src/content/demo/dynamic-patterns/dynamic-patterns.png b/src/content/demo/dynamic-patterns/dynamic-patterns.png new file mode 100644 index 000000000..1684fd0b7 Binary files /dev/null and b/src/content/demo/dynamic-patterns/dynamic-patterns.png differ diff --git a/src/content/demo/dynamic-patterns/index.mdx b/src/content/demo/dynamic-patterns/index.mdx new file mode 100644 index 000000000..1b760b21d --- /dev/null +++ b/src/content/demo/dynamic-patterns/index.mdx @@ -0,0 +1,42 @@ +--- +date: '2013-02-12' +title: 'Dynamic patterns' +description: 'Patterns options demonstration' +thumbnail: 'dynamic-patterns.png' +tags: ['pattern'] +--- +import { CodeEditor } from '../../../components/CodeEditor'; +import code from './code?raw'; +import '../../../css/demo-common.css'; + +
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+

+ + +

+

+ + +

+
+ + + + \ No newline at end of file diff --git a/src/content/demo/events-inspector/EventInspectorUI.jsx b/src/content/demo/events-inspector/EventInspectorUI.jsx index 3d250427f..9b999d7ef 100644 --- a/src/content/demo/events-inspector/EventInspectorUI.jsx +++ b/src/content/demo/events-inspector/EventInspectorUI.jsx @@ -1,29 +1,52 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useCallback, useRef, useState } from 'react'; +import { + EventCheckbox, + canvasEvents, + objectsEvents, + LogEntry, + eventGroups, + EventGroupCheckbox +} from './demoComponents'; import * as fabric from 'fabric'; import './index.css'; -// old html demo converted to a component without adapting the code to react. +// old html demo converted to a component with MINIMAL react adapatation. +// The react code written here has been written to remove the old code that was very contributor unfriendly. +// The react code has not been optimized or wrote to be a react best practice but it has written to just work. export const EventInspectorUI = () => { - useEffect(() => { - [ - 'toggle', - 'move', - 'dragover', - 'canvas_events', - 'green', - 'red', - 'blue', - 'black', - ].forEach((id) => { - document.getElementById(id).checked = true; - }); - }); + const canvasRef = useRef(); + + const logs = useRef([]); + const [logsUpdated, setLogsUpdated] = useState(0); + const eventStatusObj = useRef( + Object.fromEntries( + objectsEvents.map((key) => [key, false]) + ) + ); + const eventStatusCanvas = useRef( + Object.fromEntries( + canvasEvents.map((key) => [key, false]) + ) + ); + + const logCallback = useCallback((eventData, eventName, forCanvas) => { + const id = performance.now(); + if (forCanvas && !eventStatusCanvas.current[eventName]) { + return; + } + if (!forCanvas && !eventStatusObj.current[eventName]) { + return; + } + logs.current.push({ id, eventName, code: JSON.stringify(eventData, null, '\t') }); + logs.current = logs.current.slice(0, 100); + setLogsUpdated(id); + }, [setLogsUpdated]); useEffect(() => { fabric.FabricObject.ownDefaults.transparentCorners = false; - var canvas2 = new fabric.Canvas('c1'); - canvas2.add( + const canvas = canvasRef.current = new fabric.Canvas('c1'); + canvas.add( new fabric.Rect({ width: 50, height: 50, @@ -32,7 +55,7 @@ export const EventInspectorUI = () => { left: 100, }) ); - canvas2.add( + canvas.add( new fabric.Rect({ width: 30, height: 30, @@ -41,306 +64,85 @@ export const EventInspectorUI = () => { left: 50, }) ); - canvas2.add( + canvas.add( new fabric.Circle({ radius: 20, fill: 'blue', top: 160, left: 140 }) ); - canvas2.add( - new fabric.Textbox('Textbox', { fill: 'black', top: 70, left: 200 }) + canvas.add( + new fabric.Textbox('Textbox edit and drag me on textbox 2', { fill: 'black', top: 70, left: 200 }) + ); + canvas.add( + new fabric.Textbox('Textbox 2', { fill: 'black', top: 120, left: 400 }) ); - var log2 = document.getElementById('log1'); - var clearButton = document.getElementById('clear_log'); - clearButton.onclick = function () { - log2.innerHTML = ' '; - }; - - function log(message, opt, color) { - if (!getCheckbox(message, !!color)?.checked) { - return; - } - if (color && !document.getElementById(color).checked) { - return; - } - getCheckboxLabel(message, !!color)?.classList.add('bold'); - var el = document.createElement('div'); - el.classList.add('log-entry'); - el.setAttribute('event', message); - el.setAttribute('object', !!color); - if (color) { - el.style.color = color; - } - var code = document.createElement('code'); - code.innerText = JSON.stringify(opt, null, '\t'); - code.setAttribute('hidden', true); - var button = document.createElement('button'); - button.innerHTML = '+'; - button.onclick = function (ev) { - if (code.hasAttribute('hidden')) { - code.removeAttribute('hidden'); - button.innerHTML = '-'; - } else { - code.setAttribute('hidden', ''); - button.innerHTML = '+'; - } - }; - var m = document.createElement('strong'); - m.innerHTML = message; - var t = document.createElement('small'); - t.innerHTML = '\n' + new Date().toISOString(); - el.append(button, m, document.createElement('br'), code, t); - log2.insertBefore(el, log2.firstChild); - var children = log2.children; - while (children[100]) { - var child = children[100]; - log2.removeChild(child); - } - } - - function toggleLogs(eventName, obj, value) { - log2 - .querySelectorAll( - 'div[event = "' + eventName + '"][object = "' + !!obj + '"]' - ) - .forEach((el) => el.classList.toggle('hidden', !value)); - } - function getEventdescriptor(eventName, obj) { - return document.querySelector( - 'div[event = "' + eventName + '"][object = "' + !!obj + '"]' - ); - } - function getCheckbox(eventName, obj) { - return getEventdescriptor(eventName, obj)?.querySelector( - 'input[type = checkbox]' - ); - } - function getCheckboxLabel(eventName, obj) { - return getEventdescriptor(eventName, obj)?.querySelector('label'); - } - - function toggleCheckbox(eventName, obj, value) { - var checkbox = getCheckbox(eventName, obj); - if (checkbox) { - checkbox.checked = value; - checkbox.classList.remove('bold'); - } - toggleLogs(eventName, obj, value); - return checkbox; - } + canvasEvents.forEach((eventName) => { + canvas.on(eventName, (eventData) => logCallback(eventData, eventName, true)); + }); - function toggleMovementEvents() { - var events = [ - 'mouse:move', - 'mousemove', - 'mouse:move:before', - 'mousemove:before', - 'moving', - 'object:moving', - ]; - events.forEach((ev) => { - toggleCheckbox(ev, true, this.checked); - toggleCheckbox(ev, false, this.checked); + objectsEvents.forEach((eventName) => { + canvas.getObjects().forEach((obj) => { + obj.on(eventName, (eventData) => logCallback(eventData, eventName, false)); }); - } - function toggleDragOverEvents() { - toggleCheckbox('dragover', true, this.checked); - toggleCheckbox('dragover', false, this.checked); - } - function toggleCanvasEvents() { - Object.keys(canvas2.__eventListeners).forEach((ev) => { - toggleCheckbox(ev, false, this.checked); - }); - } - function toggleAll() { - document - .querySelectorAll('div[event] > input[type = checkbox]') - .forEach((checkbox) => (checkbox.checked = this.checked)); - } - document - .getElementById('move') - .addEventListener('change', toggleMovementEvents); - document - .getElementById('dragover') - .addEventListener('change', toggleDragOverEvents); - document - .getElementById('canvas_events') - .addEventListener('change', toggleCanvasEvents); - document.getElementById('toggle').addEventListener('change', toggleAll); - - let id = 0; - function createEventDescriptor(eventName, obj) { - var para = document.createElement('div'); - var checkbox = document.createElement('input'); - checkbox.id = 'checkbox_' + ++id; - checkbox.type = 'checkbox'; - checkbox.checked = true; - checkbox.onchange = () => { - checkbox.classList.remove('bold'); - toggleLogs(eventName, obj, checkbox.checked); - }; - para.setAttribute('event', eventName); - para.setAttribute('object', !!obj); - var label = document.createElement('label'); - label.appendChild(document.createTextNode(eventName)); - label.htmlFor = checkbox.id; - para.append(checkbox, label); - return para; - } - - function logObservingEvent(eventName) { - var el = document.getElementById('observing-events-log'); - el.appendChild(createEventDescriptor(eventName)); - } - - function logNonObservingEvent(eventName) { - var el = document.getElementById('non-observing-events-log'); - el.appendChild(createEventDescriptor(eventName)); - } - - function logObservingEventObj(eventName) { - var el = document.getElementById('observing-events-log-obj'); - el.appendChild(createEventDescriptor(eventName, true)); - } - - function addSeparator(id) { - document.getElementById(id).appendChild(document.createElement('br')); - } + }) + }, []); - function observe(eventName, nonobserving) { - nonobserving - ? logNonObservingEvent(eventName) - : logObservingEvent(eventName); - canvas2.on(eventName, function (opt) { - log(eventName, opt); - }); - } + const onChangeCanvas = useCallback((eventName, checked) => { + console.log(checked, eventName) + eventStatusCanvas.current[eventName] = checked; + setLogsUpdated(performance.now()); + }, [eventStatusCanvas]); + + const onChangeObject = useCallback((eventName, checked) => { + eventStatusObj.current[eventName] = checked; + setLogsUpdated(performance.now()); + }, [eventStatusObj]); + + const onChangeGroup = useCallback((groupName, checked) => { + const group = eventGroups.find(group => group.id === groupName); + if (!group) return; + group.events.forEach((eventName) => { + if (canvasEvents.includes(eventName)) { + eventStatusCanvas.current[eventName] = checked; + } + if (objectsEvents.includes(eventName)) { + eventStatusObj.current[eventName] = checked; + } + setLogsUpdated(performance.now()); + }); + }, [setLogsUpdated]) - function observeObj(eventName) { - logObservingEventObj(eventName); - canvas2.getObjects().forEach(function (o) { - o.on(eventName, function (opt) { - log(eventName, opt, o.fill); - }); + // just the initial setup + useEffect(() => { + eventGroups.forEach(group => { + group.events.forEach((eventName) => { + if (canvasEvents.includes(eventName)) { + eventStatusCanvas.current[eventName] = group.enabled; + } + if (objectsEvents.includes(eventName)) { + eventStatusObj.current[eventName] = group.enabled; + } }); - } - - observe('object:modified'); - addSeparator('observing-events-log'); - - observe('object:moving'); - observe('object:scaling'); - observe('object:rotating'); - observe('object:skewing'); - observe('object:resizing'); - addSeparator('observing-events-log'); - - observe('before:transform'); - observe('before:selection:cleared'); - observe('selection:cleared'); - observe('selection:created'); - observe('selection:updated'); - addSeparator('observing-events-log'); - - observe('mouse:up'); - observe('mouse:down'); - observe('mouse:move'); - observe('mouse:up:before'); - observe('mouse:down:before'); - observe('mouse:move:before'); - observe('mouse:dblclick'); - observe('mouse:wheel'); - observe('mouse:over'); - observe('mouse:out'); - addSeparator('observing-events-log'); - - observe('drop:before'); - observe('drop'); - observe('dragover'); - observe('dragenter'); - observe('dragleave'); - addSeparator('observing-events-log'); - - observe('after:render'); - addSeparator('observing-events-log'); - - observe('path:created', true); - observe('object:added', true); - observe('object:removed', true); - addSeparator('observing-events-log'); - - observeObj('moving'); - observeObj('scaling'); - observeObj('rotating'); - observeObj('skewing'); - observeObj('resizing'); - addSeparator('observing-events-log-obj'); - - observeObj('mouseup'); - observeObj('mousedown'); - observeObj('mousemove'); - observeObj('mouseup:before'); - observeObj('mousedown:before'); - observeObj('mousemove:before'); - observeObj('mousedblclick'); - observeObj('mousewheel'); - observeObj('mouseover'); - observeObj('mouseout'); - addSeparator('observing-events-log-obj'); - - observeObj('drop:before'); - observeObj('drop'); - observeObj('dragover'); - observeObj('dragenter'); - observeObj('dragleave'); - }, []); + }); + setLogsUpdated(performance.now()); + }, []) return ( <>
-

To avoid event spamming, you can disable the checkboxs below.

+

To avoid event spamming, you can disable events groups.

- - - - - - - - - - - - - - + {eventGroups.map(group => ( + + ))}
-
- +
Drag me on the canvas
@@ -354,20 +156,29 @@ export const EventInspectorUI = () => { >
-
 
- +
{ + logs.current.map((logEntry, i) => ( + + )) + }
+
-
-
- Observing these events -
-
-
-
- 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 ( +
+ + +
+ ); +}); + +export const LogEntry = memo(({ logEntry, color }) => { + const [open, setOpen] = useState(false); + return ( +
+ + {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 ( + + ); +}); \ 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 + +
+ + + + + +
+ + + + \ 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. + +
+ + + +
+ + + + \ 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. + +
+ +
+ + + + \ 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, - ).drawCacheOnCanvas` - -#### Defined in - -[src/shapes/Object/Object.ts:942](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L942) +`createCollectionMixin( FabricObject, ).drawCacheOnCanvas` *** @@ -3486,17 +2928,25 @@ Context to render on > **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 @@ -3504,13 +2954,7 @@ Context to render on #### Inherited from -`createCollectionMixin( - FabricObject, - ).drawClipPathOnCache` - -#### Defined in - -[src/shapes/Object/Object.ts:847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L847) +`createCollectionMixin( FabricObject, ).drawClipPathOnCache` *** @@ -3518,6 +2962,8 @@ Context to render on > **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 @@ -3527,11 +2973,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 @@ -3541,13 +2991,7 @@ object to override the object style #### Inherited from -`createCollectionMixin( - FabricObject, - ).drawControls` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L550) +`createCollectionMixin( FabricObject, ).drawControls` *** @@ -3555,17 +2999,23 @@ object to override the object style > **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 @@ -3575,13 +3025,7 @@ object size x = width, y = height #### Inherited from -`createCollectionMixin( - FabricObject, - ).drawControlsConnectingLines` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:517](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L517) +`createCollectionMixin( FabricObject, ).drawControlsConnectingLines` *** @@ -3589,17 +3033,25 @@ object size x = width, y = height > **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 -• **context**: `DrawContext` +`undefined` | `boolean` + +##### context + +[`DrawContext`](/api/type-aliases/drawcontext/) #### Returns @@ -3607,13 +3059,7 @@ Context to render on #### Overrides -`createCollectionMixin( - FabricObject, - ).drawObject` - -#### Defined in - -[src/shapes/Group.ts:496](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L496) +`createCollectionMixin( FabricObject, ).drawObject` *** @@ -3621,6 +3067,8 @@ Context to render on > **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 @@ -3628,7 +3076,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3644,13 +3094,7 @@ it seemed a good option, now is an edge case #### Inherited from -`createCollectionMixin( - FabricObject, - ).drawSelectionBackground` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:375](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L375) +`createCollectionMixin( FabricObject, ).drawSelectionBackground` *** @@ -3658,15 +3102,21 @@ it seemed a good option, now is an edge case > **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* [`Group`](/api/classes/group/) +##### T + +`T` *extends* `Group` #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3676,27 +3126,29 @@ an object that represent the ancestry situation. #### Inherited from -`createCollectionMixin( - FabricObject, - ).findCommonAncestors` - -#### Defined in - -[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675) +`createCollectionMixin( FabricObject, ).findCommonAncestors` *** ### 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 -• **idx**: `number` +`number` + +##### intersecting? -• **intersecting?**: `boolean` +`boolean` #### Returns @@ -3704,27 +3156,29 @@ an object that represent the ancestry situation. #### Inherited from -`createCollectionMixin( - FabricObject, - ).findNewLowerIndex` - -#### Defined in - -[src/Collection.ts:272](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L272) +`createCollectionMixin( FabricObject, ).findNewLowerIndex` *** ### 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 -• **idx**: `number` +`number` + +##### intersecting? -• **intersecting?**: `boolean` +`boolean` #### Returns @@ -3732,33 +3186,35 @@ an object that represent the ancestry situation. #### Inherited from -`createCollectionMixin( - FabricObject, - ).findNewUpperIndex` - -#### Defined in - -[src/Collection.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L295) +`createCollectionMixin( FabricObject, ).findNewUpperIndex` *** ### 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 @@ -3768,13 +3224,7 @@ Options object #### Inherited from -`createCollectionMixin( - FabricObject, - ).fire` - -#### Defined in - -[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167) +`createCollectionMixin( FabricObject, ).fire` *** @@ -3782,12 +3232,16 @@ Options object > **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 @@ -3797,13 +3251,7 @@ function to iterate over the controls over #### Inherited from -`createCollectionMixin( - FabricObject, - ).forEachControl` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353) +`createCollectionMixin( FabricObject, ).forEachControl` *** @@ -3811,13 +3259,17 @@ function to iterate over the controls over > **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. @@ -3828,13 +3280,7 @@ Callback invoked with current object as first argument, #### Inherited from -`createCollectionMixin( - FabricObject, - ).forEachObject` - -#### Defined in - -[src/Collection.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L91) +`createCollectionMixin( FabricObject, ).forEachObject` *** @@ -3842,11 +3288,15 @@ Callback invoked with current object as first argument, > **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 @@ -3858,33 +3308,23 @@ value of a property #### Inherited from -`createCollectionMixin( - FabricObject, - ).get` - -#### Defined in - -[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59) +`createCollectionMixin( FabricObject, ).get` *** ### 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 -`createCollectionMixin( - FabricObject, - ).getActiveControl` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194) +`createCollectionMixin( FabricObject, ).getActiveControl` *** @@ -3892,6 +3332,8 @@ value of a property > **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` @@ -3900,13 +3342,7 @@ ancestors (excluding `ActiveSelection`) from bottom to top #### Inherited from -`createCollectionMixin( - FabricObject, - ).getAncestors` - -#### Defined in - -[src/shapes/Object/Object.ts:1658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1658) +`createCollectionMixin( FabricObject, ).getAncestors` *** @@ -3914,6 +3350,8 @@ ancestors (excluding `ActiveSelection`) from bottom to top > **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. @@ -3925,13 +3363,7 @@ Object with left, top, width, height properties #### Inherited from -`createCollectionMixin( - FabricObject, - ).getBoundingRect` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L343) +`createCollectionMixin( FabricObject, ).getBoundingRect` *** @@ -3939,19 +3371,15 @@ Object with left, top, width, height properties > **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` #### Inherited from -`createCollectionMixin( - FabricObject, - ).getCanvasRetinaScaling` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L400) +`createCollectionMixin( FabricObject, ).getCanvasRetinaScaling` *** @@ -3959,6 +3387,8 @@ Object with left, top, width, height properties > **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 @@ -3967,13 +3397,7 @@ Returns the center coordinates of the object relative to canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).getCenterPoint` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L732) +`createCollectionMixin( FabricObject, ).getCenterPoint` *** @@ -3981,6 +3405,8 @@ Returns the center coordinates of the object relative to canvas > **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/)[] @@ -3989,13 +3415,7 @@ Returns the center coordinates of the object relative to canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).getCoords` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204) +`createCollectionMixin( FabricObject, ).getCoords` *** @@ -4003,6 +3423,8 @@ Returns the center coordinates of the object relative to canvas > **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 @@ -4011,63 +3433,51 @@ Return the object opacity counting also the group property #### Inherited from -`createCollectionMixin( - FabricObject, - ).getObjectOpacity` - -#### Defined in - -[src/shapes/Object/Object.ts:607](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L607) +`createCollectionMixin( FabricObject, ).getObjectOpacity` *** -### 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? -`createCollectionMixin( - FabricObject, - ).getObjectScaling` +...`string`[] + +When specified, only objects of these types are returned -#### Defined in +#### Returns -[src/shapes/Object/Object.ts:576](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L576) +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] -*** +#### Inherited from -### getObjects() +`createCollectionMixin( FabricObject, ).getObjects` -> **getObjects**(...`types`?): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +*** -Returns an array of children objects of this instance +### getObjectScaling() -#### Parameters +> **getObjectScaling**(): [`Point`](/api/classes/point/) -• ...**types?**: `string`[] +Defined in: [src/shapes/Object/Object.ts:529](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L529) -When specified, only objects of these types are returned +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 -`createCollectionMixin( - FabricObject, - ).getObjects` - -#### Defined in - -[src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L108) +`createCollectionMixin( FabricObject, ).getObjectScaling` *** @@ -4075,6 +3485,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 @@ -4084,11 +3496,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' @@ -4098,13 +3514,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).getPointByOrigin` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:762](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L762) +`createCollectionMixin( FabricObject, ).getPointByOrigin` *** @@ -4112,6 +3522,8 @@ Vertical origin: 'top', 'center' or 'bottom' > **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 @@ -4120,13 +3532,7 @@ Returns the center coordinates of the object relative to it's parent #### Inherited from -`createCollectionMixin( - FabricObject, - ).getRelativeCenterPoint` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:743](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L743) +`createCollectionMixin( FabricObject, ).getRelativeCenterPoint` *** @@ -4134,22 +3540,18 @@ Returns the center coordinates of the object relative to it's parent > **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/group/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/group/#getx) #### Inherited from -`createCollectionMixin( - FabricObject, - ).getRelativeX` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L115) +`createCollectionMixin( FabricObject, ).getRelativeX` *** @@ -4157,21 +3559,17 @@ if parent is canvas then this property is identical to [getX](/api/api/classes/g > **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 -`createCollectionMixin( - FabricObject, - ).getRelativeXY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:176](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L176) +`createCollectionMixin( FabricObject, ).getRelativeXY` *** @@ -4179,22 +3577,18 @@ x,y position according to object's [originX](/api/api/classes/fabricobject/origi > **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/group/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/group/#gety) #### Inherited from -`createCollectionMixin( - FabricObject, - ).getRelativeY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L131) +`createCollectionMixin( FabricObject, ).getRelativeY` *** @@ -4202,6 +3596,8 @@ if parent is canvas then this property is identical to [getY](/api/api/classes/g > **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 @@ -4216,13 +3612,7 @@ shouldn't this account for group transform and return the actual size in canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).getScaledHeight` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:361](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L361) +`createCollectionMixin( FabricObject, ).getScaledHeight` *** @@ -4230,6 +3620,8 @@ shouldn't this account for group transform and return the actual size in canvas > **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 @@ -4244,13 +3636,7 @@ shouldn't this account for group transform and return the actual size in canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).getScaledWidth` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352) +`createCollectionMixin( FabricObject, ).getScaledWidth` *** @@ -4258,11 +3644,15 @@ shouldn't this account for group transform and return the actual size in canvas > **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 @@ -4270,13 +3660,7 @@ Returns id attribute for svg output #### Inherited from -`createCollectionMixin( - FabricObject, - ).getSvgCommons` - -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L84) +`createCollectionMixin( FabricObject, ).getSvgCommons` *** @@ -4284,11 +3668,15 @@ Returns id attribute for svg output > **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 @@ -4296,13 +3684,7 @@ Returns filter for svg shadow #### Inherited from -`createCollectionMixin( - FabricObject, - ).getSvgFilter` - -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L76) +`createCollectionMixin( FabricObject, ).getSvgFilter` *** @@ -4310,6 +3692,8 @@ Returns filter for svg shadow > **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 @@ -4318,29 +3702,31 @@ Returns styles-string for svg-export, specific version for group #### Overrides -`createCollectionMixin( - FabricObject, - ).getSvgStyles` - -#### Defined in - -[src/shapes/Group.ts:652](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L652) +`createCollectionMixin( FabricObject, ).getSvgStyles` *** ### 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 @@ -4348,13 +3734,7 @@ Returns transform-string for svg-export #### Inherited from -`createCollectionMixin( - FabricObject, - ).getSvgTransform` - -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L103) +`createCollectionMixin( FabricObject, ).getSvgTransform` *** @@ -4362,6 +3742,8 @@ Returns transform-string for svg-export > **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 @@ -4370,13 +3752,7 @@ Returns the object angle relative to canvas counting also the group property #### Inherited from -`createCollectionMixin( - FabricObject, - ).getTotalAngle` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L408) +`createCollectionMixin( FabricObject, ).getTotalAngle` *** @@ -4384,6 +3760,8 @@ Returns the object angle relative to canvas counting also the group property > **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 @@ -4394,13 +3772,7 @@ object with scaleX and scaleY properties #### Inherited from -`createCollectionMixin( - FabricObject, - ).getTotalObjectScaling` - -#### Defined in - -[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593) +`createCollectionMixin( FabricObject, ).getTotalObjectScaling` *** @@ -4408,6 +3780,8 @@ object with scaleX and scaleY properties > **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 @@ -4416,13 +3790,7 @@ Retrieves viewportTransform from Object's canvas if available #### Inherited from -`createCollectionMixin( - FabricObject, - ).getViewportTransform` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:418](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L418) +`createCollectionMixin( FabricObject, ).getViewportTransform` *** @@ -4430,21 +3798,17 @@ Retrieves viewportTransform from Object's canvas if available > **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 -`createCollectionMixin( - FabricObject, - ).getX` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L86) +`createCollectionMixin( FabricObject, ).getX` *** @@ -4452,21 +3816,17 @@ x position according to object's [originX](/api/api/classes/fabricobject/originx > **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 -`createCollectionMixin( - FabricObject, - ).getXY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L146) +`createCollectionMixin( FabricObject, ).getXY` *** @@ -4474,21 +3834,17 @@ x position according to object's [originX](/api/api/classes/fabricobject/originx > **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 -`createCollectionMixin( - FabricObject, - ).getY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L100) +`createCollectionMixin( FabricObject, ).getY` *** @@ -4496,13 +3852,19 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy > **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* [`Group`](/api/classes/group/) +##### T + +`T` *extends* `Group` #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -4510,19 +3872,15 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy #### Inherited from -`createCollectionMixin( - FabricObject, - ).hasCommonAncestors` - -#### Defined in - -[src/shapes/Object/Object.ts:1740](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1740) +`createCollectionMixin( FabricObject, ).hasCommonAncestors` *** ### 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 @@ -4533,7 +3891,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -4543,19 +3901,15 @@ Boolean #### Inherited from -`createCollectionMixin( - FabricObject, - ).hasFill` - -#### Defined in - -[src/shapes/Object/Object.ts:787](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L787) +`createCollectionMixin( FabricObject, ).hasFill` *** ### 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 @@ -4566,7 +3920,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -4576,13 +3930,7 @@ Boolean #### Inherited from -`createCollectionMixin( - FabricObject, - ).hasStroke` - -#### Defined in - -[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771) +`createCollectionMixin( FabricObject, ).hasStroke` *** @@ -4590,15 +3938,21 @@ Boolean > **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 @@ -4608,13 +3962,7 @@ Object to insert #### Overrides -`createCollectionMixin( - FabricObject, - ).insertAt` - -#### Defined in - -[src/shapes/Group.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L240) +`createCollectionMixin( FabricObject, ).insertAt` *** @@ -4622,11 +3970,15 @@ Object to insert > **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 @@ -4638,13 +3990,7 @@ true if object intersects with another object #### Inherited from -`createCollectionMixin( - FabricObject, - ).intersectsWithObject` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:232](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L232) +`createCollectionMixin( FabricObject, ).intersectsWithObject` *** @@ -4652,13 +3998,19 @@ true if object intersects with another object > **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 @@ -4666,13 +4018,7 @@ Checks if object intersects with the scene rect formed by tl and br #### Inherited from -`createCollectionMixin( - FabricObject, - ).intersectsWithRect` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L218) +`createCollectionMixin( FabricObject, ).intersectsWithRect` *** @@ -4680,11 +4026,18 @@ Checks if object intersects with the scene rect formed by tl and br > **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. @@ -4695,13 +4048,7 @@ on parent canvas. #### Inherited from -`createCollectionMixin( - FabricObject, - ).isCacheDirty` - -#### Defined in - -[src/shapes/Object/Object.ts:956](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L956) +`createCollectionMixin( FabricObject, ).isCacheDirty` *** @@ -4709,11 +4056,15 @@ on parent canvas. > **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 @@ -4725,13 +4076,7 @@ true if object is fully contained within area of another object #### Inherited from -`createCollectionMixin( - FabricObject, - ).isContainedWithinObject` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L251) +`createCollectionMixin( FabricObject, ).isContainedWithinObject` *** @@ -4739,13 +4084,19 @@ true if object is fully contained within area of another object > **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 @@ -4753,13 +4104,7 @@ Checks if object is fully contained within the scene rect formed by tl and br #### Inherited from -`createCollectionMixin( - FabricObject, - ).isContainedWithinRect` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L259) +`createCollectionMixin( FabricObject, ).isContainedWithinRect` *** @@ -4767,11 +4112,15 @@ Checks if object is fully contained within the scene rect formed by tl and br > **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. @@ -4784,13 +4133,7 @@ true if the specified control is visible, false otherwise #### Inherited from -`createCollectionMixin( - FabricObject, - ).isControlVisible` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:584](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L584) +`createCollectionMixin( FabricObject, ).isControlVisible` *** @@ -4798,12 +4141,16 @@ true if the specified control is visible, false otherwise > **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 @@ -4811,13 +4158,7 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai #### Inherited from -`createCollectionMixin( - FabricObject, - ).isDescendantOf` - -#### Defined in - -[src/shapes/Object/Object.ts:1644](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1644) +`createCollectionMixin( FabricObject, ).isDescendantOf` *** @@ -4825,6 +4166,8 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai > **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 @@ -4835,13 +4178,7 @@ true if collection is empty #### Inherited from -`createCollectionMixin( - FabricObject, - ).isEmpty` - -#### Defined in - -[src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L128) +`createCollectionMixin( FabricObject, ).isEmpty` *** @@ -4849,13 +4186,19 @@ true if collection is empty > **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* [`Group`](/api/classes/group/) +##### T + +`T` *extends* `Group` #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -4867,13 +4210,7 @@ if objects do not share a common ancestor or they are strictly equal it is impos #### Inherited from -`createCollectionMixin( - FabricObject, - ).isInFrontOf` - -#### Defined in - -[src/shapes/Object/Object.ts:1750](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1750) +`createCollectionMixin( FabricObject, ).isInFrontOf` *** @@ -4881,19 +4218,17 @@ if objects do not share a common ancestor or they are strictly equal it is impos > **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` #### Inherited from -`createCollectionMixin( - FabricObject, - ).isNotVisible` - -#### Defined in - -[src/shapes/Object/Object.ts:686](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L686) +`createCollectionMixin( FabricObject, ).isNotVisible` *** @@ -4901,22 +4236,22 @@ if objects do not share a common ancestor or they are strictly equal it is impos > **isOnACache**(): `boolean` +Defined in: [src/shapes/Group.ts:486](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L486) + Check if instance or its group are caching, recursively up #### Returns `boolean` -#### Defined in - -[src/shapes/Group.ts:488](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L488) - *** ### 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 @@ -4928,13 +4263,7 @@ true if object is fully or partially contained within canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).isOnScreen` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:291](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L291) +`createCollectionMixin( FabricObject, ).isOnScreen` *** @@ -4942,13 +4271,19 @@ true if object is fully or partially contained within canvas > **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 @@ -4956,13 +4291,7 @@ true if object is fully or partially contained within canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).isOverlapping` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269) +`createCollectionMixin( FabricObject, ).isOverlapping` *** @@ -4970,6 +4299,8 @@ true if object is fully or partially contained within canvas > **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 @@ -4980,13 +4311,7 @@ true if object is partially contained within canvas #### Inherited from -`createCollectionMixin( - FabricObject, - ).isPartiallyOnScreen` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321) +`createCollectionMixin( FabricObject, ).isPartiallyOnScreen` *** @@ -4994,25 +4319,35 @@ true if object is partially contained within canvas > **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` -#### Inherited from - -`createCollectionMixin( - FabricObject, - ).isType` +`true` if the object's type or class type matches any in the list, otherwise `false`. -#### Defined in +#### Inherited from -[src/shapes/Object/Object.ts:1449](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1449) +`createCollectionMixin( FabricObject, ).isType` *** @@ -5020,11 +4355,15 @@ Returns true if any of the specified types is identical to the type of an instan > **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 @@ -5034,13 +4373,7 @@ object at index #### Inherited from -`createCollectionMixin( - FabricObject, - ).item` - -#### Defined in - -[src/Collection.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L120) +`createCollectionMixin( FabricObject, ).item` *** @@ -5048,15 +4381,21 @@ object at index > **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 @@ -5068,13 +4407,7 @@ true if change occurred #### Inherited from -`createCollectionMixin( - FabricObject, - ).moveObjectTo` - -#### Defined in - -[src/Collection.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L262) +`createCollectionMixin( FabricObject, ).moveObjectTo` *** @@ -5082,7 +4415,9 @@ true if change occurred > **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 @@ -5096,22 +4431,18 @@ Boolean #### Inherited from -`createCollectionMixin( - FabricObject, - ).needsItsOwnCache` - -#### Defined in - -[src/shapes/Object/Object.ts:799](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L799) +`createCollectionMixin( FabricObject, ).needsItsOwnCache` *** ### 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 @@ -5122,11 +4453,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') @@ -5136,31 +4471,33 @@ event name (eg. 'after:render') ##### Inherited from -`createCollectionMixin( - FabricObject, - ).off` +`createCollectionMixin( 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* 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 @@ -5170,23 +4507,21 @@ event listener to unsubscribe ##### Inherited from -`createCollectionMixin( - FabricObject, - ).off` - -##### Defined in - -[src/Observable.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L128) +`createCollectionMixin( FabricObject, ).off` -#### 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}) @@ -5196,18 +4531,14 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han ##### Inherited from -`createCollectionMixin( - FabricObject, - ).off` - -##### Defined in - -[src/Observable.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L133) +`createCollectionMixin( FabricObject, ).off` -#### 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 @@ -5216,37 +4547,41 @@ unsubscribe all event listeners ##### Inherited from -`createCollectionMixin( - FabricObject, - ).off` - -##### Defined in - -[src/Observable.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L137) +`createCollectionMixin( FabricObject, ).off` *** ### 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 -• **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/) +`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` \| [`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` \| [`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` \| [`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 @@ -5262,198 +4597,208 @@ on ##### Inherited from -`createCollectionMixin( - FabricObject, - ).on` +`createCollectionMixin( 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`\<[`GroupEvents`](/api/interfaces/groupevents/)\> +###### handlers + +`EventRegistryObject`\<`EventSpec`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) ##### Returns `VoidFunction` -##### Inherited from +disposer + +##### Alias -`createCollectionMixin( - FabricObject, - ).on` +on -##### Defined in +##### Inherited from -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +`createCollectionMixin( 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* keyof [`GroupEvents`](/api/interfaces/groupevents/) -#### Returns +###### E -`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` \| [`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` \| [`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` \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; \} \| \{ `path`: [`FabricObject`](/api/classes/fabricobject/); \} -#### Inherited from +##### Parameters -`createCollectionMixin( - 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 +`createCollectionMixin( FabricObject, ).once` -`createCollectionMixin( - 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 +`createCollectionMixin( FabricObject, ).once` -`createCollectionMixin( - 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* keyof [`GroupEvents`](/api/interfaces/groupevents/) +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -• **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/) +###### 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 +`createCollectionMixin( 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 -`createCollectionMixin( - 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`\<[`GroupEvents`](/api/interfaces/groupevents/)\> +`createCollectionMixin( FabricObject, ).onDragStart` -##### Returns +*** -`VoidFunction` +### onSelect() -##### Inherited from +> **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 -`createCollectionMixin( - FabricObject, - ).once` +##### \_options? -##### Defined in +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 -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +`createCollectionMixin( FabricObject, ).onSelect` *** @@ -5461,11 +4806,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 @@ -5475,13 +4824,7 @@ removed objects #### Overrides -`createCollectionMixin( - FabricObject, - ).remove` - -#### Defined in - -[src/shapes/Group.ts:252](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L252) +`createCollectionMixin( FabricObject, ).remove` *** @@ -5489,6 +4832,8 @@ removed objects > **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 @@ -5497,21 +4842,21 @@ Remove all objects removed objects -#### 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 @@ -5521,25 +4866,25 @@ context to render instance on #### Overrides -`createCollectionMixin( - FabricObject, - ).render` - -#### Defined in - -[src/shapes/Group.ts:539](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L539) +`createCollectionMixin( FabricObject, ).render` *** ### 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 @@ -5547,13 +4892,7 @@ context to render instance on #### Inherited from -`createCollectionMixin( - FabricObject, - ).renderCache` - -#### Defined in - -[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732) +`createCollectionMixin( FabricObject, ).renderCache` *** @@ -5561,13 +4900,17 @@ context to render instance on > **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 @@ -5575,13 +4918,7 @@ example: render the selection status for the part of text that is being dragged #### Inherited from -`createCollectionMixin( - FabricObject, - ).renderDragSourceEffect` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:712](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L712) +`createCollectionMixin( FabricObject, ).renderDragSourceEffect` *** @@ -5589,6 +4926,8 @@ example: render the selection status for the part of text that is being dragged > **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 @@ -5596,7 +4935,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -5604,13 +4945,7 @@ object will change when dropping. example: show the cursor where the text is abo #### Inherited from -`createCollectionMixin( - FabricObject, - ).renderDropTargetEffect` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:724](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L724) +`createCollectionMixin( FabricObject, ).renderDropTargetEffect` *** @@ -5618,11 +4953,15 @@ object will change when dropping. example: show the cursor where the text is abo > **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) @@ -5632,13 +4971,7 @@ Angle value (in degrees) #### Inherited from -`createCollectionMixin( - FabricObject, - ).rotate` - -#### Defined in - -[src/shapes/Object/Object.ts:1477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1477) +`createCollectionMixin( FabricObject, ).rotate` *** @@ -5646,11 +4979,15 @@ Angle value (in degrees) > **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 @@ -5660,13 +4997,7 @@ Scale factor #### Inherited from -`createCollectionMixin( - FabricObject, - ).scale` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:370](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L370) +`createCollectionMixin( FabricObject, ).scale` *** @@ -5674,11 +5005,15 @@ Scale factor > **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 @@ -5688,13 +5023,7 @@ New height value #### Inherited from -`createCollectionMixin( - FabricObject, - ).scaleToHeight` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:393](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L393) +`createCollectionMixin( FabricObject, ).scaleToHeight` *** @@ -5702,11 +5031,15 @@ New height value > **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 @@ -5716,19 +5049,15 @@ New width value #### Inherited from -`createCollectionMixin( - FabricObject, - ).scaleToWidth` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381) +`createCollectionMixin( FabricObject, ).scaleToWidth` *** ### 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 @@ -5738,11 +5067,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 @@ -5754,13 +5087,7 @@ true if change occurred #### Inherited from -`createCollectionMixin( - FabricObject, - ).sendObjectBackwards` - -#### Defined in - -[src/Collection.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L214) +`createCollectionMixin( FabricObject, ).sendObjectBackwards` *** @@ -5768,12 +5095,16 @@ true if change occurred > **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 @@ -5785,112 +5116,104 @@ true if change occurred #### Inherited from -`createCollectionMixin( - FabricObject, - ).sendObjectToBack` - -#### Defined in - -[src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L178) +`createCollectionMixin( FabricObject, ).sendObjectToBack` *** ### set() -> **set**(`key`, `value`?): [`Group`](/api/classes/group/) +> **set**(`key`, `value?`): `Group` + +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 -[`Group`](/api/classes/group/) +`Group` #### Inherited from -`createCollectionMixin( - FabricObject, - ).set` - -#### Defined in - -[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29) +`createCollectionMixin( FabricObject, ).set` *** -### 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 +`createCollectionMixin( FabricObject, ).setControlsVisibility` -#### Inherited from +*** -`createCollectionMixin( - 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 -`createCollectionMixin( - 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) +`createCollectionMixin( FabricObject, ).setControlVisible` *** @@ -5898,19 +5221,15 @@ 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` #### Overrides -`createCollectionMixin( - FabricObject, - ).setCoords` - -#### Defined in - -[src/shapes/Group.ts:521](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L521) +`createCollectionMixin( FabricObject, ).setCoords` *** @@ -5918,6 +5237,8 @@ example: {Boolean} [options.bl] true to enable the bottom-left control, false to > **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 @@ -5929,13 +5250,7 @@ Travis build error about unused variables. #### Inherited from -`createCollectionMixin( - FabricObject, - ).setOnGroup` - -#### Defined in - -[src/shapes/Object/Object.ts:1509](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1509) +`createCollectionMixin( FabricObject, ).setOnGroup` *** @@ -5943,19 +5258,27 @@ Travis build error about unused variables. > **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' @@ -5965,13 +5288,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).setPositionByOrigin` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:777](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L777) +`createCollectionMixin( FabricObject, ).setPositionByOrigin` *** @@ -5979,12 +5296,16 @@ Vertical origin: 'top', 'center' or 'bottom' > **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/group/#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/group/#setx) #### Returns @@ -5992,33 +5313,35 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas #### Inherited from -`createCollectionMixin( - FabricObject, - ).setRelativeX` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L123) +`createCollectionMixin( FabricObject, ).setRelativeX` *** ### setRelativeXY() -> **setRelativeXY**(`point`, `originX`?, `originY`?): `void` +> **setRelativeXY**(`point`, `originX?`, `originY?`): `void` -As [setXY](../../../../api/classes/group/#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/group/#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' @@ -6028,13 +5351,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).setRelativeXY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L186) +`createCollectionMixin( FabricObject, ).setRelativeXY` *** @@ -6042,12 +5359,16 @@ Vertical origin: 'top', 'center' or 'bottom' > **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/group/#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/group/#sety) #### Returns @@ -6055,13 +5376,7 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl #### Inherited from -`createCollectionMixin( - FabricObject, - ).setRelativeY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139) +`createCollectionMixin( FabricObject, ).setRelativeY` *** @@ -6069,11 +5384,15 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl > **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 @@ -6081,19 +5400,15 @@ x position according to object's [originX](../../../../api/classes/fabricobject/ #### Inherited from -`createCollectionMixin( - FabricObject, - ).setX` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L93) +`createCollectionMixin( FabricObject, ).setX` *** ### 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, @@ -6101,15 +5416,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' @@ -6125,13 +5446,7 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). #### Inherited from -`createCollectionMixin( - FabricObject, - ).setXY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L163) +`createCollectionMixin( FabricObject, ).setXY` *** @@ -6139,11 +5454,15 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). > **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 @@ -6151,13 +5470,7 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ #### Inherited from -`createCollectionMixin( - FabricObject, - ).setY` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107) +`createCollectionMixin( FabricObject, ).setY` *** @@ -6165,9 +5478,11 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ > **shouldCache**(): `boolean` -Decide if the object should cache or not. Create its own cache level +Defined in: [src/shapes/Group.ts:453](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L453) + +Decide if the group 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 is already cached. #### Returns @@ -6176,13 +5491,7 @@ Generally you do not cache objects in groups because the group is already cached #### Overrides -`createCollectionMixin( - FabricObject, - ).shouldCache` - -#### Defined in - -[src/shapes/Group.ts:455](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L455) +`createCollectionMixin( FabricObject, ).shouldCache` *** @@ -6190,12 +5499,16 @@ Generally you do not cache objects in groups because the group is already cached > **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 @@ -6205,13 +5518,7 @@ true in order for the window to start a drag session #### Inherited from -`createCollectionMixin( - FabricObject, - ).shouldStartDragging` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L682) +`createCollectionMixin( FabricObject, ).shouldStartDragging` *** @@ -6219,6 +5526,8 @@ true in order for the window to start a drag session > **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 @@ -6229,13 +5538,7 @@ Collection size #### Inherited from -`createCollectionMixin( - FabricObject, - ).size` - -#### Defined in - -[src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L136) +`createCollectionMixin( FabricObject, ).size` *** @@ -6243,15 +5546,21 @@ Collection size > **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 @@ -6261,13 +5570,29 @@ the control box size used #### Inherited from -`createCollectionMixin( - FabricObject, - ).strokeBorders` +`createCollectionMixin( FabricObject, ).strokeBorders` + +*** + +### 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) -#### Defined in +#### 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 + +`createCollectionMixin( FabricObject, ).toBlob` *** @@ -6275,11 +5600,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 @@ -6291,25 +5620,23 @@ Returns DOM element with the FabricObject #### Inherited from -`createCollectionMixin( - FabricObject, - ).toCanvasElement` - -#### Defined in - -[src/shapes/Object/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340) +`createCollectionMixin( FabricObject, ).toCanvasElement` *** ### 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. @@ -6321,13 +5648,35 @@ svg representation of an instance #### Overrides -`createCollectionMixin( - FabricObject, - ).toClipPathSVG` +`createCollectionMixin( FabricObject, ).toClipPathSVG` + +*** + +### 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`[] -#### Defined in +Any properties that you might want to additionally include in the output -[src/shapes/Group.ts:666](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L666) +#### Returns + +`any` + +Object representation of an instance + +#### Inherited from + +`createCollectionMixin( FabricObject, ).toDatalessObject` *** @@ -6335,11 +5684,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 @@ -6351,43 +5704,33 @@ Returns a data: URL containing a representation of the object in the format spec #### Inherited from -`createCollectionMixin( - FabricObject, - ).toDataURL` - -#### Defined in - -[src/shapes/Object/Object.ts:1436](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1436) +`createCollectionMixin( FabricObject, ).toDataURL` *** -### toDatalessObject() +### toggle() -> **toDatalessObject**(`propertiesToInclude`?): `any` +> **toggle**(`property`): `Group` -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 +`Group` #### Inherited from -`createCollectionMixin( - FabricObject, - ).toDatalessObject` - -#### Defined in - -[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884) +`createCollectionMixin( FabricObject, ).toggle` *** @@ -6395,6 +5738,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 @@ -6405,31 +5750,33 @@ JSON #### Inherited from -`createCollectionMixin( - FabricObject, - ).toJSON` - -#### Defined in - -[src/shapes/Object/Object.ts:1468](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1468) +`createCollectionMixin( FabricObject, ).toJSON` *** ### 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/)\<[`Group`](/api/classes/group/)\>, keyof [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)\> +##### T + +`T` *extends* `Omit`\<[`GroupProps`](/api/interfaces/groupprops/) & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Group`\>, keyof [`SerializedGroupProps`](/api/interfaces/serializedgroupprops/)\> -• **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 @@ -6441,45 +5788,7 @@ object representation of an instance #### Overrides -`createCollectionMixin( - FabricObject, - ).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 - -`createCollectionMixin( - FabricObject, - ).toSVG` - -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L129) +`createCollectionMixin( FabricObject, ).toObject` *** @@ -6487,6 +5796,8 @@ svg representation of an instance > **toString**(): `string` +Defined in: [src/shapes/Group.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L599) + Returns a string representation of an instance #### Returns @@ -6495,41 +5806,39 @@ Returns a string representation of an instance #### Overrides -`createCollectionMixin( - FabricObject, - ).toString` - -#### Defined in - -[src/shapes/Group.ts:601](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L601) +`createCollectionMixin( FabricObject, ).toString` *** -### toggle() +### toSVG() -> **toggle**(`property`): [`Group`](/api/classes/group/) +> **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? -[`Group`](/api/classes/group/) +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -#### Inherited from +Method for further parsing of svg representation. -`createCollectionMixin( - 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) +`createCollectionMixin( FabricObject, ).toSVG` *** @@ -6537,11 +5846,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 @@ -6551,13 +5864,7 @@ Context #### Inherited from -`createCollectionMixin( - FabricObject, - ).transform` - -#### Defined in - -[src/shapes/Object/Object.ts:564](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L564) +`createCollectionMixin( FabricObject, ).transform` *** @@ -6565,9 +5872,13 @@ Context > **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 @@ -6575,13 +5886,7 @@ Context #### Inherited from -`createCollectionMixin( - FabricObject, - ).transformMatrixKey` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:453](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L453) +`createCollectionMixin( FabricObject, ).transformMatrixKey` *** @@ -6589,19 +5894,27 @@ Context > **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' @@ -6611,13 +5924,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).translateToCenterPoint` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L682) +`createCollectionMixin( FabricObject, ).translateToCenterPoint` *** @@ -6625,27 +5932,39 @@ Vertical origin: 'top', 'center' or 'bottom' > **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' @@ -6655,13 +5974,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).translateToGivenOrigin` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:654](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L654) +`createCollectionMixin( FabricObject, ).translateToGivenOrigin` *** @@ -6669,19 +5982,27 @@ Vertical origin: 'top', 'center' or 'bottom' > **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' @@ -6691,13 +6012,7 @@ Vertical origin: 'top', 'center' or 'bottom' #### Inherited from -`createCollectionMixin( - FabricObject, - ).translateToOriginPoint` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710) +`createCollectionMixin( FabricObject, ).translateToOriginPoint` *** @@ -6705,24 +6020,26 @@ Vertical origin: 'top', 'center' or 'bottom' > **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 `void` -#### 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 @@ -6731,13 +6048,7 @@ Check if this object or a child object will cast a shadow #### Overrides -`createCollectionMixin( - FabricObject, - ).willDrawShadow` - -#### Defined in - -[src/shapes/Group.ts:472](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L472) +`createCollectionMixin( FabricObject, ).willDrawShadow` *** @@ -6745,15 +6056,23 @@ Check if this object or a child object will cast a shadow > `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 -• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` +[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` #### Returns @@ -6761,13 +6080,7 @@ Check if this object or a child object will cast a shadow #### Inherited from -`createCollectionMixin( - FabricObject, - )._fromObject` - -#### Defined in - -[src/shapes/Object/Object.ts:1937](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1937) +`createCollectionMixin( FabricObject, )._fromObject` *** @@ -6775,6 +6088,8 @@ Check if this object or a child object will cast a shadow > `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 @@ -6789,13 +6104,7 @@ make this function return an empty object and add controls to the ownDefaults #### Inherited from -`createCollectionMixin( - FabricObject, - ).createControls` - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L167) +`createCollectionMixin( FabricObject, ).createControls` *** @@ -6803,16 +6112,12 @@ make this function return an empty object and add controls to the ownDefaults > `static` **getDefaults**(): `Record`\<`string`, `any`\> +Defined in: [src/shapes/Group.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L124) + #### Returns `Record`\<`string`, `any`\> #### Overrides -`createCollectionMixin( - FabricObject, - ).getDefaults` - -#### Defined in - -[src/shapes/Group.ts:126](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L126) +`createCollectionMixin( FabricObject, ).getDefaults` diff --git a/src/content/docs/api/classes/IText.md b/src/content/docs/api/classes/IText.md index 87a76bddc..c8edbc26b 100644 --- a/src/content/docs/api/classes/IText.md +++ b/src/content/docs/api/classes/IText.md @@ -5,6 +5,8 @@ prev: false title: "IText" --- +Defined in: [src/shapes/IText/IText.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L123) + ## Fires changed @@ -86,11 +88,17 @@ paste ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ITextProps`](/api/interfaces/itextprops/)\> = `Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`ITextProps`](/api/interfaces/itextprops/)\> = `Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\> + +### SProps + +`SProps` *extends* [`SerializedITextProps`](/api/interfaces/serializeditextprops/) = [`SerializedITextProps`](/api/interfaces/serializeditextprops/) -• **SProps** *extends* [`SerializedITextProps`](/api/interfaces/serializeditextprops/) = [`SerializedITextProps`](/api/interfaces/serializeditextprops/) +### EventSpec -• **EventSpec** *extends* [`ITextEvents`](/api/type-aliases/itextevents/) = [`ITextEvents`](/api/type-aliases/itextevents/) +`EventSpec` *extends* [`ITextEvents`](/api/type-aliases/itextevents/) = [`ITextEvents`](/api/type-aliases/itextevents/) ## Implements @@ -98,62 +106,44 @@ paste ## Constructors -### new IText() +### Constructor -> **new IText**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options`?): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +> **new IText**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options?`): `IText`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/IText/IText.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L225) Constructor #### Parameters -• **text**: `string` +##### text + +`string` Text string -• **options?**: `Props` +##### options? + +`Props` Options object #### Returns -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +`IText`\<`Props`, `SProps`, `EventSpec`\> #### Overrides `ITextClickBehavior.constructor` -#### Defined in - -[src/shapes/IText/IText.ts:233](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L233) - ## Properties -### MIN\_TEXT\_WIDTH - -> **MIN\_TEXT\_WIDTH**: `number` - -contains the min text width to avoid getting 0 - -#### Default - -```ts - -``` - -#### Inherited from - -`ITextClickBehavior.MIN_TEXT_WIDTH` - -#### 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 @@ -164,44 +154,38 @@ this isn't cleaned automatically. Non selected objects may have wrong values `ITextClickBehavior.__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:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L405) + #### Inherited from `ITextClickBehavior.__lineHeights` -#### Defined in - -[src/shapes/Text/Text.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L411) - *** ### \_\_lineWidths > **\_\_lineWidths**: `number`[] +Defined in: [src/shapes/Text/Text.ts:406](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L406) + #### Inherited from `ITextClickBehavior.__lineWidths` -#### Defined in - -[src/shapes/Text/Text.ts:412](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L412) - *** ### \_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 @@ -210,38 +194,28 @@ this takes priority over the generic control visibility `ITextClickBehavior._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: [src/shapes/Text/Text.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L340) -``` +Text Line proportion to font Size (in pixels) #### Inherited from `ITextClickBehavior._fontSizeMult` -#### Defined in - -[src/shapes/Text/Text.ts:339](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L339) - *** ### \_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. @@ -256,80 +230,43 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT `ITextClickBehavior._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:403](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L403) + #### Inherited from `ITextClickBehavior._text` -#### Defined in - -[src/shapes/Text/Text.ts:409](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L409) - *** ### \_textLines > **\_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 #### Inherited from `ITextClickBehavior._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`[][] -#### Inherited from - -`ITextClickBehavior._unwrappedTextLines` - -#### 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/itext/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/itext/#calcacoords) +Defined in: [src/shapes/Text/Text.ts:402](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L402) #### Inherited from -`ITextClickBehavior.aCoords` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L63) +`ITextClickBehavior._unwrappedTextLines` *** @@ -337,6 +274,8 @@ You can calculate them without updating with [()](../../../../api/classes/itext/ > **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 @@ -354,9 +293,24 @@ false `ITextClickBehavior.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/itext/#setcoords). +You can calculate them without updating with [()](/api/classes/itext/#calcacoords) + +#### Inherited from -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +`ITextClickBehavior.aCoords` *** @@ -364,6 +318,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 @@ -376,39 +332,29 @@ Angle of rotation of an object (in degrees) `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -421,16 +367,14 @@ rgb(178,204,255) `ITextClickBehavior.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 @@ -441,16 +385,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) `ITextClickBehavior.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 @@ -463,20 +405,19 @@ Opacity of object's controlling borders when object is active and moving `ITextClickBehavior.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 @@ -488,27 +429,15 @@ since there is no way to change the border itself. `ITextClickBehavior.borderScaleFactor` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77) - *** ### caching > **caching**: `boolean` -Indicates whether internal text char widths can be cached - -#### Default - -```ts - -``` - -#### Defined in +Defined in: [src/shapes/IText/IText.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L204) -[src/shapes/IText/IText.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L212) +Indicates whether internal text char widths can be cached *** @@ -516,6 +445,8 @@ Indicates whether internal text char widths can be cached > **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 @@ -526,26 +457,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `ITextClickBehavior.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. @@ -553,63 +476,30 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `ITextClickBehavior.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 - -``` - -#### Inherited from - -`ITextClickBehavior.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 `ITextClickBehavior.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. @@ -617,19 +507,13 @@ This reference is a UID in the fabric namespace and is temporary stored here. `ITextClickBehavior.clipPathId` -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14) - *** ### compositionColor > **compositionColor**: `string` -#### Defined in - -[src/shapes/IText/IText.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L205) +Defined in: [src/shapes/IText/IText.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L198) *** @@ -637,34 +521,32 @@ This reference is a UID in the fabric namespace and is temporary stored here. > **compositionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L145) + #### Overrides `ITextClickBehavior.compositionEnd` -#### Defined in - -[src/shapes/IText/IText.ts:144](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L144) - *** ### compositionStart > **compositionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L143) + #### Overrides `ITextClickBehavior.compositionStart` -#### Defined in - -[src/shapes/IText/IText.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L142) - *** ### 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 @@ -672,16 +554,14 @@ controls are added by default_controls.js `ITextClickBehavior.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 @@ -694,16 +574,14 @@ rgb(178,204,255) `ITextClickBehavior.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 @@ -720,16 +598,14 @@ null `ITextClickBehavior.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 @@ -742,16 +618,14 @@ Size of object's controlling corners (in pixels) `ITextClickBehavior.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 @@ -768,20 +642,22 @@ Color of controlling corners of an object (when it's active and transparentCorne `ITextClickBehavior.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 @@ -792,33 +668,23 @@ 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 `ITextClickBehavior.cornerStyle` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70) - *** ### ctrlKeysMapDown > **ctrlKeysMapDown**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L42) + For functionalities on keyDown + ctrl || cmd #### Inherited from -`ITextClickBehavior.ctrlKeysMapDown` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L42) +[`Textbox`](/api/classes/textbox/).[`ctrlKeysMapDown`](/api/classes/textbox/#ctrlkeysmapdown) *** @@ -826,15 +692,13 @@ For functionalities on keyDown + ctrl || cmd > **ctrlKeysMapUp**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L37) + For functionalities on keyUp + ctrl || cmd #### Inherited from -`ITextClickBehavior.ctrlKeysMapUp` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L37) +[`Textbox`](/api/classes/textbox/).[`ctrlKeysMapUp`](/api/classes/textbox/#ctrlkeysmapup) *** @@ -842,115 +706,77 @@ For functionalities on keyUp + ctrl || cmd > **cursorColor**: `string` +Defined in: [src/shapes/IText/IText.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L184) + Color of text cursor color in editing mode. if not set (default) will take color from the text. if set to a color value that fabric can understand, it will be used instead of the color of the text at the current position. -#### Default - -```ts - -``` - -#### Defined in - -[src/shapes/IText/IText.ts:189](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L189) - *** ### cursorDelay > **cursorDelay**: `number` -Delay between cursor blink (in ms) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L190) -``` +Delay between cursor blink (in ms) #### Overrides `ITextClickBehavior.cursorDelay` -#### Defined in - -[src/shapes/IText/IText.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L196) - *** ### cursorDuration > **cursorDuration**: `number` -Duration of cursor fade in (in ms) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L196) -``` +Duration of cursor fade in (in ms) #### Overrides `ITextClickBehavior.cursorDuration` -#### Defined in - -[src/shapes/IText/IText.ts:203](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L203) - *** ### cursorWidth > **cursorWidth**: `number` -Width of cursor (in px) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:175](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L175) -``` +Width of cursor (in px) #### Overrides `ITextClickBehavior.cursorWidth` -#### Defined in - -[src/shapes/IText/IText.ts:179](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L179) - *** ### deltaY > **deltaY**: `number` +Defined in: [src/shapes/Text/Text.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L353) + Baseline shift, styles only, keep at 0 for the main text object -#### Default - -```ts - -``` - #### Inherited from `ITextClickBehavior.deltaY` -#### Defined in - -[src/shapes/Text/Text.ts:354](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L354) - *** ### direction > **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 @@ -962,26 +788,18 @@ https://www.w3.org/International/questions/qa-bidi-unicode-controls 4.5.0 -#### Default - -```ts - -``` - #### Inherited from `ITextClickBehavior.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 @@ -995,122 +813,86 @@ true `ITextClickBehavior.dirty` -#### Defined in - -[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245) - *** ### editable > **editable**: `boolean` -Indicates whether a text can be edited +Defined in: [src/shapes/IText/IText.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L163) -#### Default - -```ts - -``` +Indicates whether a text can be edited #### Overrides `ITextClickBehavior.editable` -#### Defined in - -[src/shapes/IText/IText.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L165) - *** ### editingBorderColor > **editingBorderColor**: `string` -Border color of text object while it's in editing mode +Defined in: [src/shapes/IText/IText.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L169) -#### Default - -```ts - -``` +Border color of text object while it's in editing mode #### Overrides `ITextClickBehavior.editingBorderColor` -#### Defined in - -[src/shapes/IText/IText.ts:172](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L172) - *** ### 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 +Defined in: [src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L82) -```ts - -``` +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 `ITextClickBehavior.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 `ITextClickBehavior.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 `ITextClickBehavior.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) @@ -1125,16 +907,14 @@ nonzero `ITextClickBehavior.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 @@ -1147,16 +927,14 @@ false `ITextClickBehavior.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 @@ -1169,148 +947,98 @@ false `ITextClickBehavior.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 +Defined in: [src/shapes/Text/Text.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L188) -#### Default - -```ts - -``` +Font family #### Inherited from `ITextClickBehavior.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) #### Inherited from `ITextClickBehavior.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` -Font style . Possible values: "", "normal", "italic" or "oblique". - -#### Default - -```ts +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". #### Inherited from `ITextClickBehavior.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) - -#### Default - -```ts +Defined in: [src/shapes/Text/Text.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L182) -``` +Font weight (e.g. bold, normal, 400, 600, 800) #### Inherited from `ITextClickBehavior.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 - -```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 `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -1323,45 +1051,31 @@ true `ITextClickBehavior.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 `ITextClickBehavior.height` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566) - *** ### hiddenTextarea > **hiddenTextarea**: `null` \| `HTMLTextAreaElement` -#### Inherited from - -`ITextClickBehavior.hiddenTextarea` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:44](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L44) -#### Defined in +#### Inherited from -[src/shapes/IText/ITextKeyBehavior.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L44) +[`Textbox`](/api/classes/textbox/).[`hiddenTextarea`](/api/classes/textbox/#hiddentextarea) *** @@ -1369,24 +1083,16 @@ Object height > `optional` **hiddenTextareaContainer**: `null` \| `HTMLElement` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L53) + DOM container to append the hiddenTextarea. An alternative to attaching to the document.body. Useful to reduce laggish redraw of the full document.body tree and also with modals event capturing that won't let the textarea take focus. -#### Default - -```ts - -``` - #### Inherited from -`ITextClickBehavior.hiddenTextareaContainer` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L54) +[`Textbox`](/api/classes/textbox/).[`hiddenTextareaContainer`](/api/classes/textbox/#hiddentextareacontainer) *** @@ -1394,6 +1100,8 @@ also with modals event capturing that won't let the textarea take focus. > **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 @@ -1406,9 +1114,20 @@ null `ITextClickBehavior.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 + +#### Inherited from -[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86) +`ITextClickBehavior.charSpacing` *** @@ -1416,42 +1135,34 @@ 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 `ITextClickBehavior.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:407](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L407) + #### Inherited from `ITextClickBehavior.initialized` -#### Defined in - -[src/shapes/Text/Text.ts:413](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L413) - *** ### 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 @@ -1466,38 +1177,28 @@ false `ITextClickBehavior.inverted` -#### Defined in - -[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217) - *** ### isEditing > **isEditing**: `boolean` -Indicates whether text is in editing mode +Defined in: [src/shapes/IText/IText.ts:157](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L157) -#### Default - -```ts - -``` +Indicates whether text is in editing mode #### Overrides `ITextClickBehavior.isEditing` -#### Defined in - -[src/shapes/IText/IText.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L158) - *** ### 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. @@ -1505,16 +1206,14 @@ part of the move action. `ITextClickBehavior.isMoving` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124) - *** ### keysMap > **keysMap**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L30) + For functionalities on keyDown Map a special key to a function of the instance/prototype If you need different behavior for ESC or TAB or arrows, you have to change @@ -1527,11 +1226,7 @@ The function must be in IText.prototype.myFunction And will receive event as arg #### Inherited from -`ITextClickBehavior.keysMap` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L30) +[`Textbox`](/api/classes/textbox/).[`keysMap`](/api/classes/textbox/#keysmap) *** @@ -1539,13 +1234,11 @@ The function must be in IText.prototype.myFunction And will receive event as arg > **keysMapRtl**: `TKeyMapIText` -#### Inherited from - -`ITextClickBehavior.keysMapRtl` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L32) -#### Defined in +#### Inherited from -[src/shapes/IText/ITextKeyBehavior.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L32) +[`Textbox`](/api/classes/textbox/).[`keysMapRtl`](/api/classes/textbox/#keysmaprtl) *** @@ -1553,9 +1246,11 @@ The function must be in IText.prototype.myFunction And will receive event as arg > **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 @@ -1567,245 +1262,173 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject `ITextClickBehavior.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 +Defined in: [src/shapes/Text/Text.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L225) -```ts - -``` +Line height #### Inherited from `ITextClickBehavior.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 - -```ts +Defined in: [src/shapes/Text/Text.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L206) -``` +Text decoration linethrough. #### Inherited from `ITextClickBehavior.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 `ITextClickBehavior.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 +Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57) -```ts - -``` +When `true`, object vertical movement is locked #### Inherited from `ITextClickBehavior.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 `ITextClickBehavior.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 +Defined in: [src/shapes/Object/InteractiveObject.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L63) -#### Default - -```ts - -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from `ITextClickBehavior.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 +Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59) -```ts - -``` +When `true`, object horizontal scaling is locked #### Inherited from `ITextClickBehavior.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 +Defined in: [src/shapes/Object/InteractiveObject.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L60) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from `ITextClickBehavior.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 `ITextClickBehavior.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 `ITextClickBehavior.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 `ITextClickBehavior.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 + +#### Inherited from + +`ITextClickBehavior.MIN_TEXT_WIDTH` *** @@ -1813,6 +1436,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 @@ -1825,16 +1450,14 @@ Minimum allowed scale value of an object `ITextClickBehavior.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 @@ -1847,16 +1470,14 @@ null `ITextClickBehavior.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. @@ -1873,35 +1494,14 @@ true `ITextClickBehavior.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 - -`ITextClickBehavior.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 @@ -1920,9 +1520,22 @@ true `ITextClickBehavior.objectCaching` -#### Defined in +*** + +### oCoords + +> **oCoords**: `Record`\<`string`, `TOCoord`\> -[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214) +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 + +`ITextClickBehavior.oCoords` *** @@ -1930,6 +1543,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 @@ -1942,16 +1557,14 @@ Opacity of an object `ITextClickBehavior.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 ::: @@ -1960,16 +1573,14 @@ please use 'center' as value in new projects `ITextClickBehavior.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 ::: @@ -1978,47 +1589,33 @@ please use 'center' as value in new projects `ITextClickBehavior.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 - -```ts +Defined in: [src/shapes/Text/Text.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L200) -``` +Text decoration overline. #### Inherited from `ITextClickBehavior.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 -`ITextClickBehavior.ownMatrixCache` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L68) +`ITextClickBehavior.ownMatrixCache` *** @@ -2026,6 +1623,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 @@ -2038,38 +1637,28 @@ Padding between object and its controlling borders (in pixels) `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -2077,16 +1666,14 @@ Used to keep the original parent ref when the object has been added to an Active `ITextClickBehavior.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 @@ -2110,119 +1697,79 @@ const textPath = new Text('Text on a path', { }); ``` -#### Default - -```ts - -``` - #### Inherited from `ITextClickBehavior.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 - -``` - #### Inherited from `ITextClickBehavior.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 - -``` - #### Inherited from `ITextClickBehavior.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 - -``` - #### Inherited from `ITextClickBehavior.pathStartOffset` -#### 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 `ITextClickBehavior.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 @@ -2235,16 +1782,14 @@ Object scale factor (horizontal) `ITextClickBehavior.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 @@ -2257,48 +1802,32 @@ Object scale factor (vertical) `ITextClickBehavior.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 `ITextClickBehavior.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. ::: @@ -2307,27 +1836,15 @@ This API is no longer supported and may be removed in a future release. `ITextClickBehavior.selectionBackgroundColor` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79) - *** ### selectionColor > **selectionColor**: `string` -Color of text selection - -#### Default - -```ts - -``` - -#### Defined in +Defined in: [src/shapes/IText/IText.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L151) -[src/shapes/IText/IText.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L151) +Color of text selection *** @@ -2335,13 +1852,9 @@ Color of text selection > **selectionEnd**: `number` -Index where text selection ends - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L141) -``` +Index where text selection ends #### Implementation of @@ -2351,23 +1864,15 @@ Index where text selection ends `ITextClickBehavior.selectionEnd` -#### Defined in - -[src/shapes/IText/IText.ts:140](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L140) - *** ### selectionStart > **selectionStart**: `number` -Index where text selection starts (or where cursor is when there is no selection) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L135) -``` +Index where text selection starts (or where cursor is when there is no selection) #### Implementation of @@ -2377,30 +1882,26 @@ Index where text selection starts (or where cursor is when there is no selection `ITextClickBehavior.selectionStart` -#### Defined in - -[src/shapes/IText/IText.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L133) - *** ### 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 `ITextClickBehavior.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 @@ -2413,16 +1914,14 @@ Angle of skew on x axes of an object (in degrees) `ITextClickBehavior.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 @@ -2435,32 +1934,28 @@ Angle of skew on y axes of an object (in degrees) `ITextClickBehavior.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 `ITextClickBehavior.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. @@ -2468,30 +1963,26 @@ When undefined, the snapThreshold will default to the snapAngle. `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -2504,16 +1995,14 @@ null; `ITextClickBehavior.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 @@ -2526,16 +2015,14 @@ Line offset of an object's stroke `ITextClickBehavior.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 @@ -2548,38 +2035,28 @@ butt `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -2592,16 +2069,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke `ITextClickBehavior.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 @@ -2627,16 +2102,14 @@ false `ITextClickBehavior.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 @@ -2649,30 +2122,26 @@ Width of a stroke used to render this object `ITextClickBehavior.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) + #### Inherited from `ITextClickBehavior.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 @@ -2703,16 +2172,14 @@ fontSize factor `ITextClickBehavior.subscript` -#### 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 @@ -2743,68 +2210,74 @@ fontSize factor `ITextClickBehavior.superscript` -#### 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:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L170) + #### Inherited from `ITextClickBehavior.text` -#### Defined in - -[src/shapes/Text/Text.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L167) - *** ### textAlign > **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 - -``` - #### Inherited from `ITextClickBehavior.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 +#### Inherited from + +`ITextClickBehavior.textBackgroundColor` + +*** + +### 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 ``` #### Inherited from -`ITextClickBehavior.textBackgroundColor` - -#### Defined in - -[src/shapes/Text/Text.ts:270](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L270) +`ITextClickBehavior.textDecorationThickness` *** @@ -2812,32 +2285,26 @@ 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 - -``` - #### Inherited from `ITextClickBehavior.textLines` -#### 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 @@ -2849,16 +2316,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject `ITextClickBehavior.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 @@ -2871,16 +2336,14 @@ Size of object's controlling corners when touch interaction is detected `ITextClickBehavior.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 @@ -2893,98 +2356,47 @@ true `ITextClickBehavior.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 - -```ts +Defined in: [src/shapes/Text/Text.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L194) -``` +Text decoration underline. #### Inherited from `ITextClickBehavior.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 +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 `ITextClickBehavior.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 - -`ITextClickBehavior.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 [FabricText.fromElement](../../../../api/classes/fabrictext/#fromelement)) - -#### Static +*** -#### Member Of +### width -Text -@see: http://www.w3.org/TR/SVG/text.html#TextElement +> **width**: `number` -#### Inherited from +Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565) -`ITextClickBehavior.ATTRIBUTE_NAMES` +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) +`ITextClickBehavior.width` *** @@ -2992,13 +2404,26 @@ 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 `ITextClickBehavior._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 + +#### Inherited from + +`ITextClickBehavior.ATTRIBUTE_NAMES` *** @@ -3006,6 +2431,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 @@ -3015,32 +2442,28 @@ and refreshed at the next render `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -3048,16 +2471,14 @@ instance.toObject() gets called `ITextClickBehavior.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 @@ -3068,30 +2489,26 @@ https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name `ITextClickBehavior.genericFonts` -#### 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/)\<[`IText`](/api/classes/itext/)\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\>\>\> = `iTextDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`IText`\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\>\>\> = `iTextDefaultValues` + +Defined in: [src/shapes/IText/IText.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L206) #### Overrides `ITextClickBehavior.ownDefaults` -#### Defined in - -[src/shapes/IText/IText.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L214) - *** ### 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 @@ -3100,36 +2517,34 @@ needs its cache regenerated during a .set call `ITextClickBehavior.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` = `'IText'` +Defined in: [src/shapes/IText/IText.ts:212](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L212) + #### Overrides `ITextClickBehavior.type` -#### Defined in - -[src/shapes/IText/IText.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L220) - ## Accessors ### type -> `get` **type**(): `string` +#### Get Signature + +> **get** **type**(): `string` + +Defined in: [src/shapes/IText/IText.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L214) 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 @@ -3137,17 +2552,13 @@ add sustainable warning message This API is no longer supported and may be removed in a future release. ::: -#### Returns +##### Returns `string` #### Overrides -`ITextClickBehavior.type` - -#### Defined in - -[src/shapes/IText/IText.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L222) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#type-1) ## Methods @@ -3155,15 +2566,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 @@ -3173,23 +2592,25 @@ Prepare clipPath state and cache and draw it on instance's cache `ITextClickBehavior._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?**: `boolean` +##### forMeasuring? + +`boolean` #### Returns @@ -3201,35 +2622,43 @@ font declaration formatted for canvas context. `ITextClickBehavior._getFontDeclaration` -#### 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 @@ -3241,26 +2670,28 @@ grapheme bbox `ITextClickBehavior._getGraphemeBox` -#### Defined in - -[src/shapes/Text/Text.ts:983](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L983) - *** ### \_getSelectionForOffset() > **\_getSelectionForOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:383](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L383) + private Helps finding if the offset should be counted from Start or End #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -3270,16 +2701,14 @@ Event object `ITextClickBehavior._getSelectionForOffset` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:377](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L377) - *** ### \_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` @@ -3288,56 +2717,51 @@ Event object `ITextClickBehavior._getWidthOfCharSpacing` -#### 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 `ITextClickBehavior._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 @@ -3345,8 +2769,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` @@ -3359,16 +2781,14 @@ object.numOfSpaces length of chars that match this._reSpacesAndTabs `ITextClickBehavior._measureLine` -#### Defined in - -[src/shapes/Text/Text.ts:891](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L891) - *** ### \_mouseDownHandler() > **\_mouseDownHandler**(`__namedParameters`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L98) + Default event handler for the basic functionalities needed on _mouseDown can be overridden to do something different. Scope of this implementation is: find the click position, set selectionStart @@ -3378,33 +2798,9 @@ current compositionMode. It will be set to false. #### Parameters -• **\_\_namedParameters**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Returns - -`void` - -#### Inherited from - -`ITextClickBehavior._mouseDownHandler` - -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L136) +##### \_\_namedParameters -*** - -### \_mouseDownHandlerBefore() - -> **\_mouseDownHandlerBefore**(`__namedParameters`): `void` - -Default event handler for the basic functionalities needed on mousedown:before -can be overridden to do something different. -Scope of this implementation is: verify the object is already selected when mousing down - -#### Parameters - -• **\_\_namedParameters**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` #### Returns @@ -3412,11 +2808,7 @@ Scope of this implementation is: verify the object is already selected when mous #### Inherited from -`ITextClickBehavior._mouseDownHandlerBefore` - -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:171](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L171) +`ITextClickBehavior._mouseDownHandler` *** @@ -3424,15 +2816,21 @@ Scope of this implementation is: verify the object is already selected when mous > **\_moveCursorLeftOrRight**(`direction`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:645](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L645) + Moves cursor right or Left, fires event #### Parameters -• **direction**: `"Left"` \| `"Right"` +##### direction 'Left', 'Right' -• **e**: `KeyboardEvent` +`"Left"` | `"Right"` + +##### e + +`KeyboardEvent` Event object @@ -3444,25 +2842,27 @@ Event object `ITextClickBehavior._moveCursorLeftOrRight` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:639](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L639) - *** ### \_moveCursorUpOrDown() > **\_moveCursorUpOrDown**(`direction`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:483](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L483) + Moves cursor up or down, fires the events #### Parameters -• **direction**: `"Up"` \| `"Down"` +##### direction 'Up' or 'Down' -• **e**: `KeyboardEvent` +`"Up"` | `"Down"` + +##### e + +`KeyboardEvent` Event object @@ -3474,16 +2874,14 @@ Event object `ITextClickBehavior._moveCursorUpOrDown` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L477) - *** ### \_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 @@ -3494,26 +2892,28 @@ Remove cacheCanvas and its dimensions from the objects `ITextClickBehavior._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 @@ -3529,33 +2929,35 @@ move to interactivity `ITextClickBehavior._renderControls` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435) - *** ### \_renderCursor() > **\_renderCursor**(`ctx`, `boundaries`, `selectionStart`): `void` +Defined in: [src/shapes/IText/IText.ts:604](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L604) + Render the cursor at the given selectionStart. #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +`CanvasRenderingContext2D` -• **selectionStart**: `number` +transformed context to draw on -#### Returns +##### boundaries -`void` +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) + +##### selectionStart + +`number` -#### Defined in +#### Returns -[src/shapes/IText/IText.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L550) +`void` *** @@ -3563,9 +2965,13 @@ Render the cursor at the given selectionStart. > **\_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 @@ -3575,24 +2981,26 @@ Render the cursor at the given selectionStart. `ITextClickBehavior._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 -• **style**: `Pick`\<[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +`CanvasRenderingContext2D` + +##### style + +`Pick`\<`this`, `"fill"`\> with ill defined @@ -3612,24 +3020,26 @@ with ill defined `ITextClickBehavior._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**: `Pick`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/), `"stroke"` \| `"strokeWidth"`\> +##### style + +`Pick`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/), `"stroke"` \| `"strokeWidth"`\> with stroke and strokeWidth defined @@ -3649,22 +3059,22 @@ with stroke and strokeWidth defined `ITextClickBehavior._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 @@ -3676,21 +3086,21 @@ Rendering canvas context `ITextClickBehavior._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 @@ -3704,15 +3114,13 @@ Lines in the text `ITextClickBehavior._splitTextIntoLines` -#### 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 @@ -3720,7 +3128,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 @@ -3733,16 +3143,14 @@ of the instance `ITextClickBehavior._toSVG` -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L120) - *** ### abortCursorAnimation() > **abortCursorAnimation**(): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L182) + Aborts cursor animation, clears all timeouts and clear textarea context if necessary #### Returns @@ -3753,19 +3161,19 @@ Aborts cursor animation, clears all timeouts and clear textarea context if neces `ITextClickBehavior.abortCursorAnimation` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:183](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L183) - *** ### 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 @@ -3775,33 +3183,37 @@ Aborts cursor animation, clears all timeouts and clear textarea context if neces `ITextClickBehavior.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 @@ -3810,24 +3222,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 `ITextClickBehavior.animate` -#### Defined in - -[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557) - *** ### blur() > **blur**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L106) + Override this method to customize cursor behavior on textbox blur #### Returns @@ -3838,16 +3248,14 @@ Override this method to customize cursor behavior on textbox blur `ITextClickBehavior.blur` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L106) - *** ### 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. @@ -3859,16 +3267,14 @@ those never change with zoom or viewport changes. `ITextClickBehavior.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 @@ -3882,16 +3288,14 @@ is a public api and should be done just if extremely necessary `ITextClickBehavior.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 @@ -3905,16 +3309,14 @@ transform matrix for the object `ITextClickBehavior.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 @@ -3925,22 +3327,22 @@ Calculate text box height `ITextClickBehavior.calcTextHeight` -#### 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. @@ -3955,21 +3357,21 @@ transform matrix for the object `ITextClickBehavior.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/IText/ITextClickBehavior.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L64) + override this method to control whether instance should/shouldn't become a drop target #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -3979,16 +3381,14 @@ override this method to control whether instance should/shouldn't become a drop `ITextClickBehavior.canDrop` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L75) - *** ### 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 @@ -3998,9 +3398,9 @@ then it also is deleted. #### Parameters -• **property**: `StylePropertiesType` +##### property -The property to compare between characters and text. +`StylePropertiesType` #### Returns @@ -4010,15 +3410,13 @@ The property to compare between characters and text. `ITextClickBehavior.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. @@ -4027,7 +3425,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. @@ -4046,41 +3446,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue `ITextClickBehavior.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`\<[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`IText`\<`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`\<[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`IText`\<`Props`, `SProps`, `EventSpec`\>\> #### Inherited from `ITextClickBehavior.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. @@ -4091,13 +3489,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. @@ -4109,9 +3509,23 @@ fix the export type, it could not be Image but the type that getClass return for `ITextClickBehavior.cloneAsImage` -#### Defined in +*** + +### cmdAll() + +> **cmdAll**(): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:229](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L229) + +Selects entire text and updates the visual state + +#### Returns + +`void` + +#### Inherited from -[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318) +`ITextClickBehavior.cmdAll` *** @@ -4119,6 +3533,8 @@ fix the export type, it could not be Image but the type that getClass return for > **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 @@ -4131,21 +3547,21 @@ complexity `ITextClickBehavior.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 @@ -4159,16 +3575,14 @@ true if point is inside the object `ITextClickBehavior.containsPoint` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282) - *** ### copy() > **copy**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:301](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L301) + Copies selected text #### Returns @@ -4179,16 +3593,14 @@ Copies selected text `ITextClickBehavior.copy` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L295) - *** ### dispose() > **dispose**(): `void` +Defined in: [src/shapes/IText/IText.ts:776](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L776) + cancel instance's running animations override if necessary to dispose artifacts such as `clipPath` @@ -4200,21 +3612,21 @@ override if necessary to dispose artifacts such as `clipPath` `ITextClickBehavior.dispose` -#### Defined in - -[src/shapes/IText/IText.ts:722](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L722) - *** ### doubleClickHandler() > **doubleClickHandler**(`options`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L71) + Default handler for double click, select a word #### Parameters -• **options**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### options + +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/) #### Returns @@ -4224,15 +3636,13 @@ Default handler for double click, select a word `ITextClickBehavior.doubleClickHandler` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L111) - *** ### 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 @@ -4240,15 +3650,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 @@ -4260,23 +3676,25 @@ object to override the object style `ITextClickBehavior.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 @@ -4288,27 +3706,31 @@ Context to render on `ITextClickBehavior.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 @@ -4318,16 +3740,14 @@ Context to render on `ITextClickBehavior.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 @@ -4337,11 +3757,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 @@ -4353,27 +3777,29 @@ object to override the object style `ITextClickBehavior.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 @@ -4385,29 +3811,33 @@ object size x = width, y = height `ITextClickBehavior.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 @@ -4419,16 +3849,14 @@ additional context for rendering `ITextClickBehavior.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 @@ -4436,7 +3864,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -4454,16 +3884,14 @@ it seemed a good option, now is an edge case `ITextClickBehavior.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 @@ -4474,21 +3902,21 @@ Enlarge space boxes and shift the others `ITextClickBehavior.enlargeSpaces` -#### Defined in - -[src/shapes/Text/Text.ts:491](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L491) - *** ### enterEditing() -> **enterEditing**(`e`?): `void` +> **enterEditing**(`e?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:391](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L391) Enters editing state #### Parameters -• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e? + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) #### Returns @@ -4498,17 +3926,15 @@ Enters editing state `ITextClickBehavior.enterEditing` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L386) - *** ### enterEditingImpl() > **enterEditingImpl**(): `void` -runs the actual logic that enter from editing state, see [enterEditing](../../../../api/classes/itext/#enterediting) +Defined in: [src/shapes/IText/ITextBehavior.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L410) + +runs the actual logic that enter from editing state, see [enterEditing](/api/classes/itext/#enterediting) #### Returns @@ -4518,37 +3944,33 @@ runs the actual logic that enter from editing state, see [enterEditing](../../.. `ITextClickBehavior.enterEditingImpl` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:405](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L405) - *** ### exitEditing() -> **exitEditing**(): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +> **exitEditing**(): `IText`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/IText/ITextBehavior.ts:710](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L710) Exits from editing state and fires relevant events #### Returns -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +`IText`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from `ITextClickBehavior.exitEditing` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:715](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L715) - *** ### exitEditingImpl() > **exitEditingImpl**(): `void` -runs the actual logic that exits from editing state, see [exitEditing](../../../../api/classes/itext/#exitediting) +Defined in: [src/shapes/IText/ITextBehavior.ts:686](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L686) + +runs the actual logic that exits from editing state, see [exitEditing](/api/classes/itext/#exitediting) But it does not fire events #### Returns @@ -4559,9 +3981,23 @@ But it does not fire events `ITextClickBehavior.exitEditingImpl` -#### Defined in +*** + +### findAncestorsWithClipPath() + +> **findAncestorsWithClipPath**(): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] + +Defined in: [src/shapes/IText/IText.ts:441](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L441) -[src/shapes/IText/ITextBehavior.ts:702](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L702) +Finds and returns an array of clip paths that are applied to the parent +group(s) of the current FabricObject instance. The object's hierarchy is +traversed upwards (from the current object towards the root of the canvas), +checking each parent object for the presence of a `clipPath` that is not +absolutely positioned. + +#### Returns + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] *** @@ -4569,15 +4005,21 @@ But it does not fire events > **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* [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `IText`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -4589,21 +4031,21 @@ an object that represent the ancestry situation. `ITextClickBehavior.findCommonAncestors` -#### Defined in - -[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675) - *** ### findLineBoundaryLeft() > **findLineBoundaryLeft**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L295) + Find new selection index representing start of current line according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4617,21 +4059,21 @@ New selection index `ITextClickBehavior.findLineBoundaryLeft` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L288) - *** ### findLineBoundaryRight() > **findLineBoundaryRight**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:312](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L312) + Find new selection index representing end of current line according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4645,21 +4087,21 @@ New selection index `ITextClickBehavior.findLineBoundaryRight` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:305](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L305) - *** ### findWordBoundaryLeft() > **findWordBoundaryLeft**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:247](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L247) + Find new selection index representing start of current word according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4673,21 +4115,21 @@ New selection index `ITextClickBehavior.findWordBoundaryLeft` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L240) - *** ### findWordBoundaryRight() > **findWordBoundaryRight**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:271](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L271) + Find new selection index representing end of current word according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4701,29 +4143,33 @@ New selection index `ITextClickBehavior.findWordBoundaryRight` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L264) - *** ### 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 @@ -4735,22 +4181,22 @@ Options object `ITextClickBehavior.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 @@ -4762,25 +4208,29 @@ function to iterate over the controls over `ITextClickBehavior.forEachControl` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353) - *** ### fromGraphemeToStringSelection() > **fromGraphemeToStringSelection**(`start`, `end`, `graphemes`): `object` +Defined in: [src/shapes/IText/ITextBehavior.ts:503](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L503) + convert from fabric to textarea values #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### graphemes -• **graphemes**: `string`[] +`string`[] #### Returns @@ -4798,25 +4248,29 @@ convert from fabric to textarea values `ITextClickBehavior.fromGraphemeToStringSelection` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:498](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L498) - *** ### fromStringToGraphemeSelection() > **fromStringToGraphemeSelection**(`start`, `end`, `text`): `object` +Defined in: [src/shapes/IText/ITextBehavior.ts:486](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L486) + convert from textarea to grapheme indexes #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### text -• **text**: `string` +`string` #### Returns @@ -4834,21 +4288,21 @@ convert from textarea to grapheme indexes `ITextClickBehavior.fromStringToGraphemeSelection` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:481](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L481) - *** ### 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 @@ -4862,25 +4316,27 @@ value of a property `ITextClickBehavior.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/IText/IText.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L340) Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) #### Parameters -• **selectionStart?**: `number` = `...` +##### selectionStart? + +`number` = `...` Optional index. When not given, current selectionStart is used. -• **skipWrapping?**: `boolean` +##### skipWrapping? + +`boolean` consider the location for unwrapped lines. useful to manage styles. @@ -4900,34 +4356,30 @@ consider the location for unwrapped lines. useful to manage styles. `ITextClickBehavior.get2DCursorLocation` -#### Defined in - -[src/shapes/IText/IText.ts:348](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L348) - *** ### 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 `ITextClickBehavior.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` @@ -4938,16 +4390,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top `ITextClickBehavior.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. @@ -4961,16 +4411,14 @@ Object with left, top, width, height properties `ITextClickBehavior.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` @@ -4979,16 +4427,14 @@ Object with left, top, width, height properties `ITextClickBehavior.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 @@ -4999,26 +4445,28 @@ Returns the center coordinates of the object relative to canvas `ITextClickBehavior.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 @@ -5032,16 +4480,14 @@ style object `ITextClickBehavior.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/)[] @@ -5052,16 +4498,14 @@ style object `ITextClickBehavior.getCoords` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204) - *** ### getCurrentCharColor() > **getCurrentCharColor**(): `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/IText/IText.ts:760](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L760) + High level function to know the color of the cursor. the currentChar is the one that precedes the cursor Returns color (fill) of char at the current cursor @@ -5074,16 +4518,14 @@ Unused by the library, is for the end user Character color (fill) -#### Defined in - -[src/shapes/IText/IText.ts:706](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L706) - *** ### getCurrentCharFontSize() > **getCurrentCharFontSize**(): `number` +Defined in: [src/shapes/IText/IText.ts:747](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L747) + High level function to know the height of the cursor. the currentChar is the one that precedes the cursor Returns fontSize of char at the current cursor @@ -5095,16 +4537,14 @@ Unused from the library, is for the end user Character font size -#### Defined in - -[src/shapes/IText/IText.ts:693](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L693) - *** ### getCursorRenderingData() > **getCursorRenderingData**(`selectionStart`, `boundaries`): [`CursorRenderingData`](/api/type-aliases/cursorrenderingdata/) +Defined in: [src/shapes/IText/IText.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L570) + Return the data needed to render the cursor for given selection start The left,top are relative to the object, while width and height are prescaled to look think with canvas zoom and object scaling, @@ -5112,17 +4552,17 @@ so they depend on canvas and object scaling #### Parameters -• **selectionStart**: `number` = `...` +##### selectionStart -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) = `...` +`number` = `...` -#### Returns +##### boundaries -[`CursorRenderingData`](/api/type-aliases/cursorrenderingdata/) +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) = `...` -#### Defined in +#### Returns -[src/shapes/IText/IText.ts:516](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L516) +[`CursorRenderingData`](/api/type-aliases/cursorrenderingdata/) *** @@ -5130,15 +4570,21 @@ so they depend on canvas and object scaling > **getDownCursorOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:351](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L351) + Gets start offset of a selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -5148,25 +4594,27 @@ Event object `ITextClickBehavior.getDownCursorOffset` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:345](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L345) - *** ### 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 @@ -5180,21 +4628,21 @@ fontSize of the character `ITextClickBehavior.getHeightOfChar` -#### 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 @@ -5206,16 +4654,14 @@ index of line to calculate `ITextClickBehavior.getHeightOfLine` -#### 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 @@ -5226,16 +4672,14 @@ Return the object opacity counting also the group property `ITextClickBehavior.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 @@ -5246,16 +4690,14 @@ Return the object scale factor counting also the group scaling `ITextClickBehavior.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 @@ -5265,11 +4707,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' @@ -5281,16 +4727,14 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.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 @@ -5301,78 +4745,70 @@ Returns the center coordinates of the object relative to it's parent `ITextClickBehavior.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/itext/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/itext/#getx) #### Inherited from `ITextClickBehavior.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 `ITextClickBehavior.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/itext/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/itext/#gety) #### Inherited from `ITextClickBehavior.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 @@ -5389,16 +4825,14 @@ shouldn't this account for group transform and return the actual size in canvas `ITextClickBehavior.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 @@ -5415,16 +4849,14 @@ shouldn't this account for group transform and return the actual size in canvas `ITextClickBehavior.getScaledWidth` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352) - *** ### getSelectedText() > **getSelectedText**(): `string` +Defined in: [src/shapes/IText/ITextBehavior.ts:238](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L238) + Returns selected text #### Returns @@ -5435,21 +4867,21 @@ Returns selected text `ITextClickBehavior.getSelectedText` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L231) - *** ### getSelectionStartFromPointer() > **getSelectionStartFromPointer**(`e`): `number` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L193) + Returns index of a character corresponding to where an object was clicked #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) Event object @@ -5463,30 +4895,34 @@ Index of a character `ITextClickBehavior.getSelectionStartFromPointer` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:246](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L246) - *** ### 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/IText/IText.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L313) Gets style of a current selection/cursor (at the start position) if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used. #### Parameters -• **startIndex**: `number` = `...` +##### startIndex + +`number` = `...` Start index to get styles at -• **endIndex**: `number` = `...` +##### endIndex + +`number` = `...` End index to get styles at, if not specified selectionEnd or startIndex + 1 -• **complete?**: `boolean` +##### complete? + +`boolean` get full style or not @@ -5500,21 +4936,21 @@ styles an array with one, zero or more Style objects `ITextClickBehavior.getSelectionStyles` -#### Defined in - -[src/shapes/IText/IText.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L321) - *** ### 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 @@ -5524,21 +4960,21 @@ Returns id attribute for svg output `ITextClickBehavior.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 @@ -5548,23 +4984,25 @@ Returns filter for svg shadow `ITextClickBehavior.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?**: `boolean` +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -5576,25 +5014,29 @@ a boolean to skip shadow filter output `ITextClickBehavior.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 @@ -5604,16 +5046,14 @@ Returns transform-string for svg-export `ITextClickBehavior.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 @@ -5624,16 +5064,14 @@ Returns the object angle relative to canvas counting also the group property `ITextClickBehavior.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 @@ -5644,11 +5082,7 @@ object with scaleX and scaleY properties #### Inherited from -`ITextClickBehavior.getTotalObjectScaling` - -#### Defined in - -[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593) +`ITextClickBehavior.getTotalObjectScaling` *** @@ -5656,13 +5090,19 @@ object with scaleX and scaleY properties > **getUpCursorOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:396](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L396) + #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -5672,39 +5112,45 @@ Event object `ITextClickBehavior.getUpCursorOffset` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:390](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L390) - *** ### getValueOfPropertyAt() -> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\] +> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): `IText`\<`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 -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\] +`IText`\<`Props`, `SProps`, `EventSpec`\>\[`T`\] the value of 'property' @@ -5712,16 +5158,14 @@ the value of 'property' `ITextClickBehavior.getValueOfPropertyAt` -#### 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 @@ -5732,81 +5176,75 @@ Retrieves viewportTransform from Object's canvas if available `ITextClickBehavior.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 `ITextClickBehavior.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 `ITextClickBehavior.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 `ITextClickBehavior.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 @@ -5824,27 +5262,33 @@ in the middle of the prototype chain `ITextClickBehavior.graphemeSplit` -#### 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 + +`` `${T}Style` `` -• **property**: \`$\{T\}Style\` +##### filler -• **filler**: `string` \| [`TFiller`](/api/type-aliases/tfiller/) +`string` | [`TFiller`](/api/type-aliases/tfiller/) #### Returns @@ -5862,23 +5306,25 @@ in the middle of the prototype chain `ITextClickBehavior.handleFiller` -#### 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* [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `IText`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -5888,15 +5334,13 @@ in the middle of the prototype chain `ITextClickBehavior.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 @@ -5907,7 +5351,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -5919,15 +5363,13 @@ Boolean `ITextClickBehavior.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 @@ -5938,7 +5380,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -5950,16 +5392,14 @@ Boolean `ITextClickBehavior.hasStroke` -#### Defined in - -[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771) - *** ### initBehavior() > **initBehavior**(): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L26) + Initializes all the interactive behavior of IText #### Returns @@ -5970,21 +5410,21 @@ Initializes all the interactive behavior of IText `ITextClickBehavior.initBehavior` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L30) - *** ### initDelayedCursor() -> **initDelayedCursor**(`restart`?): `void` +> **initDelayedCursor**(`restart?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L174) Initializes delayed cursor #### Parameters -• **restart?**: `boolean` +##### restart? + +`boolean` #### Returns @@ -5994,16 +5434,14 @@ Initializes delayed cursor `ITextClickBehavior.initDelayedCursor` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:175](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L175) - *** ### initHiddenTextarea() > **initHiddenTextarea**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L62) + Initializes hidden textarea (needed to bring up keyboard in iOS) #### Returns @@ -6014,54 +5452,14 @@ Initializes hidden textarea (needed to bring up keyboard in iOS) `ITextClickBehavior.initHiddenTextarea` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L63) - -*** - -### insertCharStyleObject() - -> **insertCharStyleObject**(`lineIndex`, `charIndex`, `quantity`, `copiedStyle`?): `void` - -Inserts style object for a given line/char index - -#### Parameters - -• **lineIndex**: `number` - -Index of a line - -• **charIndex**: `number` - -Index of a char - -• **quantity**: `number` - -number Style object to insert, if given - -• **copiedStyle?**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] - -array of style objects - -#### Returns - -`void` - -#### Inherited from - -`ITextClickBehavior.insertCharStyleObject` - -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:901](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L901) - *** ### insertChars() > **insertChars**(`text`, `style`, `start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1046](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1046) + insert characters at start position, before start position. start equal 1 it means the text get inserted between actual grapheme 0 and 1 if style array is provided, it must be as the same length of text in graphemes @@ -6070,17 +5468,25 @@ start/end ar per grapheme position in _text array. #### Parameters -• **text**: `string` +##### text + +`string` text to insert -• **style**: `undefined` \| `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] +##### style array of style objects -• **start**: `number` +`undefined` | `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +##### start + +`number` + +##### end -• **end**: `number` = `start` +`number` = `start` default to start + 1 @@ -6092,31 +5498,41 @@ default to start + 1 `ITextClickBehavior.insertChars` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1051) - *** -### insertNewStyleBlock() +### insertCharStyleObject() -> **insertNewStyleBlock**(`insertedText`, `start`, `copiedStyle`?): `void` +> **insertCharStyleObject**(`lineIndex`, `charIndex`, `quantity`, `copiedStyle?`): `void` -Inserts style object(s) +Defined in: [src/shapes/IText/ITextBehavior.ts:896](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L896) + +Inserts style object for a given line/char index #### Parameters -• **insertedText**: `string`[] +##### lineIndex + +`number` -Characters at the location where style is inserted +Index of a line -• **start**: `number` +##### charIndex -cursor index for inserting style +`number` + +Index of a char -• **copiedStyle?**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] +##### quantity -array of style objects to insert. +`number` + +number Style object to insert, if given + +##### copiedStyle? + +`Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +array of style objects #### Returns @@ -6124,17 +5540,15 @@ array of style objects to insert. #### Inherited from -`ITextClickBehavior.insertNewStyleBlock` - -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:959](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L959) +`ITextClickBehavior.insertCharStyleObject` *** ### insertNewlineStyleObject() -> **insertNewlineStyleObject**(`lineIndex`, `charIndex`, `qty`, `copiedStyle`?): `void` +> **insertNewlineStyleObject**(`lineIndex`, `charIndex`, `qty`, `copiedStyle?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:827](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L827) Handle insertion of more consecutive style lines for when one or more newlines gets added to the text. Since current style needs to be shifted @@ -6143,19 +5557,25 @@ new lines from the last to the first. #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` Index of a line -• **charIndex**: `number` +##### charIndex + +`number` Index of a char -• **qty**: `number` +##### qty + +`number` number of lines to add -• **copiedStyle?** +##### copiedStyle? Array of objects styles @@ -6167,9 +5587,43 @@ Array of objects styles `ITextClickBehavior.insertNewlineStyleObject` -#### Defined in +*** + +### insertNewStyleBlock() + +> **insertNewStyleBlock**(`insertedText`, `start`, `copiedStyle?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:954](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L954) + +Inserts style object(s) + +#### Parameters + +##### insertedText + +`string`[] + +Characters at the location where style is inserted + +##### start + +`number` + +cursor index for inserting style + +##### copiedStyle? + +`Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +array of style objects to insert. + +#### Returns + +`void` + +#### Inherited from -[src/shapes/IText/ITextBehavior.ts:832](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L832) +`ITextClickBehavior.insertNewStyleBlock` *** @@ -6177,11 +5631,15 @@ Array of objects styles > **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 @@ -6195,23 +5653,25 @@ true if object intersects with another object `ITextClickBehavior.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 @@ -6221,21 +5681,24 @@ Checks if object intersects with the scene rect formed by tl and br `ITextClickBehavior.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. @@ -6248,21 +5711,21 @@ on parent canvas. `ITextClickBehavior.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 @@ -6276,23 +5739,25 @@ true if object is fully contained within area of another object `ITextClickBehavior.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 @@ -6302,21 +5767,21 @@ Checks if object is fully contained within the scene rect formed by tl and br `ITextClickBehavior.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. @@ -6331,22 +5796,22 @@ true if the specified control is visible, false otherwise `ITextClickBehavior.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 @@ -6356,21 +5821,21 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai `ITextClickBehavior.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. @@ -6382,22 +5847,22 @@ Returns true if object has no styling or no styling in a line `ITextClickBehavior.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 @@ -6407,23 +5872,25 @@ text and itext do not have wrapping, return false `ITextClickBehavior.isEndOfWrapping` -#### 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* [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `IText`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -6437,16 +5904,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos `ITextClickBehavior.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` @@ -6455,16 +5922,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos `ITextClickBehavior.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 @@ -6478,79 +5943,53 @@ true if object is fully or partially contained within canvas `ITextClickBehavior.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` -#### Type Parameters - -• **T** *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\> - -#### Parameters - -• **other**: `T` - -#### Returns - -`boolean` - -#### Inherited from - -`ITextClickBehavior.isOverlapping` +Defined in: [src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L269) -#### Defined in +#### Type Parameters -[src/shapes/Object/ObjectGeometry.ts:269](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L269) +##### T -*** +`T` *extends* `ObjectGeometry`\<[`ObjectEvents`](/api/interfaces/objectevents/)\> -### isPartiallyOnScreen() +#### Parameters -> **isPartiallyOnScreen**(): `boolean` +##### other -Checks if object is partially contained within the canvas with current viewportTransform +`T` #### Returns `boolean` -true if object is partially contained within canvas - #### Inherited from -`ITextClickBehavior.isPartiallyOnScreen` - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321) +`ITextClickBehavior.isOverlapping` *** -### isTripleClick() +### isPartiallyOnScreen() -> **isTripleClick**(`newPointer`): `boolean` +> **isPartiallyOnScreen**(): `boolean` -#### Parameters +Defined in: [src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L321) -• **newPointer**: [`XY`](/api/interfaces/xy/) +Checks if object is partially contained within the canvas with current viewportTransform #### Returns `boolean` -#### Inherited from - -`ITextClickBehavior.isTripleClick` +true if object is partially contained within canvas -#### Defined in +#### Inherited from -[src/shapes/IText/ITextClickBehavior.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L99) +`ITextClickBehavior.isPartiallyOnScreen` *** @@ -6558,35 +5997,51 @@ true if object is partially contained within canvas > **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 `ITextClickBehavior.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 @@ -6606,15 +6061,13 @@ line number `ITextClickBehavior.measureLine` -#### 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. @@ -6622,9 +6075,13 @@ It return always 1 for text and Itext. Textbox has its own implementation #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` + +##### skipWrapping? -• **skipWrapping?**: `boolean` +`boolean` #### Returns @@ -6636,21 +6093,21 @@ Number `ITextClickBehavior.missingNewlineOffset` -#### Defined in - -[src/shapes/Text/Text.ts:545](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L545) - *** ### moveCursorDown() > **moveCursorDown**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:457](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L457) + Moves cursor down #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6662,21 +6119,21 @@ Event object `ITextClickBehavior.moveCursorDown` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:451](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L451) - *** ### moveCursorLeft() > **moveCursorLeft**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:542](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L542) + Moves cursor left #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6688,57 +6145,53 @@ Event object `ITextClickBehavior.moveCursorLeft` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:536](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L536) - *** -### moveCursorLeftWithShift() +### moveCursorLeftWithoutShift() -> **moveCursorLeftWithShift**(`e`): `undefined` \| `boolean` +> **moveCursorLeftWithoutShift**(`e`): `boolean` -Moves cursor left while keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:594](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L594) + +Moves cursor left without keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` #### Returns -`undefined` \| `boolean` +`boolean` #### Inherited from -`ITextClickBehavior.moveCursorLeftWithShift` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:608](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L608) +`ITextClickBehavior.moveCursorLeftWithoutShift` *** -### moveCursorLeftWithoutShift() +### moveCursorLeftWithShift() -> **moveCursorLeftWithoutShift**(`e`): `boolean` +> **moveCursorLeftWithShift**(`e`): `undefined` \| `boolean` -Moves cursor left without keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:614](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L614) + +Moves cursor left while keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` #### Returns -`boolean` +`undefined` \| `boolean` #### Inherited from -`ITextClickBehavior.moveCursorLeftWithoutShift` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:588](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L588) +`ITextClickBehavior.moveCursorLeftWithShift` *** @@ -6746,11 +6199,15 @@ Moves cursor left without keeping selection > **moveCursorRight**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:630](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L630) + Moves cursor right #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6762,59 +6219,55 @@ Event object `ITextClickBehavior.moveCursorRight` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:624](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L624) - *** -### moveCursorRightWithShift() +### moveCursorRightWithoutShift() -> **moveCursorRightWithShift**(`e`): `undefined` \| `boolean` +> **moveCursorRightWithoutShift**(`e`): `boolean` -Moves cursor right while keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:680](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L680) + +Moves cursor right without keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e -#### Returns +`KeyboardEvent` -`undefined` \| `boolean` +Event object -#### Inherited from +#### Returns -`ITextClickBehavior.moveCursorRightWithShift` +`boolean` -#### Defined in +#### Inherited from -[src/shapes/IText/ITextKeyBehavior.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L658) +`ITextClickBehavior.moveCursorRightWithoutShift` *** -### moveCursorRightWithoutShift() +### moveCursorRightWithShift() -> **moveCursorRightWithoutShift**(`e`): `boolean` +> **moveCursorRightWithShift**(`e`): `undefined` \| `boolean` -Moves cursor right without keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:664](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L664) + +Moves cursor right while keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e -Event object +`KeyboardEvent` #### Returns -`boolean` +`undefined` \| `boolean` #### Inherited from -`ITextClickBehavior.moveCursorRightWithoutShift` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:674](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L674) +`ITextClickBehavior.moveCursorRightWithShift` *** @@ -6822,11 +6275,15 @@ Event object > **moveCursorUp**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:471](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L471) + Moves cursor up #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6838,21 +6295,21 @@ Event object `ITextClickBehavior.moveCursorUp` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:465](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L465) - *** -### moveCursorWithShift() +### moveCursorWithoutShift() -> **moveCursorWithShift**(`offset`): `boolean` +> **moveCursorWithoutShift**(`offset`): `boolean` -Moves cursor with shift +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:527](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L527) + +Moves cursor up without shift #### Parameters -• **offset**: `number` +##### offset + +`number` #### Returns @@ -6860,23 +6317,23 @@ Moves cursor with shift #### Inherited from -`ITextClickBehavior.moveCursorWithShift` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:504](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L504) +`ITextClickBehavior.moveCursorWithoutShift` *** -### moveCursorWithoutShift() +### moveCursorWithShift() -> **moveCursorWithoutShift**(`offset`): `boolean` +> **moveCursorWithShift**(`offset`): `boolean` -Moves cursor up without shift +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:510](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L510) + +Moves cursor with shift #### Parameters -• **offset**: `number` +##### offset + +`number` #### Returns @@ -6884,11 +6341,7 @@ Moves cursor up without shift #### Inherited from -`ITextClickBehavior.moveCursorWithoutShift` - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:521](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L521) +`ITextClickBehavior.moveCursorWithShift` *** @@ -6896,7 +6349,9 @@ Moves cursor up without shift > **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 @@ -6912,18 +6367,16 @@ Boolean `ITextClickBehavior.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 @@ -6934,11 +6387,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') @@ -6950,27 +6407,31 @@ event name (eg. 'after:render') `ITextClickBehavior.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 @@ -6982,19 +6443,19 @@ event listener to unsubscribe `ITextClickBehavior.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}) @@ -7006,14 +6467,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han `ITextClickBehavior.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 @@ -7024,33 +6483,39 @@ unsubscribe all event listeners `ITextClickBehavior.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 @@ -7068,29 +6533,115 @@ on `ITextClickBehavior.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 `ITextClickBehavior.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`\> -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +Function that receives a notification when an event of the specified type occurs + +##### Returns + +`VoidFunction` + +disposer + +##### Alias + +once + +##### Inherited from + +`ITextClickBehavior.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 + +`EventRegistryObject`\<`EventSpec`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) + +##### Returns + +`VoidFunction` + +disposer + +##### Alias + +once + +##### Inherited from + +`ITextClickBehavior.once` *** @@ -7098,6 +6649,8 @@ on > **onCompositionEnd**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:287](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L287) + Composition end #### Returns @@ -7108,16 +6661,14 @@ Composition end `ITextClickBehavior.onCompositionEnd` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:281](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L281) - *** ### onCompositionStart() > **onCompositionStart**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:280](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L280) + Composition start #### Returns @@ -7128,19 +6679,19 @@ Composition start `ITextClickBehavior.onCompositionStart` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L274) - *** ### onCompositionUpdate() > **onCompositionUpdate**(`__namedParameters`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L291) + #### Parameters -• **\_\_namedParameters**: `CompositionEvent` +##### \_\_namedParameters + +`CompositionEvent` #### Returns @@ -7150,28 +6701,30 @@ Composition start `ITextClickBehavior.onCompositionUpdate` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:285](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L285) - *** ### onDeselect() -> **onDeselect**(`options`?): `boolean` +> **onDeselect**(`options?`): `boolean` + +Defined in: [src/shapes/IText/ITextBehavior.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L110) 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? + +###### e? -• **options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +[`TPointerEvent`](/api/type-aliases/tpointerevent/) event if the process is generated by an event -• **options.object?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +###### object? + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> next object we are setting as active, and reason why this is being deselected @@ -7184,21 +6737,21 @@ this is being deselected `ITextClickBehavior.onDeselect` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L111) - *** ### onDragStart() > **onDragStart**(`e`): `boolean` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L57) + override this method to control whether instance should/shouldn't become a drag source, #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -7215,23 +6768,25 @@ To prevent drag and drop between objects both shouldStartDragging and onDragStar `ITextClickBehavior.onDragStart` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L68) - *** ### onInput() > **onInput**(`this`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L174) + Handles onInput event #### Parameters -• **this**: [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> & `object` +##### this -• **e**: `Event` +`IText`\<`Props`, `SProps`, `EventSpec`\> & `object` + +##### e + +`Event` Event object @@ -7243,22 +6798,22 @@ Event object `ITextClickBehavior.onInput` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L167) - *** ### onKeyDown() > **onKeyDown**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L115) + Handles keydown event only used for arrows and combination of modifier keys. #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -7270,23 +6825,23 @@ Event object `ITextClickBehavior.onKeyDown` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L115) - *** ### onKeyUp() > **onKeyUp**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L151) + Handles keyup event We handle KeyUp because ie11 and edge have difficulties copy/pasting if a copy/cut event fired, keyup is dismissed #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -7298,26 +6853,26 @@ Event object `ITextClickBehavior.onKeyUp` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:147](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L147) - *** ### 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 @@ -7329,80 +6884,14 @@ event if the process is generated by an event `ITextClickBehavior.onSelect` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672) - -*** - -### once() - -#### once(eventName, handler) - -> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction` - -Observes specified event **once** - -##### Type Parameters - -• **K** *extends* `string` \| `number` \| `symbol` - -• **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 - -`ITextClickBehavior.once` - -##### Defined in - -[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62) - -#### once(handlers) - -> **once**(`handlers`): `VoidFunction` - -##### Parameters - -• **handlers**: `EventRegistryObject`\<`EventSpec`\> - -##### Returns - -`VoidFunction` - -##### Inherited from - -`ITextClickBehavior.once` - -##### Defined in - -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) - *** ### paste() > **paste**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:323](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L323) + Pastes text #### Returns @@ -7413,24 +6902,26 @@ Pastes text `ITextClickBehavior.paste` -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:317](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L317) - *** ### removeChars() > **removeChars**(`start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1024](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1024) + Removes characters from start/end start/end ar per grapheme position in _text array. #### Parameters -• **start**: `number` +##### start + +`number` + +##### end -• **end**: `number` = `...` +`number` = `...` default to start + 1 @@ -7442,23 +6933,23 @@ default to start + 1 `ITextClickBehavior.removeChars` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1029](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1029) - *** ### removeStyle() > **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 @@ -7468,25 +6959,27 @@ props. Deletes a line style object if it contains no other character styles. `ITextClickBehavior.removeStyle` -#### Defined in - -[src/shapes/Text/StyledText.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L165) - *** ### removeStyleFromTo() > **removeStyleFromTo**(`start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:742](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L742) + remove and reflow a style block from start to end. #### Parameters -• **start**: `number` +##### start + +`number` linear start position for removal (included in removal) -• **end**: `number` +##### end + +`number` linear end position for removal ( excluded from removal ) @@ -7498,21 +6991,23 @@ linear end position for removal ( excluded from removal ) `ITextClickBehavior.removeStyleFromTo` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:747](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L747) - *** ### 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 @@ -7522,62 +7017,62 @@ linear end position for removal ( excluded from removal ) `ITextClickBehavior.renderCache` -#### Defined in - -[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732) - *** ### renderCursor() > **renderCursor**(`ctx`, `boundaries`): `void` +Defined in: [src/shapes/IText/IText.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L560) + Renders cursor #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` transformed context to draw on -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) #### Returns `void` -#### Defined in - -[src/shapes/IText/IText.ts:506](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L506) - *** ### renderCursorAt() > **renderCursorAt**(`selectionStart`): `void` +Defined in: [src/shapes/IText/IText.ts:547](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L547) + Renders cursor on context Top, outside the animation cycle, on request Used for the drag/drop effect. If contextTop is not available, do nothing. #### Parameters -• **selectionStart**: `number` +##### selectionStart + +`number` #### Returns `void` -#### Defined in - -[src/shapes/IText/IText.ts:493](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L493) - *** ### renderCursorOrSelection() > **renderCursorOrSelection**(): `void` +Defined in: [src/shapes/IText/IText.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L375) + Renders cursor or selection (depending on what exists) it does on the contextTop. If contextTop is not available, do nothing. @@ -7589,16 +7084,14 @@ it does on the contextTop. If contextTop is not available, do nothing. `ITextClickBehavior.renderCursorOrSelection` -#### Defined in - -[src/shapes/IText/IText.ts:383](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L383) - *** ### renderDragSourceEffect() > **renderDragSourceEffect**(): `void` +Defined in: [src/shapes/IText/IText.ts:636](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L636) + Renders drag start text selection #### Returns @@ -7609,16 +7102,14 @@ Renders drag start text selection `ITextClickBehavior.renderDragSourceEffect` -#### Defined in - -[src/shapes/IText/IText.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L582) - *** ### renderDropTargetEffect() > **renderDropTargetEffect**(`e`): `void` +Defined in: [src/shapes/IText/IText.ts:646](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L646) + 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 @@ -7626,7 +7117,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -7636,25 +7129,27 @@ object will change when dropping. example: show the cursor where the text is abo `ITextClickBehavior.renderDropTargetEffect` -#### Defined in - -[src/shapes/IText/IText.ts:592](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L592) - *** ### renderSelection() > **renderSelection**(`ctx`, `boundaries`): `void` +Defined in: [src/shapes/IText/IText.ts:621](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L621) + Renders text selection #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` transformed context to draw on -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) Object with left/top/leftOffset/topOffset @@ -7662,16 +7157,14 @@ Object with left/top/leftOffset/topOffset `void` -#### Defined in - -[src/shapes/IText/IText.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L567) - *** ### restartCursorIfNeeded() > **restartCursorIfNeeded**(): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L205) + Restart tue cursor animation if either is in complete state ( between animations ) or if it never started before @@ -7683,21 +7176,21 @@ or if it never started before `ITextClickBehavior.restartCursorIfNeeded` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:206](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L206) - *** ### 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) @@ -7709,21 +7202,21 @@ Angle value (in degrees) `ITextClickBehavior.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 @@ -7735,21 +7228,21 @@ Scale factor `ITextClickBehavior.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 @@ -7761,21 +7254,21 @@ New height value `ITextClickBehavior.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 @@ -7787,28 +7280,30 @@ New width value `ITextClickBehavior.scaleToWidth` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381) - *** ### searchWordBoundary() > **searchWordBoundary**(`selectionStart`, `direction`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:330](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L330) + Finds index corresponding to beginning or end of a word #### Parameters -• **selectionStart**: `number` +##### selectionStart + +`number` Index of a character -• **direction**: `-1` \| `1` +##### direction 1 or -1 +`-1` | `1` + #### Returns `number` @@ -7819,69 +7314,65 @@ Index of the beginning or end of a word `ITextClickBehavior.searchWordBoundary` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:323](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L323) - *** ### selectAll() -> **selectAll**(): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +> **selectAll**(): `IText`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/IText/ITextBehavior.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L218) Selects entire text #### Returns -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +`IText`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from `ITextClickBehavior.selectAll` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L219) - *** ### selectLine() -> **selectLine**(`selectionStart`?): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +> **selectLine**(`selectionStart?`): `void` -TODO fix: selectionStart set as 0 will be ignored? -Selects a line based on the index +Defined in: [src/shapes/IText/ITextBehavior.ts:377](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L377) + +Selects the line that contains selectionStart #### Parameters -• **selectionStart?**: `number` +##### selectionStart? + +`number` Index of a character #### Returns -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +`void` #### Inherited from `ITextClickBehavior.selectLine` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:371](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L371) - *** ### selectWord() -> **selectWord**(`selectionStart`?): `void` +> **selectWord**(`selectionStart?`): `void` -TODO fix: selectionStart set as 0 will be ignored? -Selects a word based on the index +Defined in: [src/shapes/IText/ITextBehavior.ts:355](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L355) + +Selects the word that contains the char at index selectionStart #### Parameters -• **selectionStart?**: `number` +##### selectionStart? + +`number` Index of a character @@ -7893,102 +7384,102 @@ Index of a character `ITextClickBehavior.selectWord` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:349](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L349) - *** ### set() -> **set**(`key`, `value`?): [`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `IText`\<`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 -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +`IText`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from `ITextClickBehavior.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 +`ITextClickBehavior.setControlsVisibility` -#### Inherited from +*** -`ITextClickBehavior.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 -`ITextClickBehavior.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) +`ITextClickBehavior.setControlVisible` *** @@ -7996,8 +7487,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 @@ -8007,21 +7500,21 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https:// `ITextClickBehavior.setCoords` -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343) - *** ### setCursorByClick() > **setCursorByClick**(`e`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:172](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L172) + Changes cursor location in a text depending on passed pointer (x/y) object #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) Event object @@ -8033,16 +7526,14 @@ Event object `ITextClickBehavior.setCursorByClick` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L225) - *** ### 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 @@ -8056,16 +7547,14 @@ Travis build error about unused variables. `ITextClickBehavior.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 @@ -8077,29 +7566,33 @@ for path and text calculations `ITextClickBehavior.setPathInfo` -#### 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' @@ -8111,22 +7604,22 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.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/itext/#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/itext/#setx) #### Returns @@ -8136,29 +7629,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas `ITextClickBehavior.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/itext/#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/itext/#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' @@ -8170,22 +7667,22 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.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/itext/#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/itext/#sety) #### Returns @@ -8195,21 +7692,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl `ITextClickBehavior.setRelativeY` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139) - *** ### setSelectionEnd() > **setSelectionEnd**(`index`): `void` +Defined in: [src/shapes/IText/IText.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L263) + Sets selection end (right boundary of a selection) #### Parameters -• **index**: `number` +##### index + +`number` Index to set selection end to @@ -8217,21 +7714,21 @@ Index to set selection end to `void` -#### Defined in - -[src/shapes/IText/IText.ts:271](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L271) - *** ### setSelectionStart() > **setSelectionStart**(`index`): `void` +Defined in: [src/shapes/IText/IText.ts:254](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L254) + Sets selection start (left boundary of a selection) #### Parameters -• **index**: `number` +##### index + +`number` Index to set selection start to @@ -8239,26 +7736,30 @@ Index to set selection start to `void` -#### Defined in - -[src/shapes/IText/IText.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L262) - *** ### setSelectionStartEndWithShift() > **setSelectionStartEndWithShift**(`start`, `end`, `newSelection`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1073](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1073) + Set the selectionStart and selectionEnd according to the new position of cursor mimic the key - mouse navigation when shift is pressed. #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### newSelection -• **newSelection**: `number` +`number` #### Returns @@ -8268,29 +7769,33 @@ mimic the key - mouse navigation when shift is pressed. `ITextClickBehavior.setSelectionStartEndWithShift` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1078](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1078) - *** ### setSelectionStyles() -> **setSelectionStyles**(`styles`?, `startIndex`?, `endIndex`?): `void` +> **setSelectionStyles**(`styles?`, `startIndex?`, `endIndex?`): `void` + +Defined in: [src/shapes/IText/IText.ts:327](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L327) 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 selectionEnd or startIndex + 1 @@ -8302,25 +7807,27 @@ End index to get styles at, if not specified selectionEnd or startIndex + 1 `ITextClickBehavior.setSelectionStyles` -#### Defined in - -[src/shapes/IText/IText.ts:335](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L335) - *** ### 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 @@ -8332,25 +7839,27 @@ selection end `ITextClickBehavior.setSubscript` -#### 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 @@ -8362,21 +7871,21 @@ selection end `ITextClickBehavior.setSuperscript` -#### 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 + +`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 @@ -8386,15 +7895,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/ `ITextClickBehavior.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, @@ -8402,15 +7909,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' @@ -8428,21 +7941,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). `ITextClickBehavior.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 @@ -8452,25 +7965,27 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ `ITextClickBehavior.setY` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107) - *** ### shiftLineStyles() > **shiftLineStyles**(`lineIndex`, `offset`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:804](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L804) + Shifts line styles up or down #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` Index of a line -• **offset**: `number` +##### offset + +`number` Can any number? @@ -8482,20 +7997,18 @@ Can any number? `ITextClickBehavior.shiftLineStyles` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:809](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L809) - *** ### 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. @@ -8507,16 +8020,14 @@ Read as: cache if is needed, or if the feature is enabled but we are not already `ITextClickBehavior.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**(): `boolean` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L47) + If this method returns true a mouse move operation over a text selection will not prevent the native mouse event allowing the browser to start a drag operation. shouldStartDragging can be read 'do not prevent default for mouse move event' @@ -8530,25 +8041,27 @@ To prevent drag and drop between objects both shouldStartDragging and onDragStar `ITextClickBehavior.shouldStartDragging` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L58) - *** ### 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 @@ -8560,26 +8073,28 @@ the control box size used `ITextClickBehavior.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 @@ -8591,21 +8106,43 @@ to check the style on `ITextClickBehavior.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 + +`ITextClickBehavior.toBlob` *** ### toCanvasElement() -> **toCanvasElement**(`options`?): `HTMLCanvasElement` +> **toCanvasElement**(`options?`): `HTMLCanvasElement` + +Defined in: [src/shapes/IText/IText.ts:363](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L363) block cursor/selection logic while rendering the exported canvas #### Parameters -• **options?**: `ObjectToCanvasElementOptions` +##### options? + +`ObjectToCanvasElementOptions` #### Returns @@ -8619,23 +8156,25 @@ this workaround should be replaced with a more robust solution `ITextClickBehavior.toCanvasElement` -#### Defined in - -[src/shapes/IText/IText.ts:371](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L371) - *** ### 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. @@ -8649,9 +8188,33 @@ svg representation of an instance `ITextClickBehavior.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) +`ITextClickBehavior.toDatalessObject` *** @@ -8659,11 +8222,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 @@ -8677,37 +8244,31 @@ Returns a data: URL containing a representation of the object in the format spec `ITextClickBehavior.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`): `IText`\<`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 +`IText`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from -`ITextClickBehavior.toDatalessObject` - -#### Defined in - -[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884) +`ITextClickBehavior.toggle` *** @@ -8715,6 +8276,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 @@ -8727,27 +8290,31 @@ JSON `ITextClickBehavior.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/)\<[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T + +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`IText`\<`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 @@ -8761,46 +8328,14 @@ Object representation of an instance `ITextClickBehavior.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 - -`ITextClickBehavior.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 @@ -8813,35 +8348,37 @@ String representation of text object `ITextClickBehavior.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`): [`IText`](/api/classes/itext/)\<`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? -[`IText`](/api/classes/itext/)\<`Props`, `SProps`, `EventSpec`\> +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -#### Inherited from +Method for further parsing of svg representation. -`ITextClickBehavior.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) +`ITextClickBehavior.toSVG` *** @@ -8849,11 +8386,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 @@ -8865,19 +8406,19 @@ Context `ITextClickBehavior.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 @@ -8887,29 +8428,33 @@ Context `ITextClickBehavior.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' @@ -8921,37 +8466,45 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.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' @@ -8963,29 +8516,33 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.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' @@ -8997,21 +8554,21 @@ Vertical origin: 'top', 'center' or 'bottom' `ITextClickBehavior.translateToOriginPoint` -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710) - *** ### tripleClickHandler() > **tripleClickHandler**(`options`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L82) + Default handler for triple click, select a line #### Parameters -• **options**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### options + +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/) #### Returns @@ -9021,21 +8578,21 @@ Default handler for triple click, select a line `ITextClickBehavior.tripleClickHandler` -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L121) - *** ### updateSelectionOnMouseMove() > **updateSelectionOnMouseMove**(`e`): `void` -called by [Canvas#textEditingManager](../../../../api/classes/canvas/#texteditingmanager) +Defined in: [src/shapes/IText/ITextBehavior.ts:432](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L432) + +called by [Canvas#textEditingManager](/api/classes/canvas/#texteditingmanager) #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) #### Returns @@ -9045,16 +8602,14 @@ called by [Canvas#textEditingManager](../../../../api/classes/canvas/#texteditin `ITextClickBehavior.updateSelectionOnMouseMove` -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L427) - *** ### ~~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 @@ -9070,25 +8625,29 @@ This API is no longer supported and may be removed in a future release. `ITextClickBehavior.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 @@ -9098,16 +8657,14 @@ This API is no longer supported and may be removed in a future release. `ITextClickBehavior._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 @@ -9124,65 +8681,67 @@ make this function return an empty object and add controls to the ownDefaults `ITextClickBehavior.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`](/api/classes/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/) +`HTMLElement` | `SVGElement` -Options object +##### options? -• **cssRules?**: `CSSRules` +[`Abortable`](/api/type-aliases/abortable/) -#### Returns +Options object -`Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`object`, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +##### cssRules? -#### Static +`CSSRules` -#### Member Of +#### Returns -Text +`Promise`\<[`FabricText`](/api/classes/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/)\>\> #### Inherited from `ITextClickBehavior.fromElement` -#### Defined in - -[src/shapes/Text/Text.ts:1847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1847) - *** ### fromObject() > `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`](/api/classes/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 @@ -9194,16 +8753,14 @@ plain js Object to create an instance from `ITextClickBehavior.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/IText/IText.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L208) + #### Returns `Record`\<`string`, `any`\> @@ -9211,7 +8768,3 @@ plain js Object to create an instance from #### Overrides `ITextClickBehavior.getDefaults` - -#### Defined in - -[src/shapes/IText/IText.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L216) diff --git a/src/content/docs/api/classes/InteractiveFabricObject.md b/src/content/docs/api/classes/InteractiveFabricObject.md index 1fc123431..0174d7889 100644 --- a/src/content/docs/api/classes/InteractiveFabricObject.md +++ b/src/content/docs/api/classes/InteractiveFabricObject.md @@ -5,87 +5,9 @@ prev: false title: "InteractiveFabricObject" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Object/InteractiveObject.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L43) -## 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 @@ -97,11 +19,17 @@ 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/) ## Implements @@ -109,29 +37,29 @@ drop ## Constructors -### new InteractiveFabricObject() +### Constructor + +> **new InteractiveFabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> -> **new InteractiveFabricObject**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`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 -[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +`InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Overrides -[`BaseFabricObject`](/api/classes/basefabricobject/).[`constructor`](/api/classes/basefabricobject/#constructors) - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L151) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`constructor`](/api/classes/basefabricobject/#constructor) ## Properties @@ -139,36 +67,34 @@ 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 a read-only property. this isn't cleaned automatically. Non selected objects may have wrong values -#### 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 -#### 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. @@ -179,37 +105,14 @@ Probably added to keep track of some performance issues use git blame to investigate why it was added DON'T USE IT. WE WILL TRY TO REMOVE IT -#### 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/interactivefabricobject/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/interactivefabricobject/#calcacoords) - -#### Inherited from - -[`BaseFabricObject`](/api/classes/basefabricobject/).[`aCoords`](/api/classes/basefabricobject/#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 @@ -231,9 +134,24 @@ false [`BaseFabricObject`](/api/classes/basefabricobject/).[`absolutePositioned`](/api/classes/basefabricobject/#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/interactivefabricobject/#setcoords). +You can calculate them without updating with [()](/api/classes/interactivefabricobject/#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) *** @@ -241,6 +159,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 @@ -255,11 +175,7 @@ Angle of rotation of an object (in degrees) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`angle`](/api/classes/basefabricobject/#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) *** @@ -267,15 +183,11 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) @@ -284,16 +196,14 @@ takes css colors https://www.w3.org/TR/css-color-3/ [`BaseFabricObject`](/api/classes/basefabricobject/).[`backgroundColor`](/api/classes/basefabricobject/#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 @@ -306,16 +216,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#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 @@ -326,16 +234,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#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 +254,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#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 @@ -373,16 +278,14 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#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 @@ -393,12 +296,6 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) @@ -407,16 +304,14 @@ The object method `rotate` will always consider this property and never the canv [`BaseFabricObject`](/api/classes/basefabricobject/).[`centeredRotation`](/api/classes/basefabricobject/#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. @@ -424,12 +319,6 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) @@ -438,16 +327,14 @@ when being scaled via the controls. [`BaseFabricObject`](/api/classes/basefabricobject/).[`centeredScaling`](/api/classes/basefabricobject/#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. @@ -461,29 +348,25 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`BaseFabricObject`](/api/classes/basefabricobject/).[`clipPath`](/api/classes/basefabricobject/#clippath) -#### Defined in - -[src/shapes/Object/Object.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L216) - *** ### 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 -#### 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 @@ -496,16 +379,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#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 @@ -522,16 +403,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#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 @@ -544,16 +423,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#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 @@ -570,20 +447,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#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 @@ -594,24 +473,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. -::: - #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#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 @@ -625,50 +498,34 @@ true [`BaseFabricObject`](/api/classes/basefabricobject/).[`dirty`](/api/classes/basefabricobject/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) @@ -677,16 +534,14 @@ When `true`, object is not exported in OBJECT/JSON [`BaseFabricObject`](/api/classes/basefabricobject/).[`excludeFromExport`](/api/classes/basefabricobject/#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/ @@ -704,16 +559,14 @@ rgb(0,0,0) [`BaseFabricObject`](/api/classes/basefabricobject/).[`fill`](/api/classes/basefabricobject/#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 +585,14 @@ nonzero [`BaseFabricObject`](/api/classes/basefabricobject/).[`fillRule`](/api/classes/basefabricobject/#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 @@ -756,11 +607,7 @@ false #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`flipX`](/api/classes/basefabricobject/#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) *** @@ -768,6 +615,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 @@ -782,11 +631,7 @@ false #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`flipY`](/api/classes/basefabricobject/#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) *** @@ -794,13 +639,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 @@ -810,38 +651,28 @@ Composite rule used for canvas globalCompositeOperation [`BaseFabricObject`](/api/classes/basefabricobject/).[`globalCompositeOperation`](/api/classes/basefabricobject/#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 +Defined in: [src/shapes/Object/InteractiveObject.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L78) -```ts - -``` +When set to `false`, object's controlling borders are not rendered #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#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 @@ -854,23 +685,15 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#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 @@ -878,11 +701,7 @@ Object height #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`height`](/api/classes/basefabricobject/#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) *** @@ -890,6 +709,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 @@ -902,23 +723,15 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#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 +Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208) -#### Default - -```ts - -``` +When `false`, default object's values are not included in its serialization #### Implementation of @@ -928,16 +741,14 @@ When `false`, default object's values are not included in its serialization [`BaseFabricObject`](/api/classes/basefabricobject/).[`includeDefaultValues`](/api/classes/basefabricobject/#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 @@ -956,32 +767,28 @@ false [`BaseFabricObject`](/api/classes/basefabricobject/).[`inverted`](/api/classes/basefabricobject/#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. -#### 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 @@ -995,11 +802,7 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`left`](/api/classes/basefabricobject/#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) *** @@ -1007,191 +810,125 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked +Defined in: [src/shapes/Object/InteractiveObject.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L56) -#### Default - -```ts - -``` +When `true`, object horizontal movement is locked #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#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 +Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57) -```ts - -``` +When `true`, object vertical movement is locked #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#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 +Defined in: [src/shapes/Object/InteractiveObject.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L59) -```ts - -``` +When `true`, object horizontal scaling is locked #### Implementation of [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#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 -[`BaseFabricObject`](/api/classes/basefabricobject/).[`matrixCache`](/api/classes/basefabricobject/#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) *** @@ -1199,6 +936,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 @@ -1215,16 +954,14 @@ Minimum allowed scale value of an object [`BaseFabricObject`](/api/classes/basefabricobject/).[`minScaleLimit`](/api/classes/basefabricobject/#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 @@ -1237,16 +974,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#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. @@ -1263,31 +998,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#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. - -#### 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 @@ -1310,9 +1028,18 @@ true [`BaseFabricObject`](/api/classes/basefabricobject/).[`objectCaching`](/api/classes/basefabricobject/#objectcaching) -#### Defined in +*** -[src/shapes/Object/Object.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L214) +### 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. *** @@ -1320,6 +1047,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 @@ -1336,16 +1065,14 @@ Opacity of an object [`BaseFabricObject`](/api/classes/basefabricobject/).[`opacity`](/api/classes/basefabricobject/#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 ::: @@ -1356,11 +1083,7 @@ please use 'center' as value in new projects #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`originX`](/api/classes/basefabricobject/#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) *** @@ -1368,6 +1091,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 ::: @@ -1378,11 +1103,7 @@ please use 'center' as value in new projects #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`originY`](/api/classes/basefabricobject/#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) *** @@ -1390,15 +1111,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 -[`BaseFabricObject`](/api/classes/basefabricobject/).[`ownMatrixCache`](/api/classes/basefabricobject/#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) *** @@ -1406,6 +1125,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 @@ -1420,11 +1141,7 @@ Padding between object and its controlling borders (in pixels) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`padding`](/api/classes/basefabricobject/#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) *** @@ -1432,13 +1149,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 +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") #### Implementation of @@ -1448,16 +1161,14 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") [`BaseFabricObject`](/api/classes/basefabricobject/).[`paintFirst`](/api/classes/basefabricobject/#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 @@ -1465,38 +1176,28 @@ Used to keep the original parent ref when the object has been added to an Active [`BaseFabricObject`](/api/classes/basefabricobject/).[`parent`](/api/classes/basefabricobject/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#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 @@ -1511,11 +1212,7 @@ Object scale factor (horizontal) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`scaleX`](/api/classes/basefabricobject/#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) *** @@ -1523,6 +1220,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 @@ -1537,11 +1236,7 @@ Object scale factor (vertical) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`scaleY`](/api/classes/basefabricobject/#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) *** @@ -1549,38 +1244,26 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#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. ::: @@ -1589,16 +1272,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#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 @@ -1615,16 +1296,14 @@ null [`BaseFabricObject`](/api/classes/basefabricobject/).[`shadow`](/api/classes/basefabricobject/#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 @@ -1639,11 +1318,7 @@ Angle of skew on x axes of an object (in degrees) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`skewX`](/api/classes/basefabricobject/#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) *** @@ -1651,6 +1326,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 @@ -1665,11 +1342,7 @@ Angle of skew on y axes of an object (in degrees) #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`skewY`](/api/classes/basefabricobject/#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) *** @@ -1677,22 +1350,22 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#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. @@ -1700,16 +1373,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#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/ @@ -1727,16 +1398,14 @@ null [`BaseFabricObject`](/api/classes/basefabricobject/).[`stroke`](/api/classes/basefabricobject/#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 @@ -1753,16 +1422,14 @@ null; [`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeDashArray`](/api/classes/basefabricobject/#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 @@ -1779,16 +1446,14 @@ Line offset of an object's stroke [`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeDashOffset`](/api/classes/basefabricobject/#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 @@ -1805,23 +1470,15 @@ butt [`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeLineCap`](/api/classes/basefabricobject/#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 @@ -1831,16 +1488,14 @@ Corner style of an object's stroke (one of "bevel", "round", "miter") [`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeLineJoin`](/api/classes/basefabricobject/#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 @@ -1857,16 +1512,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeMiterLimit`](/api/classes/basefabricobject/#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 @@ -1894,11 +1547,7 @@ false #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeUniform`](/api/classes/basefabricobject/#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) *** @@ -1906,6 +1555,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 @@ -1920,11 +1571,7 @@ Width of a stroke used to render this object #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`strokeWidth`](/api/classes/basefabricobject/#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) *** @@ -1932,9 +1579,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 @@ -1948,11 +1597,7 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`top`](/api/classes/basefabricobject/#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) *** @@ -1960,6 +1605,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 @@ -1972,16 +1619,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#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 @@ -1994,23 +1639,15 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#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 @@ -2020,23 +1657,15 @@ When set to `false`, an object is not rendered on canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`visible`](/api/classes/basefabricobject/#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 @@ -2044,11 +1673,7 @@ Object width #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`width`](/api/classes/basefabricobject/#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) *** @@ -2056,6 +1681,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 @@ -2065,32 +1692,28 @@ and refreshed at the next render [`BaseFabricObject`](/api/classes/basefabricobject/).[`cacheProperties`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`colorProperties`](/api/classes/basefabricobject/#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 @@ -2098,30 +1721,26 @@ instance.toObject() gets called [`BaseFabricObject`](/api/classes/basefabricobject/).[`customProperties`](/api/classes/basefabricobject/#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` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`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) #### Overrides [`BaseFabricObject`](/api/classes/basefabricobject/).[`ownDefaults`](/api/classes/basefabricobject/#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 @@ -2130,16 +1749,14 @@ needs its cache regenerated during a .set call [`BaseFabricObject`](/api/classes/basefabricobject/).[`stateProperties`](/api/classes/basefabricobject/#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. @@ -2153,22 +1770,22 @@ We do not do that in fabricJS code because we want to try to have code splitting [`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#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 @@ -2176,23 +1793,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 -[`BaseFabricObject`](/api/classes/basefabricobject/).[`type`](/api/classes/basefabricobject/#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 @@ -2200,15 +1823,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 @@ -2218,51 +1849,44 @@ Prepare clipPath state and cache and draw it on instance's cache [`BaseFabricObject`](/api/classes/basefabricobject/).[`_drawClipPath`](/api/classes/basefabricobject/#_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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`_limitCacheSize`](/api/classes/basefabricobject/#_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 @@ -2273,26 +1897,28 @@ Remove cacheCanvas and its dimensions from the objects [`BaseFabricObject`](/api/classes/basefabricobject/).[`_removeCacheCanvas`](/api/classes/basefabricobject/#_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 @@ -2304,19 +1930,19 @@ properties to override the object style move to interactivity -#### 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 @@ -2326,21 +1952,23 @@ move to interactivity [`BaseFabricObject`](/api/classes/basefabricobject/).[`_setClippingProperties`](/api/classes/basefabricobject/#_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`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2350,21 +1978,23 @@ move to interactivity [`BaseFabricObject`](/api/classes/basefabricobject/).[`_setFillStyles`](/api/classes/basefabricobject/#_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`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2374,22 +2004,22 @@ move to interactivity [`BaseFabricObject`](/api/classes/basefabricobject/).[`_setStrokeStyles`](/api/classes/basefabricobject/#_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 @@ -2401,33 +2031,37 @@ Rendering canvas context [`BaseFabricObject`](/api/classes/basefabricobject/).[`_setupCompositeOperation`](/api/classes/basefabricobject/#_setupcompositeoperation) -#### 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 @@ -2436,24 +2070,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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`animate`](/api/classes/basefabricobject/#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. @@ -2465,16 +2097,14 @@ those never change with zoom or viewport changes. [`BaseFabricObject`](/api/classes/basefabricobject/).[`calcACoords`](/api/classes/basefabricobject/#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 @@ -2484,16 +2114,14 @@ is a public api and should be done just if extremely necessary `Record`\<`string`, `TOCoord`\> -#### 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 @@ -2507,22 +2135,22 @@ transform matrix for the object [`BaseFabricObject`](/api/classes/basefabricobject/).[`calcOwnMatrix`](/api/classes/basefabricobject/#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. @@ -2537,21 +2165,21 @@ transform matrix for the object [`BaseFabricObject`](/api/classes/basefabricobject/).[`calcTransformMatrix`](/api/classes/basefabricobject/#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 @@ -2559,15 +2187,13 @@ Override to customize drag and drop behavior true if the object currently dragged can be dropped on the target -#### 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. @@ -2576,7 +2202,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. @@ -2591,41 +2219,39 @@ with the object transformMatrix, or restored to neutral transform discuss swapping restoreManually with a renderCallback, but think of async issues -#### 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`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`InteractiveFabricObject`\<`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`\<[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\>\> #### Inherited from [`BaseFabricObject`](/api/classes/basefabricobject/).[`clone`](/api/classes/basefabricobject/#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. @@ -2636,13 +2262,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. @@ -2654,16 +2282,14 @@ fix the export type, it could not be Image but the type that getClass return for [`BaseFabricObject`](/api/classes/basefabricobject/).[`cloneAsImage`](/api/classes/basefabricobject/#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 @@ -2676,21 +2302,21 @@ complexity of this instance (is 1 unless subclassed) [`BaseFabricObject`](/api/classes/basefabricobject/).[`complexity`](/api/classes/basefabricobject/#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 @@ -2704,16 +2330,14 @@ true if point is inside the object [`BaseFabricObject`](/api/classes/basefabricobject/).[`containsPoint`](/api/classes/basefabricobject/#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` @@ -2725,15 +2349,13 @@ override if necessary to dispose artifacts such as `clipPath` [`BaseFabricObject`](/api/classes/basefabricobject/).[`dispose`](/api/classes/basefabricobject/#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 @@ -2741,15 +2363,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 @@ -2757,23 +2385,25 @@ object to override the object style `void` -#### 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 @@ -2785,27 +2415,31 @@ Context to render on [`BaseFabricObject`](/api/classes/basefabricobject/).[`drawCacheOnCanvas`](/api/classes/basefabricobject/#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 @@ -2815,16 +2449,14 @@ Context to render on [`BaseFabricObject`](/api/classes/basefabricobject/).[`drawClipPathOnCache`](/api/classes/basefabricobject/#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 @@ -2834,11 +2466,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 @@ -2846,27 +2482,29 @@ object to override the object style `void` -#### 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 @@ -2874,29 +2512,33 @@ object size x = width, y = height `void` -#### 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 @@ -2908,16 +2550,14 @@ additional context for rendering [`BaseFabricObject`](/api/classes/basefabricobject/).[`drawObject`](/api/classes/basefabricobject/#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 @@ -2925,7 +2565,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -2943,25 +2585,27 @@ it seemed a good option, now is an edge case [`BaseFabricObject`](/api/classes/basefabricobject/).[`drawSelectionBackground`](/api/classes/basefabricobject/#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* [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -2973,29 +2617,33 @@ an object that represent the ancestry situation. [`BaseFabricObject`](/api/classes/basefabricobject/).[`findCommonAncestors`](/api/classes/basefabricobject/#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 @@ -3007,22 +2655,22 @@ Options object [`BaseFabricObject`](/api/classes/basefabricobject/).[`fire`](/api/classes/basefabricobject/#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 @@ -3030,21 +2678,21 @@ function to iterate over the controls over `void` -#### 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 @@ -3058,23 +2706,17 @@ value of a property [`BaseFabricObject`](/api/classes/basefabricobject/).[`get`](/api/classes/basefabricobject/#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`; \} -#### Returns - -`undefined` \| `object` +Defined in: [src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L194) -#### Defined in +#### Returns -[src/shapes/Object/InteractiveObject.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L194) +`undefined` \| \{ `control`: [`Control`](/api/classes/control/); `coord`: `TOCoord`; `key`: `string`; \} *** @@ -3082,6 +2724,8 @@ value of a property > **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` @@ -3092,16 +2736,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top [`BaseFabricObject`](/api/classes/basefabricobject/).[`getAncestors`](/api/classes/basefabricobject/#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. @@ -3115,16 +2757,14 @@ Object with left, top, width, height properties [`BaseFabricObject`](/api/classes/basefabricobject/).[`getBoundingRect`](/api/classes/basefabricobject/#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` @@ -3133,16 +2773,14 @@ Object with left, top, width, height properties [`BaseFabricObject`](/api/classes/basefabricobject/).[`getCanvasRetinaScaling`](/api/classes/basefabricobject/#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 @@ -3153,16 +2791,14 @@ Returns the center coordinates of the object relative to canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`getCenterPoint`](/api/classes/basefabricobject/#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/)[] @@ -3173,16 +2809,14 @@ Returns the center coordinates of the object relative to canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`getCoords`](/api/classes/basefabricobject/#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 @@ -3193,16 +2827,14 @@ Return the object opacity counting also the group property [`BaseFabricObject`](/api/classes/basefabricobject/).[`getObjectOpacity`](/api/classes/basefabricobject/#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 @@ -3213,16 +2845,14 @@ Return the object scale factor counting also the group scaling [`BaseFabricObject`](/api/classes/basefabricobject/).[`getObjectScaling`](/api/classes/basefabricobject/#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 @@ -3232,11 +2862,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' @@ -3248,16 +2882,14 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`getPointByOrigin`](/api/classes/basefabricobject/#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 @@ -3268,78 +2900,70 @@ Returns the center coordinates of the object relative to it's parent [`BaseFabricObject`](/api/classes/basefabricobject/).[`getRelativeCenterPoint`](/api/classes/basefabricobject/#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/interactivefabricobject/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/interactivefabricobject/#getx) #### Inherited from [`BaseFabricObject`](/api/classes/basefabricobject/).[`getRelativeX`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`getRelativeXY`](/api/classes/basefabricobject/#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/interactivefabricobject/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/interactivefabricobject/#gety) #### Inherited from [`BaseFabricObject`](/api/classes/basefabricobject/).[`getRelativeY`](/api/classes/basefabricobject/#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 @@ -3356,16 +2980,14 @@ shouldn't this account for group transform and return the actual size in canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`getScaledHeight`](/api/classes/basefabricobject/#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 @@ -3380,11 +3002,7 @@ shouldn't this account for group transform and return the actual size in canvas #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`getScaledWidth`](/api/classes/basefabricobject/#getscaledwidth) - -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`getScaledWidth`](/api/classes/basefabricobject/#getscaledwidth) *** @@ -3392,6 +3010,8 @@ shouldn't this account for group transform and return the actual size in canvas > **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 @@ -3402,16 +3022,14 @@ Returns the object angle relative to canvas counting also the group property [`BaseFabricObject`](/api/classes/basefabricobject/).[`getTotalAngle`](/api/classes/basefabricobject/#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 @@ -3424,16 +3042,14 @@ object with scaleX and scaleY properties [`BaseFabricObject`](/api/classes/basefabricobject/).[`getTotalObjectScaling`](/api/classes/basefabricobject/#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 @@ -3444,83 +3060,79 @@ Retrieves viewportTransform from Object's canvas if available [`BaseFabricObject`](/api/classes/basefabricobject/).[`getViewportTransform`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`getX`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`getXY`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`getY`](/api/classes/basefabricobject/#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* [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3530,15 +3142,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy [`BaseFabricObject`](/api/classes/basefabricobject/).[`hasCommonAncestors`](/api/classes/basefabricobject/#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 @@ -3549,7 +3159,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3561,15 +3171,13 @@ Boolean [`BaseFabricObject`](/api/classes/basefabricobject/).[`hasFill`](/api/classes/basefabricobject/#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 @@ -3580,7 +3188,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3592,21 +3200,21 @@ Boolean [`BaseFabricObject`](/api/classes/basefabricobject/).[`hasStroke`](/api/classes/basefabricobject/#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 @@ -3620,23 +3228,25 @@ true if object intersects with another object [`BaseFabricObject`](/api/classes/basefabricobject/).[`intersectsWithObject`](/api/classes/basefabricobject/#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 @@ -3646,21 +3256,24 @@ Checks if object intersects with the scene rect formed by tl and br [`BaseFabricObject`](/api/classes/basefabricobject/).[`intersectsWithRect`](/api/classes/basefabricobject/#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. @@ -3673,21 +3286,21 @@ on parent canvas. [`BaseFabricObject`](/api/classes/basefabricobject/).[`isCacheDirty`](/api/classes/basefabricobject/#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 @@ -3701,23 +3314,25 @@ true if object is fully contained within area of another object [`BaseFabricObject`](/api/classes/basefabricobject/).[`isContainedWithinObject`](/api/classes/basefabricobject/#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 @@ -3727,21 +3342,21 @@ Checks if object is fully contained within the scene rect formed by tl and br [`BaseFabricObject`](/api/classes/basefabricobject/).[`isContainedWithinRect`](/api/classes/basefabricobject/#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. @@ -3752,22 +3367,22 @@ but since the control api allow for any control name, can be any string. true if the specified control is visible, false otherwise -#### 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 @@ -3777,23 +3392,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai [`BaseFabricObject`](/api/classes/basefabricobject/).[`isDescendantOf`](/api/classes/basefabricobject/#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* [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -3807,16 +3424,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`BaseFabricObject`](/api/classes/basefabricobject/).[`isInFrontOf`](/api/classes/basefabricobject/#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` @@ -3825,16 +3442,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`BaseFabricObject`](/api/classes/basefabricobject/).[`isNotVisible`](/api/classes/basefabricobject/#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 @@ -3848,23 +3463,25 @@ true if object is fully or partially contained within canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`isOnScreen`](/api/classes/basefabricobject/#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 @@ -3874,16 +3491,14 @@ true if object is fully or partially contained within canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`isOverlapping`](/api/classes/basefabricobject/#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 @@ -3896,41 +3511,51 @@ true if object is partially contained within canvas [`BaseFabricObject`](/api/classes/basefabricobject/).[`isPartiallyOnScreen`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`isType`](/api/classes/basefabricobject/#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 @@ -3946,18 +3571,16 @@ Boolean [`BaseFabricObject`](/api/classes/basefabricobject/).[`needsItsOwnCache`](/api/classes/basefabricobject/#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 @@ -3968,11 +3591,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') @@ -3984,27 +3611,31 @@ event name (eg. 'after:render') [`BaseFabricObject`](/api/classes/basefabricobject/).[`off`](/api/classes/basefabricobject/#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 @@ -4016,19 +3647,19 @@ event listener to unsubscribe [`BaseFabricObject`](/api/classes/basefabricobject/).[`off`](/api/classes/basefabricobject/#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}) @@ -4040,14 +3671,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han [`BaseFabricObject`](/api/classes/basefabricobject/).[`off`](/api/classes/basefabricobject/#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 @@ -4058,33 +3687,39 @@ unsubscribe all event listeners [`BaseFabricObject`](/api/classes/basefabricobject/).[`off`](/api/classes/basefabricobject/#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 @@ -4102,170 +3737,194 @@ on [`BaseFabricObject`](/api/classes/basefabricobject/).[`on`](/api/classes/basefabricobject/#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 [`BaseFabricObject`](/api/classes/basefabricobject/).[`on`](/api/classes/basefabricobject/#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 -#### 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 -#### Defined in +[`BaseFabricObject`](/api/classes/basefabricobject/).[`once`](/api/classes/basefabricobject/#once) -[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691) +#### Call Signature -*** +> **once**(`handlers`): `VoidFunction` -### onSelect() +Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66) -> **onSelect**(`_options`?): `boolean` +Observes specified event **once** -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 -#### Parameters +###### handlers -• **\_options?** +`EventRegistryObject`\<`EventSpec`\> -options sent from the upper functions +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) -• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### Returns -event if the process is generated by an event +`VoidFunction` -#### Returns +disposer -`boolean` +##### Alias -#### Defined in +once + +##### Inherited from -[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`once`](/api/classes/basefabricobject/#once) *** -### once() +### onDeselect() -#### once(eventName, handler) +> **onDeselect**(`_options?`): `boolean` -> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction` +Defined in: [src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L658) -Observes specified event **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 -##### Type Parameters +#### Parameters -• **K** *extends* `string` \| `number` \| `symbol` +##### \_options? -• **E** +options sent from the upper functions -##### Parameters +###### e? -• **eventName**: `K` +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -Event name (eg. 'after:render') +###### object? -• **handler**: `TEventCallback`\<`E`\> +`InteractiveFabricObject`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -Function that receives a notification when an event of the specified type occurs +#### Returns -##### Returns +`boolean` -`VoidFunction` +*** -disposer +### onDragStart() -##### Alias +> **onDragStart**(`_e`): `boolean` -once +Defined in: [src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L691) -##### Inherited from +Override to customize Drag behavior\ +Fired once a drag session has started -[`BaseFabricObject`](/api/classes/basefabricobject/).[`once`](/api/classes/basefabricobject/#once) +#### Parameters -##### Defined in +##### \_e -[src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L62) +`DragEvent` -#### once(handlers) +#### Returns -> **once**(`handlers`): `VoidFunction` +`boolean` -##### Parameters +true to handle the drag event -• **handlers**: `EventRegistryObject`\<`EventSpec`\> +*** -##### Returns +### onSelect() -`VoidFunction` +> **onSelect**(`_options?`): `boolean` -##### Inherited from +Defined in: [src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L672) -[`BaseFabricObject`](/api/classes/basefabricobject/).[`once`](/api/classes/basefabricobject/#once) +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 + +##### \_options? + +options sent from the upper functions + +###### e? + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) + +event if the process is generated by an event -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +#### Returns + +`boolean` *** @@ -4273,11 +3932,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 @@ -4289,21 +3952,23 @@ Context to render on [`BaseFabricObject`](/api/classes/basefabricobject/).[`render`](/api/classes/basefabricobject/#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 @@ -4313,38 +3978,36 @@ Context to render on [`BaseFabricObject`](/api/classes/basefabricobject/).[`renderCache`](/api/classes/basefabricobject/#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 `void` -#### 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 @@ -4352,27 +4015,29 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns `void` -#### 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) @@ -4384,21 +4049,21 @@ Angle value (in degrees) [`BaseFabricObject`](/api/classes/basefabricobject/).[`rotate`](/api/classes/basefabricobject/#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 @@ -4410,21 +4075,21 @@ Scale factor [`BaseFabricObject`](/api/classes/basefabricobject/).[`scale`](/api/classes/basefabricobject/#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 @@ -4436,21 +4101,21 @@ New height value [`BaseFabricObject`](/api/classes/basefabricobject/).[`scaleToHeight`](/api/classes/basefabricobject/#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 @@ -4462,94 +4127,94 @@ New width value [`BaseFabricObject`](/api/classes/basefabricobject/).[`scaleToWidth`](/api/classes/basefabricobject/#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`?): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `InteractiveFabricObject`\<`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 -[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> +`InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from [`BaseFabricObject`](/api/classes/basefabricobject/).[`set`](/api/classes/basefabricobject/#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 +*** -discuss this overlap of priority here with the team. Andrea Bogazzi for details +### 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` -#### Defined in +#### Todo -[src/shapes/Object/InteractiveObject.ts:611](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L611) +discuss this overlap of priority here with the team. Andrea Bogazzi for details *** @@ -4557,8 +4222,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 @@ -4568,16 +4235,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https:// [`BaseFabricObject`](/api/classes/basefabricobject/).[`setCoords`](/api/classes/basefabricobject/#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 @@ -4591,29 +4256,33 @@ Travis build error about unused variables. [`BaseFabricObject`](/api/classes/basefabricobject/).[`setOnGroup`](/api/classes/basefabricobject/#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' @@ -4625,22 +4294,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`setPositionByOrigin`](/api/classes/basefabricobject/#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/interactivefabricobject/#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/interactivefabricobject/#setx) #### Returns @@ -4650,29 +4319,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas [`BaseFabricObject`](/api/classes/basefabricobject/).[`setRelativeX`](/api/classes/basefabricobject/#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/interactivefabricobject/#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/interactivefabricobject/#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' @@ -4684,22 +4357,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`setRelativeXY`](/api/classes/basefabricobject/#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/interactivefabricobject/#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/interactivefabricobject/#sety) #### Returns @@ -4709,21 +4382,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl [`BaseFabricObject`](/api/classes/basefabricobject/).[`setRelativeY`](/api/classes/basefabricobject/#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 @@ -4733,15 +4406,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/ [`BaseFabricObject`](/api/classes/basefabricobject/).[`setX`](/api/classes/basefabricobject/#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, @@ -4749,15 +4420,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' @@ -4775,21 +4452,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). [`BaseFabricObject`](/api/classes/basefabricobject/).[`setXY`](/api/classes/basefabricobject/#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 @@ -4799,20 +4476,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ [`BaseFabricObject`](/api/classes/basefabricobject/).[`setY`](/api/classes/basefabricobject/#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. @@ -4824,22 +4499,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already [`BaseFabricObject`](/api/classes/basefabricobject/).[`shouldCache`](/api/classes/basefabricobject/#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 @@ -4847,25 +4522,27 @@ Fired from Canvas#_onMouseMove true in order for the window to start a drag session -#### 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 @@ -4873,9 +4550,27 @@ the control box size used `void` -#### 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) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`toBlob`](/api/classes/basefabricobject/#toblob) *** @@ -4883,11 +4578,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 @@ -4901,9 +4600,33 @@ Returns DOM element with the FabricObject [`BaseFabricObject`](/api/classes/basefabricobject/).[`toCanvasElement`](/api/classes/basefabricobject/#tocanvaselement) -#### 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/Object.ts:1340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1340) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`toDatalessObject`](/api/classes/basefabricobject/#todatalessobject) *** @@ -4911,11 +4634,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 @@ -4929,37 +4656,31 @@ Returns a data: URL containing a representation of the object in the format spec [`BaseFabricObject`](/api/classes/basefabricobject/).[`toDataURL`](/api/classes/basefabricobject/#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`): `InteractiveFabricObject`\<`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 +`InteractiveFabricObject`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from -[`BaseFabricObject`](/api/classes/basefabricobject/).[`toDatalessObject`](/api/classes/basefabricobject/#todatalessobject) - -#### Defined in - -[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884) +[`BaseFabricObject`](/api/classes/basefabricobject/).[`toggle`](/api/classes/basefabricobject/#toggle) *** @@ -4967,6 +4688,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 @@ -4979,21 +4702,21 @@ JSON [`BaseFabricObject`](/api/classes/basefabricobject/).[`toJSON`](/api/classes/basefabricobject/#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 @@ -5007,16 +4730,14 @@ Object representation of an instance [`BaseFabricObject`](/api/classes/basefabricobject/).[`toObject`](/api/classes/basefabricobject/#toobject) -#### 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 @@ -5027,47 +4748,21 @@ Returns a string representation of an instance [`BaseFabricObject`](/api/classes/basefabricobject/).[`toString`](/api/classes/basefabricobject/#tostring) -#### 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`): [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> - -Toggles specified property from `true` to `false` or from `false` to `true` - -#### Parameters - -• **property**: `string` - -Property to toggle - -#### Returns - -[`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Props`, `SProps`, `EventSpec`\> - -#### Inherited from - -[`BaseFabricObject`](/api/classes/basefabricobject/).[`toggle`](/api/classes/basefabricobject/#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 @@ -5079,19 +4774,19 @@ Context [`BaseFabricObject`](/api/classes/basefabricobject/).[`transform`](/api/classes/basefabricobject/#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 @@ -5101,29 +4796,33 @@ Context [`BaseFabricObject`](/api/classes/basefabricobject/).[`transformMatrixKey`](/api/classes/basefabricobject/#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' @@ -5135,37 +4834,45 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`translateToCenterPoint`](/api/classes/basefabricobject/#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' @@ -5177,29 +4884,33 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`translateToGivenOrigin`](/api/classes/basefabricobject/#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' @@ -5211,16 +4922,14 @@ Vertical origin: 'top', 'center' or 'bottom' [`BaseFabricObject`](/api/classes/basefabricobject/).[`translateToOriginPoint`](/api/classes/basefabricobject/#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 @@ -5236,25 +4945,29 @@ This API is no longer supported and may be removed in a future release. [`BaseFabricObject`](/api/classes/basefabricobject/).[`willDrawShadow`](/api/classes/basefabricobject/#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 @@ -5264,16 +4977,14 @@ This API is no longer supported and may be removed in a future release. [`BaseFabricObject`](/api/classes/basefabricobject/).[`_fromObject`](/api/classes/basefabricobject/#_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 @@ -5286,25 +4997,29 @@ make this function return an empty object and add controls to the ownDefaults > **controls**: `Record`\<`string`, [`Control`](/api/classes/control/)\> -#### 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 @@ -5314,16 +5029,14 @@ make this function return an empty object and add controls to the ownDefaults [`BaseFabricObject`](/api/classes/basefabricobject/).[`fromObject`](/api/classes/basefabricobject/#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`\> @@ -5331,7 +5044,3 @@ make this function return an empty object and add controls to the ownDefaults #### Overrides [`BaseFabricObject`](/api/classes/basefabricobject/).[`getDefaults`](/api/classes/basefabricobject/#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/Intersection.md b/src/content/docs/api/classes/Intersection.md index c25c5cf8c..fe8cada5f 100644 --- a/src/content/docs/api/classes/Intersection.md +++ b/src/content/docs/api/classes/Intersection.md @@ -5,23 +5,25 @@ prev: false title: "Intersection" --- +Defined in: [src/Intersection.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L8) + ## Constructors -### new Intersection() +### Constructor + +> **new Intersection**(`status?`): `Intersection` -> **new Intersection**(`status`?): [`Intersection`](/api/classes/intersection/) +Defined in: [src/Intersection.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L13) #### Parameters -• **status?**: [`IntersectionType`](/api/type-aliases/intersectiontype/) +##### status? -#### Returns +[`IntersectionType`](/api/type-aliases/intersectiontype/) -[`Intersection`](/api/classes/intersection/) - -#### Defined in +#### Returns -[src/Intersection.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L13) +`Intersection` ## Properties @@ -29,9 +31,7 @@ title: "Intersection" > **points**: [`Point`](/api/classes/point/)[] -#### Defined in - -[src/Intersection.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L9) +Defined in: [src/Intersection.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L9) *** @@ -39,298 +39,330 @@ title: "Intersection" > `optional` **status**: [`IntersectionType`](/api/type-aliases/intersectiontype/) -#### Defined in - -[src/Intersection.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L11) +Defined in: [src/Intersection.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L11) ## Methods ### intersectLineLine() -> `static` **intersectLineLine**(`a1`, `a2`, `b1`, `b2`, `aInfinite`?, `bInfinite`?): [`Intersection`](/api/classes/intersection/) +> `static` **intersectLineLine**(`a1`, `a2`, `b1`, `b2`, `aInfinite?`, `bInfinite?`): `Intersection` + +Defined in: [src/Intersection.ts:125](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L125) Checks if a line intersects another #### Parameters -• **a1**: [`Point`](/api/classes/point/) +##### a1 + +[`Point`](/api/classes/point/) + +##### a2 -• **a2**: [`Point`](/api/classes/point/) +[`Point`](/api/classes/point/) -• **b1**: [`Point`](/api/classes/point/) +##### b1 -• **b2**: [`Point`](/api/classes/point/) +[`Point`](/api/classes/point/) -• **aInfinite?**: `boolean` = `true` +##### b2 + +[`Point`](/api/classes/point/) + +##### aInfinite? + +`boolean` = `true` check segment intersection by passing `false` -• **bInfinite?**: `boolean` = `true` +##### bInfinite? + +`boolean` = `true` check segment intersection by passing `false` #### Returns -[`Intersection`](/api/classes/intersection/) +`Intersection` #### See - [line intersection](https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection) - [Cramer's rule](https://en.wikipedia.org/wiki/Cramer%27s_rule) -#### Static - -#### Defined in - -[src/Intersection.ts:127](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L127) - *** ### intersectLinePolygon() -> `static` **intersectLinePolygon**(`a1`, `a2`, `points`, `infinite`?): [`Intersection`](/api/classes/intersection/) +> `static` **intersectLinePolygon**(`a1`, `a2`, `points`, `infinite?`): `Intersection` + +Defined in: [src/Intersection.ts:219](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L219) Checks if line intersects polygon #### Parameters -• **a1**: [`Point`](/api/classes/point/) +##### a1 + +[`Point`](/api/classes/point/) point on line -• **a2**: [`Point`](/api/classes/point/) +##### a2 + +[`Point`](/api/classes/point/) other point on line -• **points**: [`Point`](/api/classes/point/)[] +##### points + +[`Point`](/api/classes/point/)[] polygon points -• **infinite?**: `boolean` = `true` +##### infinite? + +`boolean` = `true` check segment intersection by passing `false` #### Returns -[`Intersection`](/api/classes/intersection/) +`Intersection` #### Todo account for stroke -#### Static - #### See -[intersectSegmentPolygon](../../../../api/classes/intersection/#intersectsegmentpolygon) for segment intersection - -#### Defined in - -[src/Intersection.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L224) +[intersectSegmentPolygon](/api/classes/intersection/#intersectsegmentpolygon) for segment intersection *** ### intersectPolygonPolygon() -> `static` **intersectPolygonPolygon**(`points1`, `points2`): [`Intersection`](/api/classes/intersection/) +> `static` **intersectPolygonPolygon**(`points1`, `points2`): `Intersection` + +Defined in: [src/Intersection.ts:270](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L270) Checks if polygon intersects another polygon #### Parameters -• **points1**: [`Point`](/api/classes/point/)[] +##### points1 + +[`Point`](/api/classes/point/)[] + +##### points2 -• **points2**: [`Point`](/api/classes/point/)[] +[`Point`](/api/classes/point/)[] #### Returns -[`Intersection`](/api/classes/intersection/) +`Intersection` #### Todo account for stroke -#### Static - -#### Defined in - -[src/Intersection.ts:277](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L277) - *** ### intersectPolygonRectangle() -> `static` **intersectPolygonRectangle**(`points`, `r1`, `r2`): [`Intersection`](/api/classes/intersection/) +> `static` **intersectPolygonRectangle**(`points`, `r1`, `r2`): `Intersection` + +Defined in: [src/Intersection.ts:307](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L307) Checks if polygon intersects rectangle #### Parameters -• **points**: [`Point`](/api/classes/point/)[] +##### points + +[`Point`](/api/classes/point/)[] polygon points -• **r1**: [`Point`](/api/classes/point/) +##### r1 + +[`Point`](/api/classes/point/) top left point of rect -• **r2**: [`Point`](/api/classes/point/) +##### r2 + +[`Point`](/api/classes/point/) bottom right point of rect #### Returns -[`Intersection`](/api/classes/intersection/) - -#### Static +`Intersection` #### See -[intersectPolygonPolygon](../../../../api/classes/intersection/#intersectpolygonpolygon) for polygon intersection - -#### Defined in - -[src/Intersection.ts:315](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L315) +[intersectPolygonPolygon](/api/classes/intersection/#intersectpolygonpolygon) for polygon intersection *** ### intersectSegmentLine() -> `static` **intersectSegmentLine**(`s1`, `s2`, `l1`, `l2`): [`Intersection`](/api/classes/intersection/) +> `static` **intersectSegmentLine**(`s1`, `s2`, `l1`, `l2`): `Intersection` + +Defined in: [src/Intersection.ts:180](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L180) Checks if a segment intersects a line #### Parameters -• **s1**: [`Point`](/api/classes/point/) +##### s1 + +[`Point`](/api/classes/point/) boundary point of segment -• **s2**: [`Point`](/api/classes/point/) +##### s2 + +[`Point`](/api/classes/point/) other boundary point of segment -• **l1**: [`Point`](/api/classes/point/) +##### l1 + +[`Point`](/api/classes/point/) point on line -• **l2**: [`Point`](/api/classes/point/) +##### l2 + +[`Point`](/api/classes/point/) other point on line #### Returns -[`Intersection`](/api/classes/intersection/) +`Intersection` #### See -[intersectLineLine](../../../../api/classes/intersection/#intersectlineline) for line intersection - -#### Static - -#### Defined in - -[src/Intersection.ts:183](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L183) +[intersectLineLine](/api/classes/intersection/#intersectlineline) for line intersection *** ### intersectSegmentPolygon() -> `static` **intersectSegmentPolygon**(`a1`, `a2`, `points`): [`Intersection`](/api/classes/intersection/) +> `static` **intersectSegmentPolygon**(`a1`, `a2`, `points`): `Intersection` + +Defined in: [src/Intersection.ts:253](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L253) Checks if segment intersects polygon #### Parameters -• **a1**: [`Point`](/api/classes/point/) +##### a1 + +[`Point`](/api/classes/point/) boundary point of segment -• **a2**: [`Point`](/api/classes/point/) +##### a2 + +[`Point`](/api/classes/point/) other boundary point of segment -• **points**: [`Point`](/api/classes/point/)[] +##### points + +[`Point`](/api/classes/point/)[] polygon points #### Returns -[`Intersection`](/api/classes/intersection/) - -#### Static +`Intersection` #### See -[intersectLinePolygon](../../../../api/classes/intersection/#intersectlinepolygon) for line intersection - -#### Defined in - -[src/Intersection.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L259) +[intersectLinePolygon](/api/classes/intersection/#intersectlinepolygon) for line intersection *** ### intersectSegmentSegment() -> `static` **intersectSegmentSegment**(`a1`, `a2`, `b1`, `b2`): [`Intersection`](/api/classes/intersection/) +> `static` **intersectSegmentSegment**(`a1`, `a2`, `b1`, `b2`): `Intersection` + +Defined in: [src/Intersection.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L198) Checks if a segment intersects another #### Parameters -• **a1**: [`Point`](/api/classes/point/) +##### a1 + +[`Point`](/api/classes/point/) boundary point of segment -• **a2**: [`Point`](/api/classes/point/) +##### a2 + +[`Point`](/api/classes/point/) other boundary point of segment -• **b1**: [`Point`](/api/classes/point/) +##### b1 + +[`Point`](/api/classes/point/) boundary point of segment -• **b2**: [`Point`](/api/classes/point/) +##### b2 + +[`Point`](/api/classes/point/) other boundary point of segment #### Returns -[`Intersection`](/api/classes/intersection/) +`Intersection` #### See -[intersectLineLine](../../../../api/classes/intersection/#intersectlineline) for line intersection - -#### Static - -#### Defined in - -[src/Intersection.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L202) +[intersectLineLine](/api/classes/intersection/#intersectlineline) for line intersection *** ### isPointContained() -> `static` **isPointContained**(`T`, `A`, `B`, `infinite`?): `boolean` +> `static` **isPointContained**(`T`, `A`, `B`, `infinite?`): `boolean` + +Defined in: [src/Intersection.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L50) check if point T is on the segment or line defined between A and B #### Parameters -• **T**: [`Point`](/api/classes/point/) +##### T + +[`Point`](/api/classes/point/) the point we are checking for -• **A**: [`Point`](/api/classes/point/) +##### A + +[`Point`](/api/classes/point/) one extremity of the segment -• **B**: [`Point`](/api/classes/point/) +##### B + +[`Point`](/api/classes/point/) the other extremity of the segment -• **infinite?**: `boolean` = `false` +##### infinite? + +`boolean` = `false` if true checks if `T` is on the line defined by `A` and `B` @@ -340,23 +372,25 @@ if true checks if `T` is on the line defined by `A` and `B` true if `T` is contained -#### Defined in - -[src/Intersection.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L51) - *** ### isPointInPolygon() > `static` **isPointInPolygon**(`point`, `points`): `boolean` +Defined in: [src/Intersection.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L90) + Use the ray casting algorithm to determine if point is in the polygon defined by points #### Parameters -• **point**: [`Point`](/api/classes/point/) +##### point -• **points**: [`Point`](/api/classes/point/)[] +[`Point`](/api/classes/point/) + +##### points + +[`Point`](/api/classes/point/)[] polygon points @@ -367,7 +401,3 @@ polygon points #### See https://en.wikipedia.org/wiki/Point_in_polygon - -#### Defined in - -[src/Intersection.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L91) diff --git a/src/content/docs/api/classes/LayoutManager.md b/src/content/docs/api/classes/LayoutManager.md index 09058cb78..29c3f5c3c 100644 --- a/src/content/docs/api/classes/LayoutManager.md +++ b/src/content/docs/api/classes/LayoutManager.md @@ -5,23 +5,25 @@ prev: false title: "LayoutManager" --- +Defined in: [src/LayoutManager/LayoutManager.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L45) + ## Constructors -### new LayoutManager() +### Constructor -> **new LayoutManager**(`strategy`): [`LayoutManager`](/api/classes/layoutmanager/) +> **new LayoutManager**(`strategy`): `LayoutManager` -#### Parameters +Defined in: [src/LayoutManager/LayoutManager.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L51) -• **strategy**: [`LayoutStrategy`](/api/classes/layoutstrategy/) = `...` +#### Parameters -#### Returns +##### strategy -[`LayoutManager`](/api/classes/layoutmanager/) +[`LayoutStrategy`](/api/classes/layoutstrategy/) = `...` -#### Defined in +#### Returns -[src/LayoutManager/LayoutManager.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L51) +`LayoutManager` ## Properties @@ -29,9 +31,7 @@ title: "LayoutManager" > **strategy**: [`LayoutStrategy`](/api/classes/layoutstrategy/) -#### Defined in - -[src/LayoutManager/LayoutManager.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L49) +Defined in: [src/LayoutManager/LayoutManager.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L49) ## Methods @@ -39,56 +39,56 @@ title: "LayoutManager" > **dispose**(): `void` +Defined in: [src/LayoutManager/LayoutManager.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L340) + #### Returns `void` -#### Defined in - -[src/LayoutManager/LayoutManager.ts:340](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L340) - *** ### performLayout() > **performLayout**(`context`): `void` +Defined in: [src/LayoutManager/LayoutManager.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L56) + #### Parameters -• **context**: [`LayoutContext`](/api/type-aliases/layoutcontext/) +##### context + +[`LayoutContext`](/api/type-aliases/layoutcontext/) #### Returns `void` -#### Defined in - -[src/LayoutManager/LayoutManager.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L56) - *** ### subscribeTargets() > **subscribeTargets**(`context`): `void` +Defined in: [src/LayoutManager/LayoutManager.ts:156](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L156) + #### Parameters -• **context**: [`RegistrationContext`](/api/type-aliases/registrationcontext/) & `Partial`\<[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)\> +##### context + +[`RegistrationContext`](/api/type-aliases/registrationcontext/) & `Partial`\<[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)\> #### Returns `void` -#### Defined in - -[src/LayoutManager/LayoutManager.ts:156](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L156) - *** ### toJSON() > **toJSON**(): `object` +Defined in: [src/LayoutManager/LayoutManager.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L353) + #### Returns `object` @@ -101,16 +101,14 @@ title: "LayoutManager" > **type**: `string` = `LAYOUT_MANAGER` -#### Defined in - -[src/LayoutManager/LayoutManager.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L353) - *** ### toObject() > **toObject**(): `object` +Defined in: [src/LayoutManager/LayoutManager.ts:346](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L346) + #### Returns `object` @@ -123,24 +121,20 @@ title: "LayoutManager" > **type**: `string` = `LAYOUT_MANAGER` -#### Defined in - -[src/LayoutManager/LayoutManager.ts:346](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L346) - *** ### unsubscribeTargets() > **unsubscribeTargets**(`context`): `void` +Defined in: [src/LayoutManager/LayoutManager.ts:150](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L150) + #### Parameters -• **context**: [`RegistrationContext`](/api/type-aliases/registrationcontext/) & `Partial`\<[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)\> +##### context + +[`RegistrationContext`](/api/type-aliases/registrationcontext/) & `Partial`\<[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/)\> #### Returns `void` - -#### Defined in - -[src/LayoutManager/LayoutManager.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L150) diff --git a/src/content/docs/api/classes/LayoutStrategy.md b/src/content/docs/api/classes/LayoutStrategy.md index 29e1c2d84..e33d35126 100644 --- a/src/content/docs/api/classes/LayoutStrategy.md +++ b/src/content/docs/api/classes/LayoutStrategy.md @@ -5,7 +5,9 @@ prev: false title: "LayoutStrategy" --- -Exposes a main public method [calcLayoutResult](../../../../api/classes/layoutstrategy/#calclayoutresult) that is used by the `LayoutManager` to perform layout. +Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L21) + +Exposes a main public method [calcLayoutResult](/api/classes/layoutstrategy/#calclayoutresult) that is used by the `LayoutManager` to perform layout. Returning `undefined` signals the `LayoutManager` to skip the layout. In charge of calculating the bounding box of the passed objects. @@ -18,13 +20,13 @@ In charge of calculating the bounding box of the passed objects. ## Constructors -### new LayoutStrategy() +### Constructor -> **new LayoutStrategy**(): [`LayoutStrategy`](/api/classes/layoutstrategy/) +> **new LayoutStrategy**(): `LayoutStrategy` #### Returns -[`LayoutStrategy`](/api/classes/layoutstrategy/) +`LayoutStrategy` ## Properties @@ -32,11 +34,9 @@ In charge of calculating the bounding box of the passed objects. > `static` **type**: `string` = `'strategy'` -override by subclass for persistence (TS does not support `static abstract`) - -#### Defined in +Defined in: [src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L25) -[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L25) +override by subclass for persistence (TS does not support `static abstract`) ## Methods @@ -44,21 +44,23 @@ override by subclass for persistence (TS does not support `static abstract`) > **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 -• **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] -#### Returns +##### context -`undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/) +[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) -#### Defined in +#### Returns -[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L68) +`undefined` \| [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/) *** @@ -66,15 +68,21 @@ Override this method to customize layout. > **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 @@ -82,29 +90,27 @@ the condition to not calc should be evaluated by the layoutManager. layout result **OR** `undefined` to skip layout -#### 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 -• **result**: `Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\> +[`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) & [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` -#### Returns +##### result -[`Point`](/api/classes/point/) +`Pick`\<[`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/), `"center"` \| `"size"`\> -#### Defined in +#### Returns -[src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts#L58) +[`Point`](/api/classes/point/) *** @@ -112,32 +118,32 @@ layout result **OR** `undefined` to skip layout > **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 `undefined` \| `boolean` -#### 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 `boolean` - -#### 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/Line.md b/src/content/docs/api/classes/Line.md index ddc1dfea0..cef28508d 100644 --- a/src/content/docs/api/classes/Line.md +++ b/src/content/docs/api/classes/Line.md @@ -5,87 +5,16 @@ prev: false title: "Line" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Line.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L36) -## Tutorial +A Class to draw a line +A bunch of methods will be added to Polyline to handle the line case +The line class is very strange to work with, is all special, it hardly aligns +to what a developer want everytime there is an angle -[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 +:::caution[Deprecated] +This API is no longer supported and may be removed in a future release. +::: ## Extends @@ -93,11 +22,17 @@ drop ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> + +### SProps -• **SProps** *extends* [`SerializedLineProps`](/api/interfaces/serializedlineprops/) = [`SerializedLineProps`](/api/interfaces/serializedlineprops/) +`SProps` *extends* [`SerializedLineProps`](/api/interfaces/serializedlineprops/) = [`SerializedLineProps`](/api/interfaces/serializedlineprops/) -• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) +### EventSpec + +`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) ## Implements @@ -105,42 +40,46 @@ drop ## Constructors -### new Line() +### Constructor + +> **new Line**\<`Props`, `SProps`, `EventSpec`\>(`points?`, `options?`): `Line`\<`Props`, `SProps`, `EventSpec`\> -> **new Line**\<`Props`, `SProps`, `EventSpec`\>(`points`?, `options`?): [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +Defined in: [src/shapes/Line.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L77) Constructor #### Parameters -• **points?**: [`number`, `number`, `number`, `number`] = `...` +##### points? + +\[`number`, `number`, `number`, `number`\] = `...` Array of points -• **options?**: `Partial`\<`Props`\> = `{}` +##### options? + +`Partial`\<`Props`\> = `{}` Options object #### Returns -[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +`Line`\<`Props`, `SProps`, `EventSpec`\> thisArg #### Overrides -[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors) - -#### Defined in - -[src/shapes/Line.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L74) +[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor) ## Properties -### \_\_corner? +### ~~\_\_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 @@ -151,16 +90,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~~ > **\_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 @@ -169,16 +106,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? +### ~~\_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. @@ -193,37 +128,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/line/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/line/#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~~ > **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 @@ -241,16 +153,33 @@ false [`FabricObject`](/api/classes/fabricobject/).[`absolutePositioned`](/api/classes/fabricobject/#absolutepositioned) -#### Defined in +*** + +### ~~aCoords~~ + +> **aCoords**: [`TCornerPoint`](/api/type-aliases/tcornerpoint/) -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +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/line/#setcoords). +You can calculate them without updating with [()](/api/classes/line/#calcacoords) + +#### Inherited from + +[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords) *** -### angle +### ~~angle~~ > **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 @@ -263,39 +192,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~~ > **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~~ > **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 @@ -308,16 +227,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~~ > **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 @@ -328,16 +245,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~~ > **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 @@ -350,20 +265,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~~ > **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 @@ -375,16 +289,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~~ > **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,26 +307,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~~ > **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. @@ -422,26 +326,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? +### ~~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. @@ -451,16 +347,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? +### ~~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. @@ -468,16 +362,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~~ > **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 @@ -485,16 +377,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~~ > **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 @@ -507,16 +397,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~~ > **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 @@ -533,16 +421,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~~ > **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 @@ -555,16 +441,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~~ > **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 @@ -581,20 +465,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 @@ -605,24 +491,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) - *** -### dirty +### ~~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 @@ -636,64 +516,46 @@ 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~~ > **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~~ > **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~~ > **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/ @@ -707,16 +569,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~~ > **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) @@ -731,16 +591,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~~ > **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 @@ -753,16 +611,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~~ > **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 @@ -775,60 +631,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**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/Object.ts:201](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L201) -#### Default - -```ts - -``` +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~~ > **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~~ > **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 @@ -841,38 +679,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~~ > **height**: `number` -Object height +Defined in: [src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L566) -#### Default - -```ts - -``` +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~~ > **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 @@ -885,38 +713,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~~ > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization +Defined in: [src/shapes/Object/Object.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L208) -#### Default - -```ts - -``` +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~~ > **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 @@ -931,16 +749,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? +### ~~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. @@ -948,19 +764,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~~ > **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 @@ -972,208 +786,140 @@ 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~~ > **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 [`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~~ > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked +Defined in: [src/shapes/Object/InteractiveObject.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L57) -#### Default - -```ts - -``` +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~~ > **lockRotation**: `boolean` -When `true`, object rotation is locked +Defined in: [src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L58) -#### Default - -```ts - -``` +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~~ > **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~~ > **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~~ > **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 [`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~~ > **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~~ > **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? +### ~~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~~ > **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 @@ -1186,16 +932,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~~ > **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 @@ -1208,16 +952,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~~ > **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. @@ -1234,35 +976,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~~ > **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 @@ -1281,16 +1002,31 @@ 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) *** -### opacity +### ~~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 @@ -1303,16 +1039,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 ::: @@ -1321,16 +1055,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 ::: @@ -1339,32 +1071,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? +### ~~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~~ > **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 @@ -1377,38 +1105,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~~ > **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? +### ~~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 @@ -1416,38 +1134,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~~ > **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) - *** -### scaleX +### ~~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 @@ -1460,16 +1168,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~~ > **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 @@ -1482,48 +1188,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~~ > **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. ::: @@ -1532,16 +1222,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~~ > **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 @@ -1554,16 +1242,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~~ > **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 @@ -1576,16 +1262,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~~ > **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 @@ -1598,32 +1282,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? +### ~~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? +### ~~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. @@ -1631,16 +1311,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~~ > **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/ @@ -1654,16 +1332,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~~ > **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 @@ -1676,16 +1352,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~~ > **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 @@ -1698,16 +1372,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~~ > **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 @@ -1720,38 +1392,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~~ > **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~~ > **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 @@ -1764,16 +1426,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~~ > **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 @@ -1799,16 +1459,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~~ > **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 @@ -1821,19 +1479,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~~ > **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 @@ -1845,16 +1501,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~~ > **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 @@ -1867,16 +1521,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~~ > **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 @@ -1889,170 +1541,112 @@ 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~~ > **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~~ > **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) - *** -### x1 +### ~~x1~~ > **x1**: `number` -x value or first line edge - -#### Default - -```ts +Defined in: [src/shapes/Line.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L48) -``` +x value or first line edge #### Implementation of `UniqueLineProps.x1` -#### Defined in - -[src/shapes/Line.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L42) - *** -### x2 +### ~~x2~~ > **x2**: `number` -x value or second line edge - -#### Default - -```ts +Defined in: [src/shapes/Line.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L60) -``` +x value or second line edge #### Implementation of `UniqueLineProps.x2` -#### Defined in - -[src/shapes/Line.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L56) - *** -### y1 +### ~~y1~~ > **y1**: `number` -y value or first line edge - -#### Default - -```ts +Defined in: [src/shapes/Line.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L54) -``` +y value or first line edge #### Implementation of `UniqueLineProps.y1` -#### Defined in - -[src/shapes/Line.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L49) - *** -### y2 +### ~~y2~~ > **y2**: `number` -y value or second line edge - -#### Default - -```ts +Defined in: [src/shapes/Line.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L66) -``` +y value or second line edge #### Implementation of `UniqueLineProps.y2` -#### Defined in - -[src/shapes/Line.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L63) - *** -### ATTRIBUTE\_NAMES +### ~~ATTRIBUTE\_NAMES~~ > `static` **ATTRIBUTE\_NAMES**: `string`[] -List of attribute names to account for when parsing SVG element (used by [Line.fromElement](../../../../api/classes/line/#fromelement)) +Defined in: [src/shapes/Line.ts:238](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L238) -#### Static - -#### Member Of - -Line +List of attribute names to account for when parsing SVG element (used by [Line.fromElement](/api/classes/line/#fromelement)) #### See http://www.w3.org/TR/SVG/shapes.html#LineElement -#### Defined in - -[src/shapes/Line.ts:238](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L238) - *** -### cacheProperties +### ~~cacheProperties~~ > `static` **cacheProperties**: `string`[] +Defined in: [src/shapes/Line.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L70) + 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 @@ -2062,32 +1656,28 @@ and refreshed at the next render [`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties) -#### Defined in - -[src/shapes/Line.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L67) - *** -### colorProperties +### ~~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 +### ~~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 @@ -2095,30 +1685,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 +### ~~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 [`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L138) - *** -### stateProperties +### ~~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 @@ -2127,16 +1713,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 +### ~~type~~ > `static` **type**: `string` = `'Line'` +Defined in: [src/shapes/Line.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L68) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2150,22 +1734,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 +## Accessors -[src/shapes/Line.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L65) +### ~~type~~ -## Accessors +#### Get Signature -### type +> **get** **type**(): `string` -> `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 @@ -2173,39 +1757,53 @@ add sustainable warning message This API is no longer supported and may be removed in a future release. ::: -> `set` **type**(`value`): `void` +##### Returns + +`string` -#### Parameters +#### Set Signature -• **value**: `string` +> **set** **type**(`value`): `void` -#### Returns +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 -### \_drawClipPath() +### ~~\_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 + +`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 @@ -2213,53 +1811,46 @@ Prepare clipPath state and cache and draw it on instance's cache #### Inherited from -[`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) +[`FabricObject`](/api/classes/fabricobject/).[`_drawClipPath`](/api/classes/fabricobject/#_drawclippath) *** -### \_limitCacheSize() +### ~~\_limitCacheSize()~~ + +> **\_limitCacheSize**(`dims`): [`TSize`](/api/type-aliases/tsize/) & `object` & `object` -> **\_limitCacheSize**(`dims`): `any` +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()~~ > **\_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 @@ -2270,26 +1861,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()~~ -> **\_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 @@ -2305,19 +1898,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()~~ > **\_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 @@ -2327,21 +1920,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()~~ > **\_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`\<[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2351,21 +1946,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()~~ > **\_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`\<[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +##### decl + +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2375,22 +1972,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()~~ > **\_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 @@ -2402,16 +1999,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()~~ > **\_toSVG**(): `string`[] +Defined in: [src/shapes/Line.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L225) + Returns svg representation of an instance #### Returns @@ -2425,19 +2020,19 @@ of the instance [`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg) -#### Defined in - -[src/shapes/Line.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L223) - *** -### addPaintOrder() +### ~~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 @@ -2447,33 +2042,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()~~ -> **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 @@ -2482,24 +2081,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()~~ > **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. @@ -2511,16 +2108,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()~~ > **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 @@ -2534,16 +2129,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()~~ > **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 @@ -2557,22 +2150,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()~~ -> **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. @@ -2587,21 +2180,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()~~ > **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 @@ -2613,15 +2206,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()~~ -> **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. @@ -2630,7 +2221,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. @@ -2649,41 +2242,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()~~ + +> **clone**(`propertiesToInclude?`): `Promise`\<`Line`\<`Props`, `SProps`, `EventSpec`\>\> -> **clone**(`propertiesToInclude`?): `Promise`\<[`Line`](/api/classes/line/)\<`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`\<[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Line`\<`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()~~ -> **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. @@ -2694,13 +2285,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. @@ -2712,16 +2305,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()~~ > **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 @@ -2734,21 +2325,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()~~ > **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 @@ -2762,16 +2353,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()~~ > **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` @@ -2783,15 +2372,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()~~ + +> **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 @@ -2799,15 +2386,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 @@ -2819,23 +2412,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()~~ > **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 @@ -2847,27 +2442,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()~~ > **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 @@ -2877,16 +2476,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()~~ > **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 @@ -2896,11 +2493,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 @@ -2912,27 +2513,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()~~ > **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 @@ -2944,29 +2547,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()~~ > **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 @@ -2978,16 +2585,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()~~ > **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 @@ -2995,7 +2600,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3013,25 +2620,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()~~ > **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* [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Line`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3043,29 +2652,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()~~ + +> **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 @@ -3077,22 +2690,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()~~ > **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 @@ -3104,21 +2717,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()~~ > **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 @@ -3132,34 +2745,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()~~ -> **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()~~ > **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` @@ -3170,16 +2779,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()~~ > **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. @@ -3193,16 +2800,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()~~ > **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` @@ -3211,16 +2816,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()~~ > **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 @@ -3231,16 +2834,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()~~ > **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/)[] @@ -3251,16 +2852,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()~~ > **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 @@ -3271,16 +2870,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()~~ > **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 @@ -3291,16 +2888,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()~~ > **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 @@ -3310,11 +2905,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' @@ -3326,16 +2925,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()~~ > **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 @@ -3346,78 +2943,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()~~ > **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/line/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/line/#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()~~ > **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()~~ > **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/line/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/line/#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()~~ > **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 @@ -3434,16 +3023,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()~~ > **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 @@ -3460,21 +3047,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()~~ > **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 @@ -3484,21 +3071,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()~~ > **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 @@ -3508,23 +3095,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()~~ + +> **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 @@ -3536,25 +3125,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()~~ + +> **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 @@ -3564,16 +3157,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()~~ > **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 @@ -3584,16 +3175,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()~~ > **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 @@ -3606,16 +3195,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()~~ > **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 @@ -3626,83 +3213,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()~~ > **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()~~ > **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()~~ > **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()~~ > **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* [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Line`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3712,15 +3295,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()~~ + +> **hasFill**(): `boolean` -> **hasFill**(): `null` \| `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 @@ -3731,7 +3312,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3743,15 +3324,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()~~ + +> **hasStroke**(): `boolean` -> **hasStroke**(): `null` \| `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 @@ -3762,7 +3341,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3774,21 +3353,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()~~ > **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 @@ -3802,23 +3381,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()~~ > **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 @@ -3828,21 +3409,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()~~ > **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. @@ -3855,21 +3439,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()~~ > **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 @@ -3883,23 +3467,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()~~ > **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 @@ -3909,21 +3495,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()~~ > **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. @@ -3938,22 +3524,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()~~ > **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 @@ -3963,23 +3549,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()~~ > **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* [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Line`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -3993,16 +3581,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()~~ > **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` @@ -4011,16 +3599,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()~~ > **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 @@ -4034,23 +3620,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()~~ > **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 @@ -4060,16 +3648,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()~~ > **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 @@ -4082,41 +3668,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()~~ > **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()~~ > **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 @@ -4132,18 +3728,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()~~ -#### 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 @@ -4154,11 +3748,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') @@ -4170,27 +3768,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 @@ -4202,19 +3804,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}) @@ -4226,14 +3828,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 @@ -4244,33 +3844,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()~~ -#### 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 @@ -4288,106 +3894,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()~~ -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +#### Call Signature -*** +> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction` -### onDeselect() +Defined in: [src/Observable.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L62) -> **onDeselect**(`_options`?): `boolean` +Observes specified event **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 +##### Type Parameters -#### Parameters +###### K -• **\_options?** +`K` *extends* `string` \| `number` \| `symbol` -options sent from the upper functions +###### E -• **\_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/)\> +##### Parameters -#### Returns +###### eventName -`boolean` +`K` -#### Inherited from +Event name (eg. 'after:render') -[`FabricObject`](/api/classes/fabricobject/).[`onDeselect`](/api/classes/fabricobject/#ondeselect) +###### handler -#### Defined in +`TEventCallback`\<`E`\> -[src/shapes/Object/InteractiveObject.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L658) +Function that receives a notification when an event of the specified type occurs -*** +##### Returns -### onDragStart() +`VoidFunction` -> **onDragStart**(`_e`): `boolean` +disposer -Override to customize Drag behavior\ -Fired once a drag session has started +##### Alias -#### Parameters +once -• **\_e**: `DragEvent` +##### Inherited from -#### Returns +[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once) -`boolean` +#### Call Signature -true to handle the drag event +> **once**(`handlers`): `VoidFunction` -#### Inherited from +Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66) -[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart) +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) +[`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 @@ -4395,87 +4035,81 @@ 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) *** -### render() +### ~~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 @@ -4487,21 +4121,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()~~ -> **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 @@ -4511,23 +4147,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()~~ > **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 @@ -4537,16 +4173,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()~~ > **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 @@ -4554,7 +4188,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4564,21 +4200,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()~~ > **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) @@ -4590,21 +4226,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()~~ > **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 @@ -4616,21 +4252,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()~~ > **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 @@ -4642,21 +4278,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()~~ > **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 @@ -4668,111 +4304,113 @@ 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()~~ -> **set**(`key`, `value`?): [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Line`\<`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 -[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +`Line`\<`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 + +[`FabricObject`](/api/classes/fabricobject/).[`setControlsVisibility`](/api/classes/fabricobject/#setcontrolsvisibility) -discuss this overlap of priority here with the team. Andrea Bogazzi for details +*** -#### Inherited from +### ~~setControlVisible()~~ -[`FabricObject`](/api/classes/fabricobject/).[`setControlVisible`](/api/classes/fabricobject/#setcontrolvisible) +> **setControlVisible**(`controlKey`, `visible`): `void` -#### Defined in +Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599) -[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/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) *** -### setCoords() +### ~~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 @@ -4782,16 +4420,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()~~ > **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 @@ -4805,29 +4441,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()~~ > **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' @@ -4839,22 +4479,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()~~ > **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/line/#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/line/#setx) #### Returns @@ -4864,29 +4504,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()~~ + +> **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/line/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/line/#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' @@ -4898,22 +4542,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()~~ > **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/line/#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/line/#sety) #### Returns @@ -4923,21 +4567,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()~~ > **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 @@ -4947,15 +4591,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()~~ -> **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, @@ -4963,15 +4605,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' @@ -4989,21 +4637,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()~~ > **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 @@ -5013,20 +4661,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()~~ > **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. @@ -5038,22 +4684,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()~~ > **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 @@ -5065,25 +4711,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()~~ > **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 @@ -5095,21 +4743,43 @@ 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` = `{}` + +#### 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) +[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob) *** -### toCanvasElement() +### ~~toCanvasElement()~~ > **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 @@ -5123,23 +4793,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()~~ -> **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. @@ -5153,21 +4825,49 @@ 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) *** -### toDataURL() +### ~~toDataURL()~~ > **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 @@ -5181,44 +4881,40 @@ 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`): `Line`\<`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 +`Line`\<`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) *** -### toJSON() +### ~~toJSON()~~ > **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 @@ -5231,27 +4927,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()~~ + +> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps` -> **toObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps` +Defined in: [src/shapes/Line.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L167) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T + +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Line`\<`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 @@ -5261,105 +4961,75 @@ Any properties that you might want to additionally include in the output object representation of an instance -#### Method - -toObject - #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject) -#### Defined in - -[src/shapes/Line.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L165) - *** -### toSVG() - -> **toSVG**(`this`, `reviver`?): `string` - -Returns svg representation of an instance - -#### Parameters +### ~~toString()~~ -• **this**: `FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **toString**(): `string` -• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/) +Defined in: [src/shapes/Object/Object.ts:1890](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1890) -Method for further parsing of svg representation. +Returns a string representation of an instance #### 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) +[`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring) *** -### toString() - -> **toString**(): `string` - -Returns a string representation of an instance - -#### Returns - -`string` - -#### Inherited from - -[`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring) +### ~~toSVG()~~ -#### Defined in +> **toSVG**(`this`, `reviver?`): `string` -[src/shapes/Object/Object.ts:1924](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1924) +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 -### toggle() +#### Parameters -> **toggle**(`property`): [`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> +##### this -Toggles specified property from `true` to `false` or from `false` to `true` +`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### Parameters +##### reviver? -• **property**: `string` +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -Property to toggle +Method for further parsing of svg representation. #### Returns -[`Line`](/api/classes/line/)\<`Props`, `SProps`, `EventSpec`\> - -#### Inherited from +`string` -[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle) +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) +[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg) *** -### transform() +### ~~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 @@ -5371,19 +5041,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()~~ > **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 @@ -5393,29 +5063,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()~~ > **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' @@ -5427,37 +5101,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()~~ > **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' @@ -5469,29 +5151,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()~~ > **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' @@ -5503,16 +5189,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 @@ -5528,25 +5212,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() +### ~~\_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 @@ -5556,16 +5244,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() +### ~~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 @@ -5574,7 +5260,7 @@ make this function return an empty object and add controls to the ownDefaults `object` -##### controls +##### ~~controls~~ > **controls**: `Record`\<`string`, [`Control`](/api/classes/control/)\> @@ -5582,86 +5268,78 @@ 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() +### ~~fromElement()~~ -> `static` **fromElement**(`element`, `options`?, `cssRules`?): `Promise`\<[`Line`](/api/classes/line/)\<`object`, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Line`\<\{ \}, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Line.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L246) Returns Line instance from an SVG element #### Parameters -• **element**: `HTMLElement` - -Element to parse - -• **options?**: [`Abortable`](/api/type-aliases/abortable/) +##### element -Options object +`HTMLElement` -• **cssRules?**: `CSSRules` +Element to parse -#### Returns +##### options? -`Promise`\<[`Line`](/api/classes/line/)\<`object`, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +[`Abortable`](/api/type-aliases/abortable/) -#### Static +Options object -#### Member Of +##### cssRules? -Line +`CSSRules` -#### Defined in +#### Returns -[src/shapes/Line.ts:248](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L248) +`Promise`\<`Line`\<\{ \}, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> *** -### fromObject() +### ~~fromObject()~~ + +> `static` **fromObject**\<`T`\>(`object`): `Promise`\<`Line`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> -> `static` **fromObject**\<`T`\>(`object`): `Promise`\<[`Line`](/api/classes/line/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +Defined in: [src/shapes/Line.ts:268](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L268) Returns Line instance from an object representation #### Type Parameters -• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedLineProps`](/api/interfaces/serializedlineprops/)\> +##### T + +`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedLineProps`](/api/interfaces/serializedlineprops/)\> #### Parameters -• **object**: `T` +##### object + +`T` Object to create an instance from #### Returns -`Promise`\<[`Line`](/api/classes/line/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> - -#### Static - -#### Member Of - -Line +`Promise`\<`Line`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedLineProps`](/api/interfaces/serializedlineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject) -#### Defined in - -[src/shapes/Line.ts:272](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L272) - *** -### getDefaults() +### ~~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`\> @@ -5669,7 +5347,3 @@ Line #### Inherited from [`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#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/Observable.md b/src/content/docs/api/classes/Observable.md index 46f4e1034..dfb63106a 100644 --- a/src/content/docs/api/classes/Observable.md +++ b/src/content/docs/api/classes/Observable.md @@ -5,47 +5,56 @@ prev: false title: "Observable" --- -## Tutorial - -[http://fabricjs.com/fabric-intro-part-2#events](http://fabricjs.com/fabric-intro-part-2#events) +Defined in: [src/Observable.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L11) ## See -[demo](http://fabricjs.com/events|Events) + - [http://fabric5.fabricjs.com/fabric-intro-part-2#events](http://fabric5.fabricjs.com/fabric-intro-part-2#events) + - [demo](http://fabric5.fabricjs.com/events|Events) ## Type Parameters -• **EventSpec** +### EventSpec + +`EventSpec` ## Constructors -### new Observable() +### Constructor -> **new Observable**\<`EventSpec`\>(): [`Observable`](/api/classes/observable/)\<`EventSpec`\> +> **new Observable**\<`EventSpec`\>(): `Observable`\<`EventSpec`\> #### Returns -[`Observable`](/api/classes/observable/)\<`EventSpec`\> +`Observable`\<`EventSpec`\> ## Methods ### 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 @@ -53,18 +62,16 @@ Options object `void` -#### Defined in - -[src/Observable.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L167) - *** ### 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 @@ -75,11 +82,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') @@ -87,27 +98,31 @@ event name (eg. 'after:render') `void` -##### 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 @@ -115,19 +130,19 @@ event listener to unsubscribe `void` -##### 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}) @@ -135,47 +150,51 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han `void` -##### 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 `void` -##### 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 @@ -189,49 +208,65 @@ disposer 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` -##### Defined in +disposer -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +##### Alias + +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 -• **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 @@ -245,22 +280,28 @@ disposer 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` -##### Defined in +disposer + +##### Alias -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +once diff --git a/src/content/docs/api/classes/Path.md b/src/content/docs/api/classes/Path.md index 9cd03bbb6..30860e8a8 100644 --- a/src/content/docs/api/classes/Path.md +++ b/src/content/docs/api/classes/Path.md @@ -5,87 +5,9 @@ prev: false title: "Path" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Path.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L49) -## 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,43 +15,51 @@ drop ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`PathProps`](/api/interfaces/pathprops/)\> = `Partial`\<[`PathProps`](/api/interfaces/pathprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`PathProps`](/api/interfaces/pathprops/)\> = `Partial`\<[`PathProps`](/api/interfaces/pathprops/)\> -• **SProps** *extends* [`SerializedPathProps`](/api/interfaces/serializedpathprops/) = [`SerializedPathProps`](/api/interfaces/serializedpathprops/) +### SProps -• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) +`SProps` *extends* [`SerializedPathProps`](/api/interfaces/serializedpathprops/) = [`SerializedPathProps`](/api/interfaces/serializedpathprops/) + +### EventSpec + +`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) ## Constructors -### new Path() +### Constructor -> **new Path**\<`Props`, `SProps`, `EventSpec`\>(`path`, `options`?): [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +> **new Path**\<`Props`, `SProps`, `EventSpec`\>(`path`, `options?`): `Path`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/Path.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L76) Constructor #### Parameters -• **path**: `string` \| [`TComplexPathData`](/api/namespaces/util/type-aliases/tcomplexpathdata/) +##### path Path data (sequence of coordinates and corresponding "command" tokens) -• **options?**: `Partial`\<`Props`\> = `{}` +`string` | [`TComplexPathData`](/api/type-aliases/tcomplexpathdata/) + +##### options? + +`Partial`\<`Props`\> = `{}` Options object #### Returns -[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +`Path`\<`Props`, `SProps`, `EventSpec`\> thisArg #### Overrides -[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors) - -#### Defined in - -[src/shapes/Path.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L77) +[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor) ## Properties @@ -137,6 +67,8 @@ thisArg > `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 @@ -147,16 +79,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 @@ -165,16 +95,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. @@ -189,37 +117,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/path/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/path/#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 @@ -237,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) -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +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/path/#setcoords). +You can calculate them without updating with [()](/api/classes/path/#calcacoords) + +#### Inherited from + +[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords) *** @@ -247,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 @@ -259,39 +181,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 @@ -304,16 +216,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 @@ -324,16 +234,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 @@ -346,20 +254,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 @@ -371,16 +278,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 @@ -391,26 +296,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. @@ -418,26 +315,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. @@ -447,16 +336,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. @@ -464,16 +351,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 @@ -481,16 +366,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 @@ -503,16 +386,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 @@ -529,16 +410,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 @@ -551,16 +430,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 @@ -577,20 +454,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 @@ -601,24 +480,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) - *** ### 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 @@ -632,64 +505,46 @@ 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 #### 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/ @@ -703,16 +558,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) @@ -727,16 +580,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 @@ -749,16 +600,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 @@ -771,60 +620,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 @@ -837,38 +668,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 @@ -881,38 +702,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 @@ -927,16 +738,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. @@ -944,19 +753,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 @@ -968,208 +775,140 @@ 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 #### 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) - *** ### 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 [`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 @@ -1182,16 +921,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 @@ -1204,16 +941,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. @@ -1230,35 +965,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 @@ -1277,9 +991,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) *** @@ -1287,6 +1014,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 @@ -1299,16 +1028,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 ::: @@ -1317,16 +1044,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 ::: @@ -1335,32 +1060,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 @@ -1373,38 +1094,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 @@ -1412,27 +1123,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) - *** ### path -> **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -Array of path points - -#### Default - -```ts - -``` +> **path**: [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) -#### Defined in +Defined in: [src/shapes/Path.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L58) -[src/shapes/Path.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L59) +Array of path points *** @@ -1440,9 +1139,7 @@ Array of path points > **pathOffset**: [`Point`](/api/classes/point/) -#### Defined in - -[src/shapes/Path.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L61) +Defined in: [src/shapes/Path.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L60) *** @@ -1450,28 +1147,22 @@ Array of path points > **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) - *** ### 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 @@ -1484,16 +1175,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 @@ -1506,19 +1195,13 @@ 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) - *** ### segmentsInfo? -> `optional` **segmentsInfo**: [`TPathSegmentInfo`](/api/namespaces/util/type-aliases/tpathsegmentinfo/)[] +> `optional` **segmentsInfo**: [`TPathSegmentInfo`](/api/type-aliases/tpathsegmentinfo/)[] -#### Defined in - -[src/shapes/Path.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L65) +Defined in: [src/shapes/Path.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L64) *** @@ -1526,38 +1209,26 @@ 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 - -``` - #### 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. ::: @@ -1566,16 +1237,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 @@ -1588,16 +1257,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 @@ -1610,16 +1277,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 @@ -1632,32 +1297,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. @@ -1665,19 +1326,13 @@ 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) - *** ### sourcePath? > `optional` **sourcePath**: `string` -#### Defined in - -[src/shapes/Path.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L63) +Defined in: [src/shapes/Path.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L62) *** @@ -1685,6 +1340,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/ @@ -1698,16 +1355,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 @@ -1720,16 +1375,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 @@ -1742,16 +1395,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 @@ -1764,38 +1415,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 @@ -1808,16 +1449,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 @@ -1843,16 +1482,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 @@ -1865,19 +1502,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 @@ -1889,16 +1524,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 @@ -1911,16 +1544,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 @@ -1933,82 +1564,56 @@ 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 `Path.fromElement`) - -#### Static +Defined in: [src/shapes/Path.ts:373](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L373) -#### Member Of - -Path +List of attribute names to account for when parsing SVG element (used by `Path.fromElement`) #### See http://www.w3.org/TR/SVG/paths.html#PathElement -#### Defined in - -[src/shapes/Path.ts:376](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L376) - *** ### cacheProperties > `static` **cacheProperties**: `string`[] +Defined in: [src/shapes/Path.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L68) + 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 @@ -2018,32 +1623,28 @@ and refreshed at the next render [`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties) -#### Defined in - -[src/shapes/Path.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L69) - -*** +*** ### 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 @@ -2051,30 +1652,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/)\<[`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 [`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#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 @@ -2083,16 +1680,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` = `'Path'` +Defined in: [src/shapes/Path.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L66) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2106,22 +1701,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/Path.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L67) - ## 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 @@ -2129,23 +1724,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 @@ -2153,29 +1754,35 @@ This API is no longer supported and may be removed in a future release. > **\_calcBoundsFromPath**(): [`TBBox`](/api/type-aliases/tbbox/) +Defined in: [src/shapes/Path.ts:286](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L286) + #### Returns [`TBBox`](/api/type-aliases/tbbox/) -#### Defined in - -[src/shapes/Path.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L287) - *** ### \_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 + +`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 @@ -2185,51 +1792,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 @@ -2240,26 +1840,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 @@ -2275,19 +1877,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 @@ -2297,21 +1899,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`\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2321,21 +1925,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`\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2345,22 +1951,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 @@ -2372,16 +1978,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/Path.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L216) + Returns svg representation of an instance #### Returns @@ -2395,19 +1999,19 @@ of the instance [`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg) -#### Defined in - -[src/shapes/Path.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L217) - *** ### 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 @@ -2417,33 +2021,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 @@ -2452,24 +2060,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. @@ -2481,16 +2087,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 @@ -2504,16 +2108,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 @@ -2527,22 +2129,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. @@ -2557,21 +2159,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 @@ -2583,15 +2185,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. @@ -2600,7 +2200,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. @@ -2619,41 +2221,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`\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Path`\<`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`\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Path`\<`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. @@ -2664,13 +2264,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. @@ -2682,16 +2284,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/Path.ts:270](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L270) + Returns number representation of an instance complexity #### Returns @@ -2704,21 +2304,21 @@ complexity of this instance [`FabricObject`](/api/classes/fabricobject/).[`complexity`](/api/classes/fabricobject/#complexity) -#### Defined in - -[src/shapes/Path.ts:271](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L271) - *** ### 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 @@ -2732,16 +2332,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` @@ -2753,15 +2351,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 @@ -2769,15 +2365,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 @@ -2789,23 +2391,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 @@ -2817,27 +2421,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 @@ -2847,16 +2455,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 @@ -2866,11 +2472,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 @@ -2882,27 +2492,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 @@ -2914,29 +2526,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 @@ -2948,16 +2564,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 @@ -2965,7 +2579,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -2983,25 +2599,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* [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Path`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3013,29 +2631,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 @@ -3047,22 +2669,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 @@ -3074,21 +2696,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 @@ -3102,34 +2724,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` @@ -3140,16 +2758,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. @@ -3163,16 +2779,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` @@ -3181,16 +2795,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 @@ -3201,16 +2813,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/)[] @@ -3221,16 +2831,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 @@ -3241,16 +2849,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 @@ -3261,16 +2867,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 @@ -3280,11 +2884,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' @@ -3296,16 +2904,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 @@ -3316,78 +2922,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/path/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/path/#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/path/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/path/#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 @@ -3404,16 +3002,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 @@ -3430,21 +3026,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 @@ -3454,21 +3050,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 @@ -3478,23 +3074,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?**: `boolean` +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -3506,27 +3104,31 @@ 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? -#### Returns +`boolean` + +##### additionalTransform? + +`string` = `''` + +#### Returns `string` @@ -3534,16 +3136,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 @@ -3554,16 +3154,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 @@ -3576,16 +3174,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 @@ -3596,83 +3192,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* [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Path`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3682,15 +3274,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 @@ -3701,7 +3291,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3713,15 +3303,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 @@ -3732,7 +3320,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3744,21 +3332,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 @@ -3772,23 +3360,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 @@ -3798,21 +3388,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. @@ -3825,21 +3418,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 @@ -3853,23 +3446,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 @@ -3879,21 +3474,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. @@ -3908,22 +3503,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 @@ -3933,23 +3528,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* [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Path`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -3963,16 +3560,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` @@ -3981,16 +3578,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 @@ -4004,23 +3599,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 @@ -4030,16 +3627,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 @@ -4052,41 +3647,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 @@ -4102,18 +3707,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 @@ -4124,11 +3727,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') @@ -4140,27 +3747,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 @@ -4172,19 +3783,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}) @@ -4196,14 +3807,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 @@ -4214,33 +3823,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 @@ -4258,106 +3873,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`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) + +##### Returns + +`VoidFunction` + +disposer + +##### Alias -#### Defined in +once -[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691) +##### 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 @@ -4365,75 +4014,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) *** @@ -4441,11 +4080,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 @@ -4457,21 +4100,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 @@ -4481,23 +4126,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 @@ -4507,16 +4152,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 @@ -4524,7 +4167,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4534,21 +4179,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) @@ -4560,21 +4205,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 @@ -4586,21 +4231,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 @@ -4612,21 +4257,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 @@ -4638,120 +4283,120 @@ 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`?): [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Path`\<`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 -[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +`Path`\<`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) - *** ### setBoundingBox() -> **setBoundingBox**(`adjustPosition`?): `void` +> **setBoundingBox**(`adjustPosition?`): `void` + +Defined in: [src/shapes/Path.ts:278](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L278) #### Parameters -• **adjustPosition?**: `boolean` +##### adjustPosition? + +`boolean` #### Returns `void` -#### Defined in - -[src/shapes/Path.ts:279](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L279) - *** -### 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` + +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) *** @@ -4759,8 +4404,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 @@ -4770,30 +4417,26 @@ 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) - *** ### setDimensions() > **setDimensions**(): `void` +Defined in: [src/shapes/Path.ts:274](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L274) + #### Returns `void` -#### Defined in - -[src/shapes/Path.ts:275](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L275) - *** ### 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 @@ -4807,29 +4450,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' @@ -4841,22 +4488,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 + +`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/path/#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/path/#setx) #### Returns @@ -4866,29 +4513,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/path/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/path/#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' @@ -4900,22 +4551,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/path/#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/path/#sety) #### Returns @@ -4925,21 +4576,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 @@ -4949,15 +4600,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, @@ -4965,15 +4614,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' @@ -4991,21 +4646,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 @@ -5015,20 +4670,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. @@ -5040,22 +4693,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 @@ -5067,25 +4720,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 @@ -5097,9 +4752,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) *** @@ -5107,11 +4780,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 @@ -5125,21 +4802,21 @@ 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**(`reviver`?): `string` +> **toClipPathSVG**(`reviver?`): `string` + +Defined in: [src/shapes/Path.ts:242](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L242) 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. @@ -5153,9 +4830,43 @@ svg representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toClipPathSVG`](/api/classes/fabricobject/#toclippathsvg) -#### Defined in +*** + +### toDatalessObject() + +> **toDatalessObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & `SProps` -[src/shapes/Path.ts:243](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L243) +Defined in: [src/shapes/Path.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L199) + +Returns dataless object representation of an instance + +#### Type Parameters + +##### T + +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Path`\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> + +##### K + +`K` *extends* `string` \| `number` \| `symbol` = `never` + +#### Parameters + +##### propertiesToInclude? + +`K`[] = `[]` + +Any properties that you might want to additionally include in the output + +#### Returns + +`Pick`\<`T`, `K`\> & `SProps` + +object representation of an instance + +#### Overrides + +[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject) *** @@ -5163,11 +4874,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 @@ -5181,43 +4896,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() - -> **toDatalessObject**\<`T`, `K`\>(`propertiesToInclude`?): `Pick`\<`T`, `K`\> & `SProps` - -Returns dataless object representation of an instance +### toggle() -#### Type Parameters +> **toggle**(`property`): `Path`\<`Props`, `SProps`, `EventSpec`\> -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +Defined in: [src/CommonMethods.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L46) -• **K** *extends* `string` \| `number` \| `symbol` = `never` +Toggles specified property from `true` to `false` or from `false` to `true` #### Parameters -• **propertiesToInclude?**: `K`[] = `[]` - -Any properties that you might want to additionally include in the output - -#### Returns +##### property -`Pick`\<`T`, `K`\> & `SProps` +`string` -object representation of an instance +Property to toggle -#### Overrides +#### Returns -[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject) +`Path`\<`Props`, `SProps`, `EventSpec`\> -#### Defined in +#### Inherited from -[src/shapes/Path.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L200) +[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle) *** @@ -5225,6 +4928,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 @@ -5237,27 +4942,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/Path.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L184) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T -• **K** *extends* `string` \| `number` \| `symbol` = `never` +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Path`\<`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 @@ -5271,44 +4980,14 @@ object representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject) -#### Defined in - -[src/shapes/Path.ts:185](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L185) - -*** - -### toSVG() - -> **toSVG**(`reviver`?): `string` - -Returns svg representation of an instance - -#### Parameters - -• **reviver?**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/) - -Method for further parsing of svg representation. - -#### Returns - -`string` - -svg representation of an instance - -#### Overrides - -[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg) - -#### Defined in - -[src/shapes/Path.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L259) - *** ### toString() > **toString**(): `string` +Defined in: [src/shapes/Path.ts:173](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L173) + Returns string representation of an instance #### Returns @@ -5321,35 +5000,33 @@ string representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toString`](/api/classes/fabricobject/#tostring) -#### Defined in - -[src/shapes/Path.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L174) - *** -### toggle() +### toSVG() -> **toggle**(`property`): [`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +> **toSVG**(`reviver?`): `string` -Toggles specified property from `true` to `false` or from `false` to `true` +Defined in: [src/shapes/Path.ts:258](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L258) + +Returns svg representation of an instance #### Parameters -• **property**: `string` +##### reviver? -Property to toggle +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -#### Returns +Method for further parsing of svg representation. -[`Path`](/api/classes/path/)\<`Props`, `SProps`, `EventSpec`\> +#### Returns -#### Inherited from +`string` -[`FabricObject`](/api/classes/fabricobject/).[`toggle`](/api/classes/fabricobject/#toggle) +svg representation of an instance -#### Defined in +#### Overrides -[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) *** @@ -5357,11 +5034,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 @@ -5373,19 +5054,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 @@ -5395,29 +5076,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' @@ -5429,37 +5114,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' @@ -5471,29 +5164,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' @@ -5505,16 +5202,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 @@ -5530,25 +5225,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 @@ -5558,16 +5257,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 @@ -5584,84 +5281,76 @@ 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`\<[`Path`](/api/classes/path/)\<`object`, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Path`\<\{ `absolutePositioned`: `boolean`; `angle`: [`TDegree`](/api/type-aliases/tdegree/); `backgroundColor`: `string`; `borderColor`: `string`; `borderDashArray`: `null` \| `number`[]; `borderOpacityWhenMoving`: `number`; `borderScaleFactor`: `number`; `canvas`: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; `centeredRotation`: `boolean`; `centeredScaling`: `boolean`; `clipPath`: [`BaseFabricObject`](/api/classes/basefabricobject/); `cornerColor`: `string`; `cornerDashArray`: `null` \| `number`[]; `cornerSize`: `number`; `cornerStrokeColor`: `string`; `cornerStyle`: `"circle"` \| `"rect"`; `evented`: `boolean`; `excludeFromExport`: `boolean`; `fill`: `null` \| `string` \| [`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\> \| [`Pattern`](/api/classes/pattern/); `fillRule`: `"evenodd"` \| `"nonzero"`; `flipX`: `boolean`; `flipY`: `boolean`; `globalCompositeOperation`: `"color"` \| `"color-burn"` \| `"color-dodge"` \| `"copy"` \| `"darken"` \| `"destination-atop"` \| `"destination-in"` \| `"destination-out"` \| `"destination-over"` \| `"difference"` \| `"exclusion"` \| `"hard-light"` \| `"hue"` \| `"lighten"` \| `"lighter"` \| `"luminosity"` \| `"multiply"` \| `"overlay"` \| `"saturation"` \| `"screen"` \| `"soft-light"` \| `"source-atop"` \| `"source-in"` \| `"source-out"` \| `"source-over"` \| `"xor"`; `hasBorders`: `boolean`; `hasControls`: `boolean`; `height`: `number`; `hoverCursor`: `null` \| `string`; `includeDefaultValues`: `boolean`; `inverted`: `boolean`; `left`: `undefined`; `lockMovementX`: `boolean`; `lockMovementY`: `boolean`; `lockRotation`: `boolean`; `lockScalingFlip`: `boolean`; `lockScalingX`: `boolean`; `lockScalingY`: `boolean`; `lockSkewingX`: `boolean`; `lockSkewingY`: `boolean`; `minScaleLimit`: `number`; `moveCursor`: `null` \| `string`; `noScaleCache`: `boolean`; `objectCaching`: `boolean`; `opacity`: `number`; `originX`: `number` \| `"center"` \| `"left"` \| `"right"`; `originY`: `number` \| `"center"` \| `"top"` \| `"bottom"`; `padding`: `number`; `paintFirst`: `"fill"` \| `"stroke"`; `path`: [`TSimplePathData`](/api/type-aliases/tsimplepathdata/); `perPixelTargetFind`: `boolean`; `scaleX`: `number`; `scaleY`: `number`; `selectable`: `boolean`; `selectionBackgroundColor`: `string`; `shadow`: `null` \| [`Shadow`](/api/classes/shadow/); `skewX`: [`TDegree`](/api/type-aliases/tdegree/); `skewY`: [`TDegree`](/api/type-aliases/tdegree/); `snapAngle`: [`TDegree`](/api/type-aliases/tdegree/); `snapThreshold`: [`TDegree`](/api/type-aliases/tdegree/); `sourcePath`: `string`; `stroke`: `null` \| `string` \| [`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\> \| [`Pattern`](/api/classes/pattern/); `strokeDashArray`: `null` \| `number`[]; `strokeDashOffset`: `number`; `strokeLineCap`: `"square"` \| `"butt"` \| `"round"`; `strokeLineJoin`: `"round"` \| `"bevel"` \| `"miter"`; `strokeMiterLimit`: `number`; `strokeUniform`: `boolean`; `strokeWidth`: `number`; `top`: `undefined`; `touchCornerSize`: `number`; `transparentCorners`: `boolean`; `visible`: `boolean`; `width`: `number`; \}, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Path.ts:391](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L391) Creates an instance of Path from an SVG element #### Parameters -• **element**: `HTMLElement` +##### element to parse -• **options?**: `Partial`\<[`PathProps`](/api/interfaces/pathprops/)\> - -Options object - -• **cssRules?**: `CSSRules` +`HTMLElement` | `SVGElement` -#### Returns +##### options? -`Promise`\<[`Path`](/api/classes/path/)\<`object`, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\> -#### Static +Options object -#### Member Of +##### cssRules? -Path +`CSSRules` -#### Defined in +#### Returns -[src/shapes/Path.ts:398](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L398) +`Promise`\<`Path`\<\{ `absolutePositioned`: `boolean`; `angle`: [`TDegree`](/api/type-aliases/tdegree/); `backgroundColor`: `string`; `borderColor`: `string`; `borderDashArray`: `null` \| `number`[]; `borderOpacityWhenMoving`: `number`; `borderScaleFactor`: `number`; `canvas`: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\>; `centeredRotation`: `boolean`; `centeredScaling`: `boolean`; `clipPath`: [`BaseFabricObject`](/api/classes/basefabricobject/); `cornerColor`: `string`; `cornerDashArray`: `null` \| `number`[]; `cornerSize`: `number`; `cornerStrokeColor`: `string`; `cornerStyle`: `"circle"` \| `"rect"`; `evented`: `boolean`; `excludeFromExport`: `boolean`; `fill`: `null` \| `string` \| [`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\> \| [`Pattern`](/api/classes/pattern/); `fillRule`: `"evenodd"` \| `"nonzero"`; `flipX`: `boolean`; `flipY`: `boolean`; `globalCompositeOperation`: `"color"` \| `"color-burn"` \| `"color-dodge"` \| `"copy"` \| `"darken"` \| `"destination-atop"` \| `"destination-in"` \| `"destination-out"` \| `"destination-over"` \| `"difference"` \| `"exclusion"` \| `"hard-light"` \| `"hue"` \| `"lighten"` \| `"lighter"` \| `"luminosity"` \| `"multiply"` \| `"overlay"` \| `"saturation"` \| `"screen"` \| `"soft-light"` \| `"source-atop"` \| `"source-in"` \| `"source-out"` \| `"source-over"` \| `"xor"`; `hasBorders`: `boolean`; `hasControls`: `boolean`; `height`: `number`; `hoverCursor`: `null` \| `string`; `includeDefaultValues`: `boolean`; `inverted`: `boolean`; `left`: `undefined`; `lockMovementX`: `boolean`; `lockMovementY`: `boolean`; `lockRotation`: `boolean`; `lockScalingFlip`: `boolean`; `lockScalingX`: `boolean`; `lockScalingY`: `boolean`; `lockSkewingX`: `boolean`; `lockSkewingY`: `boolean`; `minScaleLimit`: `number`; `moveCursor`: `null` \| `string`; `noScaleCache`: `boolean`; `objectCaching`: `boolean`; `opacity`: `number`; `originX`: `number` \| `"center"` \| `"left"` \| `"right"`; `originY`: `number` \| `"center"` \| `"top"` \| `"bottom"`; `padding`: `number`; `paintFirst`: `"fill"` \| `"stroke"`; `path`: [`TSimplePathData`](/api/type-aliases/tsimplepathdata/); `perPixelTargetFind`: `boolean`; `scaleX`: `number`; `scaleY`: `number`; `selectable`: `boolean`; `selectionBackgroundColor`: `string`; `shadow`: `null` \| [`Shadow`](/api/classes/shadow/); `skewX`: [`TDegree`](/api/type-aliases/tdegree/); `skewY`: [`TDegree`](/api/type-aliases/tdegree/); `snapAngle`: [`TDegree`](/api/type-aliases/tdegree/); `snapThreshold`: [`TDegree`](/api/type-aliases/tdegree/); `sourcePath`: `string`; `stroke`: `null` \| `string` \| [`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\> \| [`Pattern`](/api/classes/pattern/); `strokeDashArray`: `null` \| `number`[]; `strokeDashOffset`: `number`; `strokeLineCap`: `"square"` \| `"butt"` \| `"round"`; `strokeLineJoin`: `"round"` \| `"bevel"` \| `"miter"`; `strokeMiterLimit`: `number`; `strokeUniform`: `boolean`; `strokeWidth`: `number`; `top`: `undefined`; `touchCornerSize`: `number`; `transparentCorners`: `boolean`; `visible`: `boolean`; `width`: `number`; \}, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> *** ### fromObject() -> `static` **fromObject**\<`T`\>(`object`): `Promise`\<[`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromObject**\<`T`\>(`object`): `Promise`\<`Path`\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Path.ts:380](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L380) Creates an instance of Path from an object #### Type Parameters -• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPathProps`](/api/interfaces/serializedpathprops/)\> - -#### Parameters +##### T -• **object**: `T` +`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPathProps`](/api/interfaces/serializedpathprops/)\> -#### Returns +#### Parameters -`Promise`\<[`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +##### object -#### Static +`T` -#### Member Of +#### Returns -Path +`Promise`\<`Path`\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject) -#### Defined in - -[src/shapes/Path.ts:385](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L385) - *** ### 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`\> @@ -5669,7 +5358,3 @@ Path #### Inherited from [`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#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/Pattern.md b/src/content/docs/api/classes/Pattern.md index 1bf445f83..225bd84d1 100644 --- a/src/content/docs/api/classes/Pattern.md +++ b/src/content/docs/api/classes/Pattern.md @@ -5,32 +5,34 @@ prev: false title: "Pattern" --- +Defined in: [src/Pattern/Pattern.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L20) + ## See - - [demo](http://fabricjs.com/patterns) - - [demo](http://fabricjs.com/dynamic-patterns) + - [demo](http://fabric5.fabricjs.com/patterns) + - [demo](http://fabric5.fabricjs.com/dynamic-patterns) ## Constructors -### new Pattern() +### Constructor + +> **new Pattern**(`options?`): `Pattern` -> **new Pattern**(`options`?): [`Pattern`](/api/classes/pattern/) +Defined in: [src/Pattern/Pattern.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L91) Constructor #### Parameters -• **options?**: [`PatternOptions`](/api/type-aliases/patternoptions/) +##### options? + +[`PatternOptions`](/api/type-aliases/patternoptions/) Options object #### Returns -[`Pattern`](/api/classes/pattern/) - -#### Defined in - -[src/Pattern/Pattern.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L95) +`Pattern` ## Properties @@ -38,15 +40,7 @@ Options object > **crossOrigin**: [`TCrossOrigin`](/api/type-aliases/tcrossorigin/) = `''` -#### Default - -```ts - -``` - -#### Defined in - -[src/Pattern/Pattern.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L63) +Defined in: [src/Pattern/Pattern.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L60) *** @@ -54,11 +48,9 @@ Options object > `optional` **excludeFromExport**: `boolean` -If true, this object will not be exported during the serialization of a canvas - -#### Defined in +Defined in: [src/Pattern/Pattern.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L78) -[src/Pattern/Pattern.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L82) +If true, this object will not be exported during the serialization of a canvas *** @@ -66,11 +58,9 @@ If true, this object will not be exported during the serialization of a canvas > `readonly` **id**: `number` -ID used for SVG export functionalities - -#### Defined in +Defined in: [src/Pattern/Pattern.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L84) -[src/Pattern/Pattern.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L88) +ID used for SVG export functionalities *** @@ -78,17 +68,9 @@ ID used for SVG export functionalities > **offsetX**: `number` = `0` -Pattern horizontal offset from object's left/top corner - -#### Default - -```ts +Defined in: [src/Pattern/Pattern.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L49) -``` - -#### Defined in - -[src/Pattern/Pattern.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L50) +Pattern horizontal offset from object's left/top corner *** @@ -96,17 +78,9 @@ Pattern horizontal offset from object's left/top corner > **offsetY**: `number` = `0` -Pattern vertical offset from object's left/top corner - -#### Default +Defined in: [src/Pattern/Pattern.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L55) -```ts - -``` - -#### Defined in - -[src/Pattern/Pattern.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L57) +Pattern vertical offset from object's left/top corner *** @@ -114,33 +88,23 @@ Pattern vertical offset from object's left/top corner > `optional` **patternTransform**: [`TMat2D`](/api/type-aliases/tmat2d/) +Defined in: [src/Pattern/Pattern.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L67) + transform matrix to change the pattern, imported from svgs. #### Todo verify if using the identity matrix as default makes the rest of the code more easy -#### Default - -```ts - -``` - -#### Defined in - -[src/Pattern/Pattern.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L71) - *** ### repeat > **repeat**: [`PatternRepeat`](/api/type-aliases/patternrepeat/) = `'repeat'` -#### Defaults - -#### Defined in +Defined in: [src/Pattern/Pattern.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L43) -[src/Pattern/Pattern.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L43) +#### Defaults *** @@ -148,11 +112,9 @@ verify if using the identity matrix as default makes the rest of the code more e > **source**: `CanvasImageSource` -The actual pixel source of the pattern - -#### Defined in +Defined in: [src/Pattern/Pattern.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L72) -[src/Pattern/Pattern.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L76) +The actual pixel source of the pattern *** @@ -160,21 +122,23 @@ The actual pixel source of the pattern > `static` **type**: `string` = `'Pattern'` -#### Defined in - -[src/Pattern/Pattern.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L21) +Defined in: [src/Pattern/Pattern.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L21) ## Accessors ### type -> `get` **type**(): `string` +#### Get Signature + +> **get** **type**(): `string` + +Defined in: [src/Pattern/Pattern.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L31) Legacy identifier of the class. Prefer using this.constructor.type 'Pattern' or utils like isPattern, or instance of to indentify a pattern in your code. Will be removed in future versiones -#### TODO +##### TODO add sustainable warning message @@ -182,51 +146,53 @@ 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/Pattern/Pattern.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L35) + +##### Parameters + +###### value `string` -#### Defined in +##### Returns -[src/Pattern/Pattern.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L31) +`void` ## Methods ### isCanvasSource() -> **isCanvasSource**(): `this is Object` - -#### Returns +> **isCanvasSource**(): `this is { source: HTMLCanvasElement }` -`this is Object` +Defined in: [src/Pattern/Pattern.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L108) -true if [source](/api/api/classes/pattern/source/#source) is a element +#### Returns -#### Defined in +`this is { source: HTMLCanvasElement }` -[src/Pattern/Pattern.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L112) +true if [source](/api/classes/pattern/#source) is a element *** ### isImageSource() -> **isImageSource**(): `this is Object` - -#### Returns +> **isImageSource**(): `this is { source: HTMLImageElement }` -`this is Object` +Defined in: [src/Pattern/Pattern.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L99) -true if [source](/api/api/classes/pattern/source/#source) is an element +#### Returns -#### Defined in +`this is { source: HTMLImageElement }` -[src/Pattern/Pattern.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L103) +true if [source](/api/classes/pattern/#source) is an element *** @@ -234,25 +200,27 @@ true if [source](/api/api/classes/pattern/source/#source) is an element > **sourceToString**(): `string` +Defined in: [src/Pattern/Pattern.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L112) + #### Returns `string` -#### Defined in - -[src/Pattern/Pattern.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L116) - *** ### toLive() > **toLive**(`ctx`): `null` \| `CanvasPattern` +Defined in: [src/Pattern/Pattern.ts:125](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L125) + Returns an instance of CanvasPattern #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to create pattern @@ -260,21 +228,21 @@ Context to create pattern `null` \| `CanvasPattern` -#### Defined in - -[src/Pattern/Pattern.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L129) - *** ### toObject() -> **toObject**(`propertiesToInclude`?): `Record`\<`string`, `any`\> +> **toObject**(`propertiesToInclude?`): `Record`\<`string`, `any`\> + +Defined in: [src/Pattern/Pattern.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L146) Returns object representation of a pattern #### Parameters -• **propertiesToInclude?**: `string`[] = `[]` +##### propertiesToInclude? + +`string`[] = `[]` Any properties that you might want to additionally include in the output @@ -284,46 +252,44 @@ Any properties that you might want to additionally include in the output Object representation of a pattern instance -#### Defined in - -[src/Pattern/Pattern.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L150) - *** ### toSVG() > **toSVG**(`__namedParameters`): `string` +Defined in: [src/Pattern/Pattern.ts:166](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L166) + Returns SVG representation of a pattern #### Parameters -• **\_\_namedParameters**: [`TSize`](/api/type-aliases/tsize/) +##### \_\_namedParameters + +[`TSize`](/api/type-aliases/tsize/) #### Returns `string` -#### Defined in - -[src/Pattern/Pattern.ts:170](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L170) - *** ### fromObject() -> `static` **fromObject**(`__namedParameters`, `options`?): `Promise`\<[`Pattern`](/api/classes/pattern/)\> +> `static` **fromObject**(`__namedParameters`, `options?`): `Promise`\<`Pattern`\> + +Defined in: [src/Pattern/Pattern.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/Pattern.ts#L192) #### Parameters -• **\_\_namedParameters**: [`SerializedPatternOptions`](/api/type-aliases/serializedpatternoptions/) +##### \_\_namedParameters -• **options?**: [`Abortable`](/api/type-aliases/abortable/) +[`SerializedPatternOptions`](/api/type-aliases/serializedpatternoptions/) -#### Returns +##### options? -`Promise`\<[`Pattern`](/api/classes/pattern/)\> +[`Abortable`](/api/type-aliases/abortable/) -#### Defined in +#### Returns -[src/Pattern/Pattern.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/Pattern.ts#L202) +`Promise`\<`Pattern`\> diff --git a/src/content/docs/api/classes/PatternBrush.md b/src/content/docs/api/classes/PatternBrush.md index 8057f7826..690deec00 100644 --- a/src/content/docs/api/classes/PatternBrush.md +++ b/src/content/docs/api/classes/PatternBrush.md @@ -5,9 +5,11 @@ prev: false title: "PatternBrush" --- +Defined in: [src/brushes/PatternBrush.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L7) + ## See -[demo](http://fabricjs.com/freedrawing|Freedrawing) +[demo](http://fabric5.fabricjs.com/freedrawing|Freedrawing) ## Extends @@ -15,25 +17,25 @@ title: "PatternBrush" ## Constructors -### new PatternBrush() +### Constructor + +> **new PatternBrush**(`canvas`): `PatternBrush` -> **new PatternBrush**(`canvas`): [`PatternBrush`](/api/classes/patternbrush/) +Defined in: [src/brushes/PatternBrush.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L10) #### Parameters -• **canvas**: [`Canvas`](/api/classes/canvas/) +##### canvas + +[`Canvas`](/api/classes/canvas/) #### Returns -[`PatternBrush`](/api/classes/patternbrush/) +`PatternBrush` #### Overrides -[`PencilBrush`](/api/classes/pencilbrush/).[`constructor`](/api/classes/pencilbrush/#constructors) - -#### Defined in - -[src/brushes/PatternBrush.ts:10](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L10) +[`PencilBrush`](/api/classes/pencilbrush/).[`constructor`](/api/classes/pencilbrush/#constructor) ## Properties @@ -41,6 +43,8 @@ title: "PatternBrush" > **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 [`PencilBrush`](/api/classes/pencilbrush/).[`canvas`](/api/classes/pencilbrush/#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 +Defined in: [src/brushes/BaseBrush.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L15) -```ts - -``` +Color of a brush #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`color`](/api/classes/pencilbrush/#color) -#### Defined in - -[src/brushes/BaseBrush.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L16) - *** ### decimate > **decimate**: `number` = `0.4` +Defined in: [src/brushes/PencilBrush.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L25) + Discard points that are less than `decimate` pixel distant from each other #### Default @@ -93,16 +87,14 @@ Discard points that are less than `decimate` pixel distant from each other [`PencilBrush`](/api/classes/pencilbrush/).[`decimate`](/api/classes/pencilbrush/#decimate) -#### Defined in - -[src/brushes/PencilBrush.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L25) - *** ### drawStraightLine > **drawStraightLine**: `boolean` = `false` +Defined in: [src/brushes/PencilBrush.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L34) + Draws a straight line between last recorded point to current pointer Used for `shift` functionality @@ -116,16 +108,14 @@ false [`PencilBrush`](/api/classes/pencilbrush/).[`drawStraightLine`](/api/classes/pencilbrush/#drawstraightline) -#### Defined in - -[src/brushes/PencilBrush.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L34) - *** ### 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 @@ -138,49 +128,37 @@ false [`PencilBrush`](/api/classes/pencilbrush/).[`limitedToCanvasSize`](/api/classes/pencilbrush/#limitedtocanvassize) -#### 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 - -``` - #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`shadow`](/api/classes/pencilbrush/#shadow) -#### Defined in - -[src/brushes/BaseBrush.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L32) - *** ### source? > `optional` **source**: `CanvasImageSource` -#### Defined in - -[src/brushes/PatternBrush.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L8) +Defined in: [src/brushes/PatternBrush.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L8) *** ### straightLineKey -> **straightLineKey**: `undefined` \| `null` \| `"altKey"` \| `"shiftKey"` \| `"ctrlKey"` \| `"metaKey"` = `'shiftKey'` +> **straightLineKey**: `undefined` \| `null` \| `"altKey"` \| `"ctrlKey"` \| `"metaKey"` \| `"shiftKey"` = `'shiftKey'` + +Defined in: [src/brushes/PencilBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L41) The event modifier key that makes the brush draw a straight line. If `null` or 'none' or any other string that is not a modifier key the feature is disabled. @@ -189,126 +167,84 @@ If `null` or 'none' or any other string that is not a modifier key the feature i [`PencilBrush`](/api/classes/pencilbrush/).[`straightLineKey`](/api/classes/pencilbrush/#straightlinekey) -#### Defined in - -[src/brushes/PencilBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L41) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] = `null` -Stroke Dash Array. - -#### Default - -```ts +Defined in: [src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L53) -``` +Stroke Dash Array. #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`strokeDashArray`](/api/classes/pencilbrush/#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 [`PencilBrush`](/api/classes/pencilbrush/).[`strokeLineCap`](/api/classes/pencilbrush/#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 [`PencilBrush`](/api/classes/pencilbrush/).[`strokeLineJoin`](/api/classes/pencilbrush/#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 - -```ts +Defined in: [src/brushes/BaseBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L47) -``` +Maximum miter length (used for strokeLineJoin = "miter") of a brush's #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`strokeMiterLimit`](/api/classes/pencilbrush/#strokemiterlimit) -#### Defined in - -[src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L53) - *** ### width > **width**: `number` = `1` -Width of a brush, has to be a Number, no string literals - -#### Default - -```ts +Defined in: [src/brushes/BaseBrush.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L21) -``` +Width of a brush, has to be a Number, no string literals #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`width`](/api/classes/pencilbrush/#width) -#### Defined in - -[src/brushes/BaseBrush.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L23) - ## Methods ### \_finalizeAndAddPath() > **\_finalizeAndAddPath**(): `void` +Defined in: [src/brushes/PencilBrush.ts:275](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L275) + On mouseup after drawing the path on contextTop canvas we use the points captured to create an new Path object and add it to the canvas. @@ -321,21 +257,21 @@ and add it to the canvas. [`PencilBrush`](/api/classes/pencilbrush/).[`_finalizeAndAddPath`](/api/classes/pencilbrush/#_finalizeandaddpath) -#### Defined in - -[src/brushes/PencilBrush.ts:273](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L273) - *** ### \_setBrushStyles() > **\_setBrushStyles**(`ctx`): `void` +Defined in: [src/brushes/PatternBrush.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L50) + Sets brush styles #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` #### Returns @@ -345,27 +281,27 @@ Sets brush styles `PencilBrush._setBrushStyles` -#### Defined in - -[src/brushes/PatternBrush.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L50) - *** ### convertPointsToSVGPath() -> **convertPointsToSVGPath**(`points`): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +> **convertPointsToSVGPath**(`points`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/brushes/PencilBrush.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L213) Converts points to SVG path #### Parameters -• **points**: [`Point`](/api/classes/point/)[] +##### points + +[`Point`](/api/classes/point/)[] Array of points #### Returns -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) SVG path commands @@ -373,21 +309,21 @@ SVG path commands [`PencilBrush`](/api/classes/pencilbrush/).[`convertPointsToSVGPath`](/api/classes/pencilbrush/#convertpointstosvgpath) -#### Defined in - -[src/brushes/PencilBrush.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L212) - *** ### createPath() > **createPath**(`pathData`): [`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/brushes/PatternBrush.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L59) + Creates path #### Parameters -• **pathData**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +##### pathData + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) #### Returns @@ -397,23 +333,25 @@ Creates path [`PencilBrush`](/api/classes/pencilbrush/).[`createPath`](/api/classes/pencilbrush/#createpath) -#### Defined in - -[src/brushes/PatternBrush.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L59) - *** ### decimatePoints() > **decimatePoints**(`points`, `distance`): [`Point`](/api/classes/point/)[] +Defined in: [src/brushes/PencilBrush.ts:244](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L244) + Decimate points array with the decimate value #### Parameters -• **points**: [`Point`](/api/classes/point/)[] +##### points -• **distance**: `number` +[`Point`](/api/classes/point/)[] + +##### distance + +`number` #### Returns @@ -423,50 +361,46 @@ Decimate points array with the decimate value [`PencilBrush`](/api/classes/pencilbrush/).[`decimatePoints`](/api/classes/pencilbrush/#decimatepoints) -#### Defined in - -[src/brushes/PencilBrush.ts:243](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L243) - *** ### getPattern() > **getPattern**(`ctx`): `null` \| `CanvasPattern` +Defined in: [src/brushes/PatternBrush.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L42) + Creates "pattern" instance property #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` #### Returns `null` \| `CanvasPattern` -#### Defined in - -[src/brushes/PatternBrush.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L42) - *** ### getPatternSrc() > **getPatternSrc**(): `HTMLCanvasElement` +Defined in: [src/brushes/PatternBrush.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PatternBrush.ts#L14) + #### Returns `HTMLCanvasElement` -#### Defined in - -[src/brushes/PatternBrush.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PatternBrush.ts#L14) - *** ### needsFullRender() > **needsFullRender**(): `boolean` +Defined in: [src/brushes/PencilBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L53) + #### Returns `boolean` @@ -475,23 +409,25 @@ Creates "pattern" instance property [`PencilBrush`](/api/classes/pencilbrush/).[`needsFullRender`](/api/classes/pencilbrush/#needsfullrender) -#### Defined in - -[src/brushes/PencilBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L53) - *** ### onMouseDown() > **onMouseDown**(`pointer`, `__namedParameters`): `void` +Defined in: [src/brushes/PencilBrush.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L67) + Invoked on mouse down #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer + +[`Point`](/api/classes/point/) -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### \_\_namedParameters + +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -501,23 +437,25 @@ Invoked on mouse down [`PencilBrush`](/api/classes/pencilbrush/).[`onMouseDown`](/api/classes/pencilbrush/#onmousedown) -#### Defined in - -[src/brushes/PencilBrush.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L67) - *** ### onMouseMove() > **onMouseMove**(`pointer`, `__namedParameters`): `void` +Defined in: [src/brushes/PencilBrush.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L83) + Invoked on mouse move #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +[`Point`](/api/classes/point/) + +##### \_\_namedParameters + +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -527,21 +465,21 @@ Invoked on mouse move [`PencilBrush`](/api/classes/pencilbrush/).[`onMouseMove`](/api/classes/pencilbrush/#onmousemove) -#### Defined in - -[src/brushes/PencilBrush.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L83) - *** ### onMouseUp() > **onMouseUp**(`__namedParameters`): `boolean` +Defined in: [src/brushes/PencilBrush.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L121) + Invoked on mouse up #### Parameters -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### \_\_namedParameters + +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -551,23 +489,27 @@ Invoked on mouse up [`PencilBrush`](/api/classes/pencilbrush/).[`onMouseUp`](/api/classes/pencilbrush/#onmouseup) -#### Defined in - -[src/brushes/PencilBrush.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L121) - *** ### drawSegment() > `static` **drawSegment**(`ctx`, `p1`, `p2`): [`Point`](/api/classes/point/) +Defined in: [src/brushes/PencilBrush.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L57) + #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` + +##### p1 + +[`Point`](/api/classes/point/) -• **p1**: [`Point`](/api/classes/point/) +##### p2 -• **p2**: [`Point`](/api/classes/point/) +[`Point`](/api/classes/point/) #### Returns @@ -576,7 +518,3 @@ Invoked on mouse up #### Inherited from [`PencilBrush`](/api/classes/pencilbrush/).[`drawSegment`](/api/classes/pencilbrush/#drawsegment) - -#### Defined in - -[src/brushes/PencilBrush.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L57) diff --git a/src/content/docs/api/classes/PencilBrush.md b/src/content/docs/api/classes/PencilBrush.md index f5ebd7b71..4d43a42e3 100644 --- a/src/content/docs/api/classes/PencilBrush.md +++ b/src/content/docs/api/classes/PencilBrush.md @@ -5,9 +5,11 @@ prev: false title: "PencilBrush" --- +Defined in: [src/brushes/PencilBrush.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L19) + ## See -[demo](http://fabricjs.com/freedrawing|Freedrawing) +[demo](http://fabric5.fabricjs.com/freedrawing|Freedrawing) ## Extends @@ -19,25 +21,25 @@ title: "PencilBrush" ## Constructors -### new PencilBrush() +### Constructor + +> **new PencilBrush**(`canvas`): `PencilBrush` -> **new PencilBrush**(`canvas`): [`PencilBrush`](/api/classes/pencilbrush/) +Defined in: [src/brushes/PencilBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L47) #### Parameters -• **canvas**: [`Canvas`](/api/classes/canvas/) +##### canvas + +[`Canvas`](/api/classes/canvas/) #### Returns -[`PencilBrush`](/api/classes/pencilbrush/) +`PencilBrush` #### Overrides -[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructors) - -#### Defined in - -[src/brushes/PencilBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L47) +[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructor) ## Properties @@ -45,6 +47,8 @@ title: "PencilBrush" > **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 @@ -53,38 +57,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) - *** ### decimate > **decimate**: `number` = `0.4` +Defined in: [src/brushes/PencilBrush.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L25) + Discard points that are less than `decimate` pixel distant from each other #### Default @@ -93,16 +87,14 @@ Discard points that are less than `decimate` pixel distant from each other 0.4 ``` -#### Defined in - -[src/brushes/PencilBrush.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L25) - *** ### drawStraightLine > **drawStraightLine**: `boolean` = `false` +Defined in: [src/brushes/PencilBrush.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L34) + Draws a straight line between last recorded point to current pointer Used for `shift` functionality @@ -112,16 +104,14 @@ Used for `shift` functionality false ``` -#### Defined in - -[src/brushes/PencilBrush.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L34) - *** ### 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 @@ -134,163 +124,111 @@ 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) - *** ### 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 - -``` - #### 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) - *** ### straightLineKey -> **straightLineKey**: `undefined` \| `null` \| `"altKey"` \| `"shiftKey"` \| `"ctrlKey"` \| `"metaKey"` = `'shiftKey'` +> **straightLineKey**: `undefined` \| `null` \| `"altKey"` \| `"ctrlKey"` \| `"metaKey"` \| `"shiftKey"` = `'shiftKey'` + +Defined in: [src/brushes/PencilBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L41) The event modifier key that makes the brush draw a straight line. If `null` or 'none' or any other string that is not a modifier key the feature is disabled. -#### Defined in - -[src/brushes/PencilBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L41) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] = `null` -Stroke Dash Array. - -#### Default - -```ts +Defined in: [src/brushes/BaseBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L53) -``` +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") +Defined in: [src/brushes/BaseBrush.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L35) -#### Default - -```ts - -``` +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 +Defined in: [src/brushes/BaseBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L41) -```ts - -``` +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 - -```ts +Defined in: [src/brushes/BaseBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L47) -``` +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` = `1` -Width of a brush, has to be a Number, no string literals - -#### Default - -```ts +Defined in: [src/brushes/BaseBrush.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L21) -``` +Width of a brush, has to be a Number, no string literals #### Inherited from [`BaseBrush`](/api/classes/basebrush/).[`width`](/api/classes/basebrush/#width) -#### Defined in - -[src/brushes/BaseBrush.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/BaseBrush.ts#L23) - ## Methods ### \_finalizeAndAddPath() > **\_finalizeAndAddPath**(): `void` +Defined in: [src/brushes/PencilBrush.ts:275](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L275) + On mouseup after drawing the path on contextTop canvas we use the points captured to create an new Path object and add it to the canvas. @@ -299,79 +237,77 @@ and add it to the canvas. `void` -#### Defined in - -[src/brushes/PencilBrush.ts:273](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L273) - *** ### convertPointsToSVGPath() -> **convertPointsToSVGPath**(`points`): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +> **convertPointsToSVGPath**(`points`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/brushes/PencilBrush.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L213) Converts points to SVG path #### Parameters -• **points**: [`Point`](/api/classes/point/)[] +##### points + +[`Point`](/api/classes/point/)[] Array of points #### Returns -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) SVG path commands -#### Defined in - -[src/brushes/PencilBrush.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L212) - *** ### createPath() -> **createPath**(`pathData`): [`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **createPath**(`pathData`): [`Path`](/api/classes/path/) + +Defined in: [src/brushes/PencilBrush.ts:223](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L223) Creates a Path object to add on canvas #### Parameters -• **pathData**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +##### pathData + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) Path data #### Returns -[`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +[`Path`](/api/classes/path/) Path to add on canvas -#### Defined in - -[src/brushes/PencilBrush.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L222) - *** ### decimatePoints() > **decimatePoints**(`points`, `distance`): [`Point`](/api/classes/point/)[] +Defined in: [src/brushes/PencilBrush.ts:244](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L244) + Decimate points array with the decimate value #### Parameters -• **points**: [`Point`](/api/classes/point/)[] +##### points -• **distance**: `number` +[`Point`](/api/classes/point/)[] -#### Returns +##### distance -[`Point`](/api/classes/point/)[] +`number` -#### Defined in +#### Returns -[src/brushes/PencilBrush.ts:243](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L243) +[`Point`](/api/classes/point/)[] *** @@ -379,6 +315,8 @@ Decimate points array with the decimate value > **needsFullRender**(): `boolean` +Defined in: [src/brushes/PencilBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L53) + #### Returns `boolean` @@ -387,23 +325,25 @@ Decimate points array with the decimate value `BaseBrush.needsFullRender` -#### Defined in - -[src/brushes/PencilBrush.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L53) - *** ### onMouseDown() > **onMouseDown**(`pointer`, `__namedParameters`): `void` +Defined in: [src/brushes/PencilBrush.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L67) + Invoked on mouse down #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer + +[`Point`](/api/classes/point/) + +##### \_\_namedParameters -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -413,23 +353,25 @@ Invoked on mouse down [`BaseBrush`](/api/classes/basebrush/).[`onMouseDown`](/api/classes/basebrush/#onmousedown) -#### Defined in - -[src/brushes/PencilBrush.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L67) - *** ### onMouseMove() > **onMouseMove**(`pointer`, `__namedParameters`): `void` +Defined in: [src/brushes/PencilBrush.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L83) + Invoked on mouse move #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +[`Point`](/api/classes/point/) + +##### \_\_namedParameters + +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -439,21 +381,21 @@ Invoked on mouse move [`BaseBrush`](/api/classes/basebrush/).[`onMouseMove`](/api/classes/basebrush/#onmousemove) -#### Defined in - -[src/brushes/PencilBrush.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L83) - *** ### onMouseUp() > **onMouseUp**(`__namedParameters`): `boolean` +Defined in: [src/brushes/PencilBrush.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L121) + Invoked on mouse up #### Parameters -• **\_\_namedParameters**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### \_\_namedParameters + +[`TEvent`](/api/interfaces/tevent/) #### Returns @@ -463,28 +405,28 @@ Invoked on mouse up [`BaseBrush`](/api/classes/basebrush/).[`onMouseUp`](/api/classes/basebrush/#onmouseup) -#### Defined in - -[src/brushes/PencilBrush.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L121) - *** ### drawSegment() > `static` **drawSegment**(`ctx`, `p1`, `p2`): [`Point`](/api/classes/point/) +Defined in: [src/brushes/PencilBrush.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/PencilBrush.ts#L57) + #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx -• **p1**: [`Point`](/api/classes/point/) +`CanvasRenderingContext2D` -• **p2**: [`Point`](/api/classes/point/) +##### p1 -#### Returns +[`Point`](/api/classes/point/) + +##### p2 [`Point`](/api/classes/point/) -#### Defined in +#### Returns -[src/brushes/PencilBrush.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/PencilBrush.ts#L57) +[`Point`](/api/classes/point/) diff --git a/src/content/docs/api/classes/Point.md b/src/content/docs/api/classes/Point.md index 3a9eb796b..1967e797d 100644 --- a/src/content/docs/api/classes/Point.md +++ b/src/content/docs/api/classes/Point.md @@ -5,6 +5,8 @@ prev: false title: "Point" --- +Defined in: [src/Point.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L13) + Adaptation of work of Kevin Lindsey(kevin@kevlindev.com) ## Implements @@ -13,51 +15,51 @@ Adaptation of work of Kevin Lindsey(kevin@kevlindev.com) ## Constructors -### new Point() +### Constructor -> **new Point**(): [`Point`](/api/classes/point/) +> **new Point**(): `Point` -#### Returns +Defined in: [src/Point.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L18) -[`Point`](/api/classes/point/) +#### Returns -#### Defined in +`Point` -[src/Point.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L18) +### Constructor -### new Point() +> **new Point**(`x`, `y`): `Point` -> **new Point**(`x`, `y`): [`Point`](/api/classes/point/) +Defined in: [src/Point.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L19) #### Parameters -• **x**: `number` +##### x -• **y**: `number` +`number` -#### Returns +##### y + +`number` -[`Point`](/api/classes/point/) +#### Returns -#### Defined in +`Point` -[src/Point.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L19) +### Constructor -### new Point() +> **new Point**(`point?`): `Point` -> **new Point**(`point`?): [`Point`](/api/classes/point/) +Defined in: [src/Point.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L20) #### Parameters -• **point?**: [`XY`](/api/interfaces/xy/) - -#### Returns +##### point? -[`Point`](/api/classes/point/) +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L20) +`Point` ## Properties @@ -65,55 +67,53 @@ Adaptation of work of Kevin Lindsey(kevin@kevlindev.com) > **x**: `number` +Defined in: [src/Point.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L14) + #### Implementation of [`XY`](/api/interfaces/xy/).[`x`](/api/interfaces/xy/#x) -#### Defined in - -[src/Point.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L14) - *** ### y > **y**: `number` +Defined in: [src/Point.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L16) + #### Implementation of [`XY`](/api/interfaces/xy/).[`y`](/api/interfaces/xy/#y) -#### Defined in - -[src/Point.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L16) - ## Methods ### add() -> **add**(`that`): [`Point`](/api/classes/point/) +> **add**(`that`): `Point` + +Defined in: [src/Point.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L36) -Adds another point to this one and returns another one +Adds another point to this one and returns a new one with the sum #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns -[`Point`](/api/classes/point/) +`Point` new Point instance with added values -#### Defined in - -[src/Point.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L36) - *** ### ~~addEquals()~~ -> **addEquals**(`that`): [`Point`](/api/classes/point/) +> **addEquals**(`that`): `Point` + +Defined in: [src/Point.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L46) Adds another point to this one @@ -123,35 +123,29 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L47) - *** ### clone() -> **clone**(): [`Point`](/api/classes/point/) +> **clone**(): `Point` + +Defined in: [src/Point.ts:337](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L337) return a cloned instance of the point #### Returns -[`Point`](/api/classes/point/) - -#### Defined in - -[src/Point.ts:347](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L347) +`Point` *** @@ -159,39 +153,39 @@ return a cloned instance of the point > **distanceFrom**(`that`): `number` +Defined in: [src/Point.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L240) + Returns distance from this point and another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `number` -#### Defined in - -[src/Point.ts:246](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L246) - *** ### divide() -> **divide**(`that`): [`Point`](/api/classes/point/) +> **divide**(`that`): `Point` + +Defined in: [src/Point.ts:150](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L150) Divides this point by another and returns a new one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that -#### Returns - -[`Point`](/api/classes/point/) +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:155](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L155) +`Point` *** @@ -199,83 +193,85 @@ Divides this point by another and returns a new one > **eq**(`that`): `boolean` +Defined in: [src/Point.ts:180](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L180) + Returns true if this point is equal to another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `boolean` -#### Defined in - -[src/Point.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L186) - *** ### gt() > **gt**(`that`): `boolean` +Defined in: [src/Point.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L208) + Returns true if this point is greater another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `boolean` -#### Defined in - -[src/Point.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L214) - *** ### gte() > **gte**(`that`): `boolean` +Defined in: [src/Point.ts:217](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L217) + Returns true if this point is greater than or equal to another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `boolean` -#### Defined in - -[src/Point.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L223) - *** ### lerp() -> **lerp**(`that`, `t`): [`Point`](/api/classes/point/) +> **lerp**(`that`, `t`): `Point` + +Defined in: [src/Point.ts:227](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L227) Returns new point which is the result of linear interpolation with this one and another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that -• **t**: `number` = `0.5` +[`XY`](/api/interfaces/xy/) -, position of interpolation, between 0 and 1 default 0.5 +##### t -#### Returns +`number` = `0.5` -[`Point`](/api/classes/point/) +, position of interpolation, between 0 and 1 default 0.5 -#### Defined in +#### Returns -[src/Point.ts:233](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L233) +`Point` *** @@ -283,181 +279,179 @@ Returns new point which is the result of linear interpolation with this one and > **lt**(`that`): `boolean` +Defined in: [src/Point.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L189) + Returns true if this point is less than another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `boolean` -#### Defined in - -[src/Point.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L195) - *** ### lte() > **lte**(`that`): `boolean` +Defined in: [src/Point.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L198) + Returns true if this point is less than or equal to another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `boolean` -#### Defined in - -[src/Point.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L204) - *** ### max() -> **max**(`that`): [`Point`](/api/classes/point/) +> **max**(`that`): `Point` + +Defined in: [src/Point.ts:269](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L269) Returns a new point which is the max of this and another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) - -#### Returns +##### that -[`Point`](/api/classes/point/) +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:275](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L275) +`Point` *** ### midPointFrom() -> **midPointFrom**(`that`): [`Point`](/api/classes/point/) +> **midPointFrom**(`that`): `Point` + +Defined in: [src/Point.ts:251](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L251) Returns the point between this point and another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that -#### Returns - -[`Point`](/api/classes/point/) +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:257](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L257) +`Point` *** ### min() -> **min**(`that`): [`Point`](/api/classes/point/) +> **min**(`that`): `Point` + +Defined in: [src/Point.ts:260](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L260) Returns a new point which is the min of this and another one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) - -#### Returns +##### that -[`Point`](/api/classes/point/) +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:266](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L266) +`Point` *** ### multiply() -> **multiply**(`that`): [`Point`](/api/classes/point/) +> **multiply**(`that`): `Point` + +Defined in: [src/Point.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L120) Multiplies this point by another value and returns a new one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that -#### Returns +[`XY`](/api/interfaces/xy/) -[`Point`](/api/classes/point/) - -#### Defined in +#### Returns -[src/Point.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L124) +`Point` *** ### rotate() -> **rotate**(`radians`, `origin`): [`Point`](/api/classes/point/) +> **rotate**(`radians`, `origin`): `Point` + +Defined in: [src/Point.ts:347](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L347) Rotates `point` around `origin` with `radians` #### Parameters -• **radians**: [`TRadian`](/api/type-aliases/tradian/) +##### radians + +[`TRadian`](/api/type-aliases/tradian/) The radians of the angle for the rotation -• **origin**: [`XY`](/api/interfaces/xy/) = `ZERO` +##### origin + +[`XY`](/api/interfaces/xy/) = `ZERO` The origin of the rotation #### Returns -[`Point`](/api/classes/point/) +`Point` The new rotated point -#### Static - -#### Member Of - -fabric.util - -#### Defined in - -[src/Point.ts:359](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L359) - *** ### scalarAdd() -> **scalarAdd**(`scalar`): [`Point`](/api/classes/point/) +> **scalarAdd**(`scalar`): `Point` + +Defined in: [src/Point.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L57) Adds value to this point and returns a new one #### Parameters -• **scalar**: `number` +##### scalar + +`number` #### Returns -[`Point`](/api/classes/point/) +`Point` new Point with added value -#### Defined in - -[src/Point.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L58) - *** ### ~~scalarAddEquals()~~ -> **scalarAddEquals**(`scalar`): [`Point`](/api/classes/point/) +> **scalarAddEquals**(`scalar`): `Point` + +Defined in: [src/Point.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L67) Adds value to this point @@ -467,45 +461,43 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **scalar**: `number` +##### scalar + +`number` #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L69) - *** ### scalarDivide() -> **scalarDivide**(`scalar`): [`Point`](/api/classes/point/) +> **scalarDivide**(`scalar`): `Point` + +Defined in: [src/Point.ts:159](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L159) Divides this point by a value and returns a new one #### Parameters -• **scalar**: `number` - -#### Returns +##### scalar -[`Point`](/api/classes/point/) +`number` -#### Defined in +#### Returns -[src/Point.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L164) +`Point` *** ### ~~scalarDivideEquals()~~ -> **scalarDivideEquals**(`scalar`): [`Point`](/api/classes/point/) +> **scalarDivideEquals**(`scalar`): `Point` + +Defined in: [src/Point.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L169) Divides this point by a value @@ -515,45 +507,43 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **scalar**: `number` +##### scalar + +`number` #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:175](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L175) - *** ### scalarMultiply() -> **scalarMultiply**(`scalar`): [`Point`](/api/classes/point/) +> **scalarMultiply**(`scalar`): `Point` + +Defined in: [src/Point.ts:129](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L129) Multiplies this point by a value and returns a new one #### Parameters -• **scalar**: `number` - -#### Returns +##### scalar -[`Point`](/api/classes/point/) +`number` -#### Defined in +#### Returns -[src/Point.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L133) +`Point` *** ### ~~scalarMultiplyEquals()~~ -> **scalarMultiplyEquals**(`scalar`): [`Point`](/api/classes/point/) +> **scalarMultiplyEquals**(`scalar`): `Point` + +Defined in: [src/Point.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L139) Multiplies this point by a value @@ -563,45 +553,43 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **scalar**: `number` +##### scalar + +`number` #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:144](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L144) - *** ### scalarSubtract() -> **scalarSubtract**(`scalar`): [`Point`](/api/classes/point/) +> **scalarSubtract**(`scalar`): `Point` + +Defined in: [src/Point.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L99) Subtracts value from this point and returns a new one #### Parameters -• **scalar**: `number` - -#### Returns +##### scalar -[`Point`](/api/classes/point/) +`number` -#### Defined in +#### Returns -[src/Point.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L102) +`Point` *** ### ~~scalarSubtractEquals()~~ -> **scalarSubtractEquals**(`scalar`): [`Point`](/api/classes/point/) +> **scalarSubtractEquals**(`scalar`): `Point` + +Defined in: [src/Point.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L109) Subtracts value from this point @@ -611,137 +599,129 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **scalar**: `number` +##### scalar + +`number` #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:113](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L113) - *** ### setFromPoint() -> **setFromPoint**(`that`): [`Point`](/api/classes/point/) +> **setFromPoint**(`that`): `Point` + +Defined in: [src/Point.ts:314](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L314) Sets x/y of this point from another point #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) - -#### Returns - -[`Point`](/api/classes/point/) +##### that -#### Chainable +[`XY`](/api/interfaces/xy/) -#### Defined in +#### Returns -[src/Point.ts:324](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L324) +`Point` *** ### setX() -> **setX**(`x`): [`Point`](/api/classes/point/) +> **setX**(`x`): `Point` + +Defined in: [src/Point.ts:296](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L296) Sets x of this point #### Parameters -• **x**: `number` - -#### Returns - -[`Point`](/api/classes/point/) +##### x -#### Chainable +`number` -#### Defined in +#### Returns -[src/Point.ts:304](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L304) +`Point` *** ### setXY() -> **setXY**(`x`, `y`): [`Point`](/api/classes/point/) +> **setXY**(`x`, `y`): `Point` + +Defined in: [src/Point.ts:286](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L286) Sets x/y of this point #### Parameters -• **x**: `number` +##### x -• **y**: `number` - -#### Returns +`number` -[`Point`](/api/classes/point/) +##### y -#### Chainable +`number` -#### Defined in +#### Returns -[src/Point.ts:293](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L293) +`Point` *** ### setY() -> **setY**(`y`): [`Point`](/api/classes/point/) +> **setY**(`y`): `Point` + +Defined in: [src/Point.ts:305](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L305) Sets y of this point #### Parameters -• **y**: `number` - -#### Returns +##### y -[`Point`](/api/classes/point/) - -#### Chainable +`number` -#### Defined in +#### Returns -[src/Point.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L314) +`Point` *** ### subtract() -> **subtract**(`that`): [`Point`](/api/classes/point/) +> **subtract**(`that`): `Point` + +Defined in: [src/Point.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L78) Subtracts another point from this point and returns a new one #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns -[`Point`](/api/classes/point/) +`Point` new Point object with subtracted values -#### Defined in - -[src/Point.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L80) - *** ### ~~subtractEquals()~~ -> **subtractEquals**(`that`): [`Point`](/api/classes/point/) +> **subtractEquals**(`that`): `Point` + +Defined in: [src/Point.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L88) Subtracts another point from this point @@ -751,86 +731,76 @@ This API is no longer supported and may be removed in a future release. #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns -[`Point`](/api/classes/point/) +`Point` thisArg -#### Chainable - -#### Defined in - -[src/Point.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L91) - *** ### swap() > **swap**(`that`): `void` +Defined in: [src/Point.ts:324](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L324) + Swaps x/y of this point and another point #### Parameters -• **that**: [`XY`](/api/interfaces/xy/) +##### that + +[`XY`](/api/interfaces/xy/) #### Returns `void` -#### Defined in - -[src/Point.ts:334](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L334) - *** ### toString() > **toString**(): `string` +Defined in: [src/Point.ts:277](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L277) + Returns string representation of this point #### Returns `string` -#### Defined in - -[src/Point.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L283) - *** ### transform() -> **transform**(`t`, `ignoreOffset`?): [`Point`](/api/classes/point/) +> **transform**(`t`, `ignoreOffset?`): `Point` + +Defined in: [src/Point.ts:366](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L366) Apply transform t to point p #### Parameters -• **t**: [`TMat2D`](/api/type-aliases/tmat2d/) +##### t + +[`TMat2D`](/api/type-aliases/tmat2d/) The transform -• **ignoreOffset?**: `boolean` = `false` +##### ignoreOffset? + +`boolean` = `false` Indicates that the offset should not be applied #### Returns -[`Point`](/api/classes/point/) +`Point` The transformed point - -#### Static - -#### Member Of - -fabric.util - -#### Defined in - -[src/Point.ts:380](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L380) diff --git a/src/content/docs/api/classes/Polygon.md b/src/content/docs/api/classes/Polygon.md index 75f585984..058a4b989 100644 --- a/src/content/docs/api/classes/Polygon.md +++ b/src/content/docs/api/classes/Polygon.md @@ -5,87 +5,9 @@ prev: false title: "Polygon" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Polygon.ts:4](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polygon.ts#L4) -## 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,25 +15,31 @@ drop ## Constructors -### new Polygon() +### Constructor + +> **new Polygon**(`points`, `options?`): `Polygon` -> **new Polygon**(`points`, `options`?): [`Polygon`](/api/classes/polygon/) +Defined in: [src/shapes/Polyline.ts:117](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L117) Constructor #### Parameters -• **points**: [`XY`](/api/interfaces/xy/)[] = `[]` +##### points + +[`XY`](/api/interfaces/xy/)[] = `[]` Array of points (where each point is an object with x and y) -• **options?**: `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `...` +##### options? + +`Props` = `...` Options object #### Returns -[`Polygon`](/api/classes/polygon/) +`Polygon` thisArg @@ -134,11 +62,7 @@ var poly = new Polyline([ #### Inherited from -[`Polyline`](/api/classes/polyline/).[`constructor`](/api/classes/polyline/#constructors) - -#### Defined in - -[src/shapes/Polyline.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L118) +[`Polyline`](/api/classes/polyline/).[`constructor`](/api/classes/polyline/#constructor) ## Properties @@ -146,6 +70,8 @@ var poly = new Polyline([ > `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 @@ -156,16 +82,14 @@ this isn't cleaned automatically. Non selected objects may have wrong values [`Polyline`](/api/classes/polyline/).[`__corner`](/api/classes/polyline/#__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 @@ -174,16 +98,14 @@ this takes priority over the generic control visibility [`Polyline`](/api/classes/polyline/).[`_controlsVisibility`](/api/classes/polyline/#_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. @@ -198,37 +120,14 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT [`Polyline`](/api/classes/polyline/).[`_scaling`](/api/classes/polyline/#_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/polygon/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/polygon/#calcacoords) - -#### Inherited from - -[`Polyline`](/api/classes/polyline/).[`aCoords`](/api/classes/polyline/#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 @@ -246,9 +145,24 @@ false [`Polyline`](/api/classes/polyline/).[`absolutePositioned`](/api/classes/polyline/#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/polygon/#setcoords). +You can calculate them without updating with [()](/api/classes/polygon/#calcacoords) + +#### Inherited from -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +[`Polyline`](/api/classes/polyline/).[`aCoords`](/api/classes/polyline/#acoords) *** @@ -256,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 @@ -268,39 +184,29 @@ Angle of rotation of an object (in degrees) [`Polyline`](/api/classes/polyline/).[`angle`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`backgroundColor`](/api/classes/polyline/#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 @@ -313,16 +219,14 @@ rgb(178,204,255) [`Polyline`](/api/classes/polyline/).[`borderColor`](/api/classes/polyline/#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 @@ -333,16 +237,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`Polyline`](/api/classes/polyline/).[`borderDashArray`](/api/classes/polyline/#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 @@ -355,20 +257,19 @@ Opacity of object's controlling borders when object is active and moving [`Polyline`](/api/classes/polyline/).[`borderOpacityWhenMoving`](/api/classes/polyline/#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 @@ -380,16 +281,14 @@ since there is no way to change the border itself. [`Polyline`](/api/classes/polyline/).[`borderScaleFactor`](/api/classes/polyline/#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 @@ -400,26 +299,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`Polyline`](/api/classes/polyline/).[`centeredRotation`](/api/classes/polyline/#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. @@ -427,26 +318,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`Polyline`](/api/classes/polyline/).[`centeredScaling`](/api/classes/polyline/#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. @@ -456,16 +339,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`Polyline`](/api/classes/polyline/).[`clipPath`](/api/classes/polyline/#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. @@ -473,16 +354,14 @@ This reference is a UID in the fabric namespace and is temporary stored here. [`Polyline`](/api/classes/polyline/).[`clipPathId`](/api/classes/polyline/#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 @@ -490,16 +369,14 @@ controls are added by default_controls.js [`Polyline`](/api/classes/polyline/).[`controls`](/api/classes/polyline/#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 @@ -512,16 +389,14 @@ rgb(178,204,255) [`Polyline`](/api/classes/polyline/).[`cornerColor`](/api/classes/polyline/#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 @@ -538,16 +413,14 @@ null [`Polyline`](/api/classes/polyline/).[`cornerDashArray`](/api/classes/polyline/#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 @@ -560,16 +433,14 @@ Size of object's controlling corners (in pixels) [`Polyline`](/api/classes/polyline/).[`cornerSize`](/api/classes/polyline/#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 @@ -586,20 +457,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`Polyline`](/api/classes/polyline/).[`cornerStrokeColor`](/api/classes/polyline/#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 @@ -610,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 [`Polyline`](/api/classes/polyline/).[`cornerStyle`](/api/classes/polyline/#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 @@ -641,93 +508,73 @@ true [`Polyline`](/api/classes/polyline/).[`dirty`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`evented`](/api/classes/polyline/#evented) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L82) - *** ### ~~exactBoundingBox~~ > **exactBoundingBox**: `boolean` +Defined in: [src/shapes/Polyline.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L60) + WARNING: Feature in progress Calculate the exact bounding box taking in account strokeWidth on acute angles this will be turned to true by default on fabric 6.0 maybe will be left in as an optimization since calculations may be slow +:::caution[Deprecated] +transient option soon to be removed in favor of a different design +::: + #### Default ```ts false ``` -:::caution[Deprecated] -transient option soon to be removed in favor of a different design -::: - #### Inherited from [`Polyline`](/api/classes/polyline/).[`exactBoundingBox`](/api/classes/polyline/#exactboundingbox) -#### Defined in - -[src/shapes/Polyline.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L61) - *** ### 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 [`Polyline`](/api/classes/polyline/).[`excludeFromExport`](/api/classes/polyline/#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/ @@ -741,16 +588,14 @@ rgb(0,0,0) [`Polyline`](/api/classes/polyline/).[`fill`](/api/classes/polyline/#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) @@ -765,16 +610,14 @@ nonzero [`Polyline`](/api/classes/polyline/).[`fillRule`](/api/classes/polyline/#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 @@ -787,16 +630,14 @@ false [`Polyline`](/api/classes/polyline/).[`flipX`](/api/classes/polyline/#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 @@ -809,60 +650,42 @@ false [`Polyline`](/api/classes/polyline/).[`flipY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`globalCompositeOperation`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`hasBorders`](/api/classes/polyline/#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 @@ -875,38 +698,28 @@ true [`Polyline`](/api/classes/polyline/).[`hasControls`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`height`](/api/classes/polyline/#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 @@ -919,38 +732,28 @@ null [`Polyline`](/api/classes/polyline/).[`hoverCursor`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`includeDefaultValues`](/api/classes/polyline/#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 @@ -965,16 +768,14 @@ false [`Polyline`](/api/classes/polyline/).[`inverted`](/api/classes/polyline/#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. @@ -982,19 +783,17 @@ part of the move action. [`Polyline`](/api/classes/polyline/).[`isMoving`](/api/classes/polyline/#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 @@ -1006,208 +805,140 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`Polyline`](/api/classes/polyline/).[`left`](/api/classes/polyline/#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 - -``` - #### Inherited from [`Polyline`](/api/classes/polyline/).[`lockMovementX`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockMovementY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockRotation`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockScalingFlip`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockScalingX`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockScalingY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockSkewingX`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`lockSkewingY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`matrixCache`](/api/classes/polyline/#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 @@ -1220,16 +951,14 @@ Minimum allowed scale value of an object [`Polyline`](/api/classes/polyline/).[`minScaleLimit`](/api/classes/polyline/#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 @@ -1242,16 +971,14 @@ null [`Polyline`](/api/classes/polyline/).[`moveCursor`](/api/classes/polyline/#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. @@ -1268,35 +995,14 @@ true [`Polyline`](/api/classes/polyline/).[`noScaleCache`](/api/classes/polyline/#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 - -[`Polyline`](/api/classes/polyline/).[`oCoords`](/api/classes/polyline/#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 @@ -1315,9 +1021,22 @@ true [`Polyline`](/api/classes/polyline/).[`objectCaching`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`oCoords`](/api/classes/polyline/#ocoords) *** @@ -1325,6 +1044,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 @@ -1337,16 +1058,14 @@ Opacity of an object [`Polyline`](/api/classes/polyline/).[`opacity`](/api/classes/polyline/#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 ::: @@ -1355,16 +1074,14 @@ please use 'center' as value in new projects [`Polyline`](/api/classes/polyline/).[`originX`](/api/classes/polyline/#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 ::: @@ -1373,32 +1090,28 @@ please use 'center' as value in new projects [`Polyline`](/api/classes/polyline/).[`originY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`ownMatrixCache`](/api/classes/polyline/#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 @@ -1411,38 +1124,28 @@ Padding between object and its controlling borders (in pixels) [`Polyline`](/api/classes/polyline/).[`padding`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`paintFirst`](/api/classes/polyline/#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 @@ -1450,74 +1153,54 @@ Used to keep the original parent ref when the object has been added to an Active [`Polyline`](/api/classes/polyline/).[`parent`](/api/classes/polyline/#parent) -#### Defined in - -[src/shapes/Object/Object.ts:1636](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1636) - *** ### pathOffset > **pathOffset**: [`Point`](/api/classes/point/) +Defined in: [src/shapes/Polyline.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L90) + #### Inherited from [`Polyline`](/api/classes/polyline/).[`pathOffset`](/api/classes/polyline/#pathoffset) -#### Defined in - -[src/shapes/Polyline.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L91) - *** ### 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 [`Polyline`](/api/classes/polyline/).[`perPixelTargetFind`](/api/classes/polyline/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L83) - *** ### points > **points**: [`XY`](/api/interfaces/xy/)[] -Points array - -#### Default - -```ts +Defined in: [src/shapes/Polyline.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L49) -``` +Points array #### Inherited from [`Polyline`](/api/classes/polyline/).[`points`](/api/classes/polyline/#points) -#### Defined in - -[src/shapes/Polyline.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L50) - *** ### 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 @@ -1530,16 +1213,14 @@ Object scale factor (horizontal) [`Polyline`](/api/classes/polyline/).[`scaleX`](/api/classes/polyline/#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 @@ -1552,48 +1233,32 @@ Object scale factor (vertical) [`Polyline`](/api/classes/polyline/).[`scaleY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`selectable`](/api/classes/polyline/#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. ::: @@ -1602,16 +1267,14 @@ This API is no longer supported and may be removed in a future release. [`Polyline`](/api/classes/polyline/).[`selectionBackgroundColor`](/api/classes/polyline/#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 @@ -1624,16 +1287,14 @@ null [`Polyline`](/api/classes/polyline/).[`shadow`](/api/classes/polyline/#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 @@ -1646,16 +1307,14 @@ Angle of skew on x axes of an object (in degrees) [`Polyline`](/api/classes/polyline/).[`skewX`](/api/classes/polyline/#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 @@ -1668,32 +1327,28 @@ Angle of skew on y axes of an object (in degrees) [`Polyline`](/api/classes/polyline/).[`skewY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`snapAngle`](/api/classes/polyline/#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. @@ -1701,16 +1356,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`Polyline`](/api/classes/polyline/).[`snapThreshold`](/api/classes/polyline/#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/ @@ -1724,16 +1377,14 @@ null [`Polyline`](/api/classes/polyline/).[`stroke`](/api/classes/polyline/#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 @@ -1746,16 +1397,14 @@ null; [`Polyline`](/api/classes/polyline/).[`strokeDashArray`](/api/classes/polyline/#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 @@ -1768,30 +1417,26 @@ Line offset of an object's stroke [`Polyline`](/api/classes/polyline/).[`strokeDashOffset`](/api/classes/polyline/#strokedashoffset) -#### Defined in - -[src/shapes/Object/Object.ts:199](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L199) - *** ### strokeDiff > **strokeDiff**: [`Point`](/api/classes/point/) +Defined in: [src/shapes/Polyline.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L96) + #### Inherited from [`Polyline`](/api/classes/polyline/).[`strokeDiff`](/api/classes/polyline/#strokediff) -#### Defined in - -[src/shapes/Polyline.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L97) - *** ### 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 +1449,28 @@ butt [`Polyline`](/api/classes/polyline/).[`strokeLineCap`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`strokeLineJoin`](/api/classes/polyline/#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,30 +1483,26 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`Polyline`](/api/classes/polyline/).[`strokeMiterLimit`](/api/classes/polyline/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/Object.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L202) - *** ### strokeOffset > **strokeOffset**: [`Point`](/api/classes/point/) +Defined in: [src/shapes/Polyline.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L92) + #### Inherited from [`Polyline`](/api/classes/polyline/).[`strokeOffset`](/api/classes/polyline/#strokeoffset) -#### Defined in - -[src/shapes/Polyline.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L93) - *** ### 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 @@ -1897,16 +1528,14 @@ false [`Polyline`](/api/classes/polyline/).[`strokeUniform`](/api/classes/polyline/#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 @@ -1919,19 +1548,17 @@ Width of a stroke used to render this object [`Polyline`](/api/classes/polyline/).[`strokeWidth`](/api/classes/polyline/#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 @@ -1943,16 +1570,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`Polyline`](/api/classes/polyline/).[`top`](/api/classes/polyline/#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 @@ -1965,16 +1590,14 @@ Size of object's controlling corners when touch interaction is detected [`Polyline`](/api/classes/polyline/).[`touchCornerSize`](/api/classes/polyline/#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 @@ -1987,83 +1610,57 @@ true [`Polyline`](/api/classes/polyline/).[`transparentCorners`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`visible`](/api/classes/polyline/#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` +Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565) + Object width -#### Default - -```ts - -``` - -#### Inherited from +#### Inherited from [`Polyline`](/api/classes/polyline/).[`width`](/api/classes/polyline/#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 [Polyline.fromElement](../../../../api/classes/polyline/#fromelement)) +Defined in: [src/shapes/Polyline.ts:388](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L388) -#### Static - -#### Member Of - -Polyline +List of attribute names to account for when parsing SVG element (used by [Polyline.fromElement](/api/classes/polyline/#fromelement)) @see: http://www.w3.org/TR/SVG/shapes.html#PolylineElement #### Inherited from [`Polyline`](/api/classes/polyline/).[`ATTRIBUTE_NAMES`](/api/classes/polyline/#attribute_names) -#### Defined in - -[src/shapes/Polyline.ts:391](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L391) - *** ### cacheProperties > `static` **cacheProperties**: `string`[] +Defined in: [src/shapes/Polyline.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L94) + 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 @@ -2073,32 +1670,28 @@ and refreshed at the next render [`Polyline`](/api/classes/polyline/).[`cacheProperties`](/api/classes/polyline/#cacheproperties) -#### Defined in - -[src/shapes/Polyline.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L95) - *** ### 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 [`Polyline`](/api/classes/polyline/).[`colorProperties`](/api/classes/polyline/#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 @@ -2106,16 +1699,14 @@ instance.toObject() gets called [`Polyline`](/api/classes/polyline/).[`customProperties`](/api/classes/polyline/#customproperties) -#### Defined in - -[src/shapes/Object/Object.ts:1784](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1784) - *** ### layoutProperties > `static` **layoutProperties**: keyof [`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +Defined in: [src/shapes/Polyline.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L79) + A list of properties that if changed trigger a recalculation of dimensions #### Todo @@ -2126,30 +1717,26 @@ check if you really need to recalculate for all cases [`Polyline`](/api/classes/polyline/).[`layoutProperties`](/api/classes/polyline/#layoutproperties) -#### Defined in - -[src/shapes/Polyline.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L80) - *** ### ownDefaults > `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `polylineDefaultValues` +Defined in: [src/shapes/Polygon.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polygon.ts#L5) + #### Overrides [`Polyline`](/api/classes/polyline/).[`ownDefaults`](/api/classes/polyline/#owndefaults) -#### Defined in - -[src/shapes/Polygon.ts:5](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polygon.ts#L5) - *** ### 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 @@ -2158,16 +1745,14 @@ needs its cache regenerated during a .set call [`Polyline`](/api/classes/polyline/).[`stateProperties`](/api/classes/polyline/#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` = `'Polygon'` +Defined in: [src/shapes/Polygon.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polygon.ts#L7) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2181,22 +1766,22 @@ We do not do that in fabricJS code because we want to try to have code splitting [`Polyline`](/api/classes/polyline/).[`type`](/api/classes/polyline/#type) -#### Defined in - -[src/shapes/Polygon.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polygon.ts#L7) - ## 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 @@ -2204,23 +1789,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 -[`Polyline`](/api/classes/polyline/).[`type`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`type`](/api/classes/polyline/#type-1) ## Methods @@ -2228,15 +1819,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 @@ -2246,16 +1845,14 @@ Prepare clipPath state and cache and draw it on instance's cache [`Polyline`](/api/classes/polyline/).[`_drawClipPath`](/api/classes/polyline/#_drawclippath) -#### Defined in - -[src/shapes/Object/Object.ts:920](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L920) - *** ### \_getNonTransformedDimensions() > **\_getNonTransformedDimensions**(): [`Point`](/api/classes/point/) +Defined in: [src/shapes/Polyline.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L235) + stroke is taken in account in size #### Returns @@ -2266,51 +1863,44 @@ stroke is taken in account in size [`Polyline`](/api/classes/polyline/).[`_getNonTransformedDimensions`](/api/classes/polyline/#_getnontransformeddimensions) -#### Defined in - -[src/shapes/Polyline.ts:236](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L236) - *** ### \_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 [`Polyline`](/api/classes/polyline/).[`_limitCacheSize`](/api/classes/polyline/#_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 @@ -2321,26 +1911,28 @@ Remove cacheCanvas and its dimensions from the objects [`Polyline`](/api/classes/polyline/).[`_removeCacheCanvas`](/api/classes/polyline/#_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 @@ -2356,19 +1948,19 @@ move to interactivity [`Polyline`](/api/classes/polyline/).[`_renderControls`](/api/classes/polyline/#_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 @@ -2378,21 +1970,23 @@ move to interactivity [`Polyline`](/api/classes/polyline/).[`_setClippingProperties`](/api/classes/polyline/#_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`\<[`Polygon`](/api/classes/polygon/), `"fill"`\> +`CanvasRenderingContext2D` + +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2402,21 +1996,23 @@ move to interactivity [`Polyline`](/api/classes/polyline/).[`_setFillStyles`](/api/classes/polyline/#_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`\<[`Polygon`](/api/classes/polygon/), `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +##### decl + +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2426,22 +2022,22 @@ move to interactivity [`Polyline`](/api/classes/polyline/).[`_setStrokeStyles`](/api/classes/polyline/#_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 @@ -2453,16 +2049,14 @@ Rendering canvas context [`Polyline`](/api/classes/polyline/).[`_setupCompositeOperation`](/api/classes/polyline/#_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/Polyline.ts:325](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L325) + Returns svg representation of an instance #### Returns @@ -2476,19 +2070,19 @@ of the instance [`Polyline`](/api/classes/polyline/).[`_toSVG`](/api/classes/polyline/#_tosvg) -#### Defined in - -[src/shapes/Polyline.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L326) - *** ### 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 @@ -2498,33 +2092,37 @@ of the instance [`Polyline`](/api/classes/polyline/).[`addPaintOrder`](/api/classes/polyline/#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 @@ -2533,24 +2131,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 [`Polyline`](/api/classes/polyline/).[`animate`](/api/classes/polyline/#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. @@ -2562,16 +2158,14 @@ those never change with zoom or viewport changes. [`Polyline`](/api/classes/polyline/).[`calcACoords`](/api/classes/polyline/#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 @@ -2585,16 +2179,14 @@ is a public api and should be done just if extremely necessary [`Polyline`](/api/classes/polyline/).[`calcOCoords`](/api/classes/polyline/#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 @@ -2608,22 +2200,22 @@ transform matrix for the object [`Polyline`](/api/classes/polyline/).[`calcOwnMatrix`](/api/classes/polyline/#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. @@ -2638,21 +2230,21 @@ transform matrix for the object [`Polyline`](/api/classes/polyline/).[`calcTransformMatrix`](/api/classes/polyline/#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 @@ -2664,15 +2256,13 @@ true if the object currently dragged can be dropped on the target [`Polyline`](/api/classes/polyline/).[`canDrop`](/api/classes/polyline/#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. @@ -2681,7 +2271,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. @@ -2700,41 +2292,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue [`Polyline`](/api/classes/polyline/).[`clearContextTop`](/api/classes/polyline/#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`\<[`Polygon`](/api/classes/polygon/)\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Polygon`\> + +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`\<[`Polygon`](/api/classes/polygon/)\> +`Promise`\<`Polygon`\> #### Inherited from [`Polyline`](/api/classes/polyline/).[`clone`](/api/classes/polyline/#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. @@ -2745,13 +2335,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. @@ -2763,16 +2355,14 @@ fix the export type, it could not be Image but the type that getClass return for [`Polyline`](/api/classes/polyline/).[`cloneAsImage`](/api/classes/polyline/#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/Polyline.ts:378](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L378) + Returns complexity of an instance #### Returns @@ -2785,21 +2375,21 @@ complexity of this instance [`Polyline`](/api/classes/polyline/).[`complexity`](/api/classes/polyline/#complexity) -#### Defined in - -[src/shapes/Polyline.ts:379](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L379) - *** ### 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 @@ -2813,16 +2403,14 @@ true if point is inside the object [`Polyline`](/api/classes/polyline/).[`containsPoint`](/api/classes/polyline/#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` @@ -2834,15 +2422,13 @@ override if necessary to dispose artifacts such as `clipPath` [`Polyline`](/api/classes/polyline/).[`dispose`](/api/classes/polyline/#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 @@ -2850,15 +2436,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 @@ -2870,23 +2462,25 @@ object to override the object style [`Polyline`](/api/classes/polyline/).[`drawBorders`](/api/classes/polyline/#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 @@ -2898,27 +2492,31 @@ Context to render on [`Polyline`](/api/classes/polyline/).[`drawCacheOnCanvas`](/api/classes/polyline/#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 @@ -2928,16 +2526,14 @@ Context to render on [`Polyline`](/api/classes/polyline/).[`drawClipPathOnCache`](/api/classes/polyline/#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 @@ -2947,11 +2543,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 @@ -2963,27 +2563,29 @@ object to override the object style [`Polyline`](/api/classes/polyline/).[`drawControls`](/api/classes/polyline/#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 @@ -2995,29 +2597,33 @@ object size x = width, y = height [`Polyline`](/api/classes/polyline/).[`drawControlsConnectingLines`](/api/classes/polyline/#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 @@ -3029,16 +2635,14 @@ additional context for rendering [`Polyline`](/api/classes/polyline/).[`drawObject`](/api/classes/polyline/#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 @@ -3046,7 +2650,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3064,25 +2670,27 @@ it seemed a good option, now is an edge case [`Polyline`](/api/classes/polyline/).[`drawSelectionBackground`](/api/classes/polyline/#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* [`Polygon`](/api/classes/polygon/) +##### T + +`T` *extends* `Polygon` #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3094,29 +2702,33 @@ an object that represent the ancestry situation. [`Polyline`](/api/classes/polyline/).[`findCommonAncestors`](/api/classes/polyline/#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* keyof [`ObjectEvents`](/api/interfaces/objectevents/) +##### K + +`K` *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) #### Parameters -• **eventName**: `K` +##### eventName + +`K` Event name to fire -• **options?**: [`ObjectEvents`](/api/interfaces/objectevents/)\[`K`\] +##### options? + +[`ObjectEvents`](/api/interfaces/objectevents/)\[`K`\] Options object @@ -3128,22 +2740,22 @@ Options object [`Polyline`](/api/classes/polyline/).[`fire`](/api/classes/polyline/#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 @@ -3155,21 +2767,21 @@ function to iterate over the controls over [`Polyline`](/api/classes/polyline/).[`forEachControl`](/api/classes/polyline/#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 @@ -3183,34 +2795,30 @@ value of a property [`Polyline`](/api/classes/polyline/).[`get`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`getActiveControl`](/api/classes/polyline/#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` @@ -3221,16 +2829,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top [`Polyline`](/api/classes/polyline/).[`getAncestors`](/api/classes/polyline/#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. @@ -3244,16 +2850,14 @@ Object with left, top, width, height properties [`Polyline`](/api/classes/polyline/).[`getBoundingRect`](/api/classes/polyline/#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` @@ -3262,16 +2866,14 @@ Object with left, top, width, height properties [`Polyline`](/api/classes/polyline/).[`getCanvasRetinaScaling`](/api/classes/polyline/#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 @@ -3282,16 +2884,14 @@ Returns the center coordinates of the object relative to canvas [`Polyline`](/api/classes/polyline/).[`getCenterPoint`](/api/classes/polyline/#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/)[] @@ -3302,16 +2902,14 @@ Returns the center coordinates of the object relative to canvas [`Polyline`](/api/classes/polyline/).[`getCoords`](/api/classes/polyline/#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 @@ -3322,16 +2920,14 @@ Return the object opacity counting also the group property [`Polyline`](/api/classes/polyline/).[`getObjectOpacity`](/api/classes/polyline/#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 @@ -3342,16 +2938,14 @@ Return the object scale factor counting also the group scaling [`Polyline`](/api/classes/polyline/).[`getObjectScaling`](/api/classes/polyline/#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 @@ -3361,11 +2955,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' @@ -3377,16 +2975,14 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`getPointByOrigin`](/api/classes/polyline/#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 @@ -3397,78 +2993,70 @@ Returns the center coordinates of the object relative to it's parent [`Polyline`](/api/classes/polyline/).[`getRelativeCenterPoint`](/api/classes/polyline/#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/polygon/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/polygon/#getx) #### Inherited from [`Polyline`](/api/classes/polyline/).[`getRelativeX`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`getRelativeXY`](/api/classes/polyline/#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/polygon/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/polygon/#gety) #### Inherited from [`Polyline`](/api/classes/polyline/).[`getRelativeY`](/api/classes/polyline/#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 @@ -3485,16 +3073,14 @@ shouldn't this account for group transform and return the actual size in canvas [`Polyline`](/api/classes/polyline/).[`getScaledHeight`](/api/classes/polyline/#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 @@ -3511,21 +3097,21 @@ shouldn't this account for group transform and return the actual size in canvas [`Polyline`](/api/classes/polyline/).[`getScaledWidth`](/api/classes/polyline/#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 @@ -3535,21 +3121,21 @@ Returns id attribute for svg output [`Polyline`](/api/classes/polyline/).[`getSvgCommons`](/api/classes/polyline/#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 @@ -3559,23 +3145,25 @@ Returns filter for svg shadow [`Polyline`](/api/classes/polyline/).[`getSvgFilter`](/api/classes/polyline/#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?**: `boolean` +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -3587,25 +3175,29 @@ a boolean to skip shadow filter output [`Polyline`](/api/classes/polyline/).[`getSvgStyles`](/api/classes/polyline/#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 @@ -3615,16 +3207,14 @@ Returns transform-string for svg-export [`Polyline`](/api/classes/polyline/).[`getSvgTransform`](/api/classes/polyline/#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 @@ -3635,16 +3225,14 @@ Returns the object angle relative to canvas counting also the group property [`Polyline`](/api/classes/polyline/).[`getTotalAngle`](/api/classes/polyline/#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 @@ -3657,16 +3245,14 @@ object with scaleX and scaleY properties [`Polyline`](/api/classes/polyline/).[`getTotalObjectScaling`](/api/classes/polyline/#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 @@ -3677,83 +3263,79 @@ Retrieves viewportTransform from Object's canvas if available [`Polyline`](/api/classes/polyline/).[`getViewportTransform`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`getX`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`getXY`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`getY`](/api/classes/polyline/#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* [`Polygon`](/api/classes/polygon/) +##### T + +`T` *extends* `Polygon` #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3763,15 +3345,13 @@ y position according to object's [originY](/api/api/classes/fabricobject/originy [`Polyline`](/api/classes/polyline/).[`hasCommonAncestors`](/api/classes/polyline/#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 @@ -3782,7 +3362,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3794,15 +3374,13 @@ Boolean [`Polyline`](/api/classes/polyline/).[`hasFill`](/api/classes/polyline/#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 @@ -3813,7 +3391,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3825,21 +3403,21 @@ Boolean [`Polyline`](/api/classes/polyline/).[`hasStroke`](/api/classes/polyline/#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 @@ -3853,23 +3431,25 @@ true if object intersects with another object [`Polyline`](/api/classes/polyline/).[`intersectsWithObject`](/api/classes/polyline/#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**: [`Point`](/api/classes/point/) +##### br + +[`Point`](/api/classes/point/) #### Returns @@ -3879,21 +3459,24 @@ Checks if object intersects with the scene rect formed by tl and br [`Polyline`](/api/classes/polyline/).[`intersectsWithRect`](/api/classes/polyline/#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. @@ -3906,21 +3489,21 @@ on parent canvas. [`Polyline`](/api/classes/polyline/).[`isCacheDirty`](/api/classes/polyline/#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 @@ -3934,23 +3517,25 @@ true if object is fully contained within area of another object [`Polyline`](/api/classes/polyline/).[`isContainedWithinObject`](/api/classes/polyline/#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 @@ -3960,21 +3545,21 @@ Checks if object is fully contained within the scene rect formed by tl and br [`Polyline`](/api/classes/polyline/).[`isContainedWithinRect`](/api/classes/polyline/#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. @@ -3989,22 +3574,22 @@ true if the specified control is visible, false otherwise [`Polyline`](/api/classes/polyline/).[`isControlVisible`](/api/classes/polyline/#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 @@ -4014,23 +3599,25 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai [`Polyline`](/api/classes/polyline/).[`isDescendantOf`](/api/classes/polyline/#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* [`Polygon`](/api/classes/polygon/) +##### T + +`T` *extends* `Polygon` #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -4044,16 +3631,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`Polyline`](/api/classes/polyline/).[`isInFrontOf`](/api/classes/polyline/#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` @@ -4062,16 +3649,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`Polyline`](/api/classes/polyline/).[`isNotVisible`](/api/classes/polyline/#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 @@ -4085,23 +3670,25 @@ true if object is fully or partially contained within canvas [`Polyline`](/api/classes/polyline/).[`isOnScreen`](/api/classes/polyline/#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 @@ -4111,16 +3698,14 @@ true if object is fully or partially contained within canvas [`Polyline`](/api/classes/polyline/).[`isOverlapping`](/api/classes/polyline/#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 @@ -4133,41 +3718,51 @@ true if object is partially contained within canvas [`Polyline`](/api/classes/polyline/).[`isPartiallyOnScreen`](/api/classes/polyline/#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 [`Polyline`](/api/classes/polyline/).[`isType`](/api/classes/polyline/#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 @@ -4183,18 +3778,16 @@ Boolean [`Polyline`](/api/classes/polyline/).[`needsItsOwnCache`](/api/classes/polyline/#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 @@ -4205,11 +3798,15 @@ This API is no longer supported and may be removed in a future release. ##### Type Parameters -• **K** *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) +###### K + +`K` *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) ##### Parameters -• **eventName**: `K` +###### eventName + +`K` event name (eg. 'after:render') @@ -4221,27 +3818,31 @@ event name (eg. 'after:render') [`Polyline`](/api/classes/polyline/).[`off`](/api/classes/polyline/#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 [`ObjectEvents`](/api/interfaces/objectevents/) +###### K + +`K` *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) ##### Parameters -• **eventName**: `K` +###### eventName + +`K` event name (eg. 'after:render') -• **handler**: `TEventCallback`\<`any`\> +###### handler + +`TEventCallback` event listener to unsubscribe @@ -4253,19 +3854,19 @@ event listener to unsubscribe [`Polyline`](/api/classes/polyline/).[`off`](/api/classes/polyline/#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`\<[`ObjectEvents`](/api/interfaces/objectevents/)\> +###### handlers + +`EventRegistryObject`\<`EventSpec`\> handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) @@ -4277,14 +3878,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han [`Polyline`](/api/classes/polyline/).[`off`](/api/classes/polyline/#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 @@ -4295,33 +3894,39 @@ unsubscribe all event listeners [`Polyline`](/api/classes/polyline/).[`off`](/api/classes/polyline/#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 [`ObjectEvents`](/api/interfaces/objectevents/) +###### K + +`K` *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) -• **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/)\> +###### 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/) \| [`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 @@ -4339,106 +3944,140 @@ on [`Polyline`](/api/classes/polyline/).[`on`](/api/classes/polyline/#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`\<[`ObjectEvents`](/api/interfaces/objectevents/)\> +###### handlers + +`EventRegistryObject`\<`EventSpec`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) ##### Returns `VoidFunction` +disposer + +##### Alias + +on + ##### Inherited from [`Polyline`](/api/classes/polyline/).[`on`](/api/classes/polyline/#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* keyof [`ObjectEvents`](/api/interfaces/objectevents/) -• **\_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` *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/) \| [`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/); \} -#### Returns +##### Parameters -`boolean` +###### eventName -#### Inherited from +`K` -[`Polyline`](/api/classes/polyline/).[`onDeselect`](/api/classes/polyline/#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` +[`Polyline`](/api/classes/polyline/).[`once`](/api/classes/polyline/#once) -true to handle the drag event +#### Call Signature -#### Inherited from +> **once**(`handlers`): `VoidFunction` -[`Polyline`](/api/classes/polyline/).[`onDragStart`](/api/classes/polyline/#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 + +[`Polyline`](/api/classes/polyline/).[`once`](/api/classes/polyline/#once) *** -### onSelect() +### onDeselect() + +> **onDeselect**(`_options?`): `boolean` -> **onSelect**(`_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 @@ -4446,75 +4085,65 @@ event if the process is generated by an event #### Inherited from -[`Polyline`](/api/classes/polyline/).[`onSelect`](/api/classes/polyline/#onselect) - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672) +[`Polyline`](/api/classes/polyline/).[`onDeselect`](/api/classes/polyline/#ondeselect) *** -### once() - -#### once(eventName, handler) - -> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction` - -Observes specified event **once** - -##### Type Parameters +### onDragStart() -• **K** *extends* keyof [`ObjectEvents`](/api/interfaces/objectevents/) +> **onDragStart**(`_e`): `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/)\> +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 +[`Polyline`](/api/classes/polyline/).[`onDragStart`](/api/classes/polyline/#ondragstart) -once +*** -##### Inherited from +### onSelect() -[`Polyline`](/api/classes/polyline/).[`once`](/api/classes/polyline/#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`\<[`ObjectEvents`](/api/interfaces/objectevents/)\> +###### e? -##### Returns +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -`VoidFunction` +event if the process is generated by an event -##### Inherited from +#### Returns -[`Polyline`](/api/classes/polyline/).[`once`](/api/classes/polyline/#once) +`boolean` -##### Defined in +#### Inherited from -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +[`Polyline`](/api/classes/polyline/).[`onSelect`](/api/classes/polyline/#onselect) *** @@ -4522,11 +4151,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 @@ -4538,21 +4171,23 @@ Context to render on [`Polyline`](/api/classes/polyline/).[`render`](/api/classes/polyline/#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 @@ -4562,23 +4197,23 @@ Context to render on [`Polyline`](/api/classes/polyline/).[`renderCache`](/api/classes/polyline/#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 @@ -4588,16 +4223,14 @@ example: render the selection status for the part of text that is being dragged [`Polyline`](/api/classes/polyline/).[`renderDragSourceEffect`](/api/classes/polyline/#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 @@ -4605,7 +4238,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4615,21 +4250,21 @@ object will change when dropping. example: show the cursor where the text is abo [`Polyline`](/api/classes/polyline/).[`renderDropTargetEffect`](/api/classes/polyline/#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) @@ -4641,21 +4276,21 @@ Angle value (in degrees) [`Polyline`](/api/classes/polyline/).[`rotate`](/api/classes/polyline/#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 @@ -4667,21 +4302,21 @@ Scale factor [`Polyline`](/api/classes/polyline/).[`scale`](/api/classes/polyline/#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 @@ -4693,21 +4328,21 @@ New height value [`Polyline`](/api/classes/polyline/).[`scaleToHeight`](/api/classes/polyline/#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 @@ -4719,49 +4354,51 @@ New width value [`Polyline`](/api/classes/polyline/).[`scaleToWidth`](/api/classes/polyline/#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`?): [`Polygon`](/api/classes/polygon/) +> **set**(`key`, `value?`): `Polygon` + +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 -[`Polygon`](/api/classes/polygon/) +`Polygon` #### Inherited from [`Polyline`](/api/classes/polyline/).[`set`](/api/classes/polyline/#set) -#### Defined in - -[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29) - *** ### setBoundingBox() -> **setBoundingBox**(`adjustPosition`?): `void` +> **setBoundingBox**(`adjustPosition?`): `void` + +Defined in: [src/shapes/Polyline.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L213) #### Parameters -• **adjustPosition?**: `boolean` +##### adjustPosition? + +`boolean` #### Returns @@ -4771,72 +4408,70 @@ Property value (if function, the value is passed into it and its return value is [`Polyline`](/api/classes/polyline/).[`setBoundingBox`](/api/classes/polyline/#setboundingbox) -#### Defined in - -[src/shapes/Polyline.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L214) - *** -### 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 +[`Polyline`](/api/classes/polyline/).[`setControlsVisibility`](/api/classes/polyline/#setcontrolsvisibility) -#### Inherited from +*** -[`Polyline`](/api/classes/polyline/).[`setControlVisible`](/api/classes/polyline/#setcontrolvisible) +### setControlVisible() + +> **setControlVisible**(`controlKey`, `visible`): `void` -#### Defined in +Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599) -[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/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 -[`Polyline`](/api/classes/polyline/).[`setControlsVisibility`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`setControlVisible`](/api/classes/polyline/#setcontrolvisible) *** @@ -4844,8 +4479,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 @@ -4855,16 +4492,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https:// [`Polyline`](/api/classes/polyline/).[`setCoords`](/api/classes/polyline/#setcoords) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343) - *** ### setDimensions() > **setDimensions**(): `void` +Defined in: [src/shapes/Polyline.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L209) + #### Returns `void` @@ -4873,16 +4508,14 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https:// [`Polyline`](/api/classes/polyline/).[`setDimensions`](/api/classes/polyline/#setdimensions) -#### Defined in - -[src/shapes/Polyline.ts:210](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L210) - *** ### 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 @@ -4896,29 +4529,33 @@ Travis build error about unused variables. [`Polyline`](/api/classes/polyline/).[`setOnGroup`](/api/classes/polyline/#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' @@ -4930,22 +4567,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`setPositionByOrigin`](/api/classes/polyline/#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/polygon/#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/polygon/#setx) #### Returns @@ -4955,29 +4592,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas [`Polyline`](/api/classes/polyline/).[`setRelativeX`](/api/classes/polyline/#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/polygon/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/polygon/#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' @@ -4989,22 +4630,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`setRelativeXY`](/api/classes/polyline/#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/polygon/#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/polygon/#sety) #### Returns @@ -5014,21 +4655,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl [`Polyline`](/api/classes/polyline/).[`setRelativeY`](/api/classes/polyline/#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 @@ -5038,15 +4679,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/ [`Polyline`](/api/classes/polyline/).[`setX`](/api/classes/polyline/#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, @@ -5054,15 +4693,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' @@ -5080,21 +4725,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). [`Polyline`](/api/classes/polyline/).[`setXY`](/api/classes/polyline/#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 @@ -5104,20 +4749,18 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ [`Polyline`](/api/classes/polyline/).[`setY`](/api/classes/polyline/#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. @@ -5129,22 +4772,22 @@ Read as: cache if is needed, or if the feature is enabled but we are not already [`Polyline`](/api/classes/polyline/).[`shouldCache`](/api/classes/polyline/#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 @@ -5156,25 +4799,27 @@ true in order for the window to start a drag session [`Polyline`](/api/classes/polyline/).[`shouldStartDragging`](/api/classes/polyline/#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 @@ -5186,9 +4831,27 @@ the control box size used [`Polyline`](/api/classes/polyline/).[`strokeBorders`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`toBlob`](/api/classes/polyline/#toblob) *** @@ -5196,11 +4859,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 @@ -5214,23 +4881,25 @@ Returns DOM element with the FabricObject [`Polyline`](/api/classes/polyline/).[`toCanvasElement`](/api/classes/polyline/#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. @@ -5244,9 +4913,33 @@ svg representation of an instance [`Polyline`](/api/classes/polyline/).[`toClipPathSVG`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`toDatalessObject`](/api/classes/polyline/#todatalessobject) *** @@ -5254,11 +4947,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 @@ -5272,37 +4969,31 @@ Returns a data: URL containing a representation of the object in the format spec [`Polyline`](/api/classes/polyline/).[`toDataURL`](/api/classes/polyline/#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`): `Polygon` -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 +`Polygon` #### Inherited from -[`Polyline`](/api/classes/polyline/).[`toDatalessObject`](/api/classes/polyline/#todatalessobject) - -#### Defined in - -[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884) +[`Polyline`](/api/classes/polyline/).[`toggle`](/api/classes/polyline/#toggle) *** @@ -5310,6 +5001,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 @@ -5322,27 +5015,31 @@ JSON [`Polyline`](/api/classes/polyline/).[`toJSON`](/api/classes/polyline/#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`\> & [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) +> **toObject**\<`T`, `K`\>(`propertiesToInclude?`): `Pick`\<`T`, `K`\> & [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) + +Defined in: [src/shapes/Polyline.ts:310](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L310) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Polygon`](/api/classes/polygon/)\>, keyof [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> +##### T + +`T` *extends* `Omit`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Polygon`\>, keyof [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> -• **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 @@ -5356,46 +5053,14 @@ Object representation of an instance [`Polyline`](/api/classes/polyline/).[`toObject`](/api/classes/polyline/#toobject) -#### Defined in - -[src/shapes/Polyline.ts:311](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L311) - -*** - -### 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 - -[`Polyline`](/api/classes/polyline/).[`toSVG`](/api/classes/polyline/#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 @@ -5406,35 +5071,37 @@ Returns a string representation of an instance [`Polyline`](/api/classes/polyline/).[`toString`](/api/classes/polyline/#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`): [`Polygon`](/api/classes/polygon/) +> **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? -[`Polygon`](/api/classes/polygon/) +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -#### Inherited from +Method for further parsing of svg representation. -[`Polyline`](/api/classes/polyline/).[`toggle`](/api/classes/polyline/#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) +[`Polyline`](/api/classes/polyline/).[`toSVG`](/api/classes/polyline/#tosvg) *** @@ -5442,11 +5109,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 @@ -5458,19 +5129,19 @@ Context [`Polyline`](/api/classes/polyline/).[`transform`](/api/classes/polyline/#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 @@ -5480,29 +5151,33 @@ Context [`Polyline`](/api/classes/polyline/).[`transformMatrixKey`](/api/classes/polyline/#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' @@ -5514,37 +5189,45 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`translateToCenterPoint`](/api/classes/polyline/#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' @@ -5556,29 +5239,33 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`translateToGivenOrigin`](/api/classes/polyline/#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' @@ -5590,16 +5277,14 @@ Vertical origin: 'top', 'center' or 'bottom' [`Polyline`](/api/classes/polyline/).[`translateToOriginPoint`](/api/classes/polyline/#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 @@ -5615,25 +5300,29 @@ This API is no longer supported and may be removed in a future release. [`Polyline`](/api/classes/polyline/).[`willDrawShadow`](/api/classes/polyline/#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 @@ -5643,16 +5332,14 @@ This API is no longer supported and may be removed in a future release. [`Polyline`](/api/classes/polyline/).[`_fromObject`](/api/classes/polyline/#_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 @@ -5669,63 +5356,63 @@ make this function return an empty object and add controls to the ownDefaults [`Polyline`](/api/classes/polyline/).[`createControls`](/api/classes/polyline/#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`\<[`Polyline`](/api/classes/polyline/)\<`object`, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<[`Polyline`](/api/classes/polyline/)\<\{ `signal?`: `AbortSignal`; \}, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Polyline.ts:395](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L395) Returns Polyline instance from an SVG element #### Parameters -• **element**: `HTMLElement` +##### element Element to parser -• **options?**: [`Abortable`](/api/type-aliases/abortable/) +`HTMLElement` | `SVGElement` -Options object +##### options? -• **cssRules?**: `CSSRules` +[`Abortable`](/api/type-aliases/abortable/) -#### Returns +Options object -`Promise`\<[`Polyline`](/api/classes/polyline/)\<`object`, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +##### cssRules? -#### Static +`CSSRules` -#### Member Of +#### Returns -Polyline +`Promise`\<[`Polyline`](/api/classes/polyline/)\<\{ `signal?`: `AbortSignal`; \}, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> #### Inherited from [`Polyline`](/api/classes/polyline/).[`fromElement`](/api/classes/polyline/#fromelement) -#### Defined in - -[src/shapes/Polyline.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L400) - *** ### fromObject() > `static` **fromObject**\<`T`\>(`object`): `Promise`\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +Defined in: [src/shapes/Polyline.ts:421](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L421) + Returns Polyline instance from an object representation #### Type Parameters -• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> +##### T + +`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> #### Parameters -• **object**: `T` +##### object + +`T` Object to create an instance from @@ -5733,26 +5420,18 @@ Object to create an instance from `Promise`\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> -#### Static - -#### Member Of - -Polyline - #### Inherited from [`Polyline`](/api/classes/polyline/).[`fromObject`](/api/classes/polyline/#fromobject) -#### Defined in - -[src/shapes/Polyline.ts:428](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L428) - *** ### getDefaults() > `static` **getDefaults**(): `Record`\<`string`, `any`\> +Defined in: [src/shapes/Polyline.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L68) + #### Returns `Record`\<`string`, `any`\> @@ -5760,7 +5439,3 @@ Polyline #### Inherited from [`Polyline`](/api/classes/polyline/).[`getDefaults`](/api/classes/polyline/#getdefaults) - -#### Defined in - -[src/shapes/Polyline.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L69) diff --git a/src/content/docs/api/classes/Polyline.md b/src/content/docs/api/classes/Polyline.md index 2ba447e98..2064b5e50 100644 --- a/src/content/docs/api/classes/Polyline.md +++ b/src/content/docs/api/classes/Polyline.md @@ -5,87 +5,9 @@ prev: false title: "Polyline" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Polyline.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L40) -## 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 @@ -97,33 +19,45 @@ drop ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> -• **SProps** *extends* [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) = [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) +### SProps -• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) +`SProps` *extends* [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) = [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/) + +### EventSpec + +`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) ## Constructors -### new Polyline() +### Constructor -> **new Polyline**\<`Props`, `SProps`, `EventSpec`\>(`points`, `options`?): [`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +> **new Polyline**\<`Props`, `SProps`, `EventSpec`\>(`points`, `options?`): `Polyline`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/Polyline.ts:117](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L117) Constructor #### Parameters -• **points**: [`XY`](/api/interfaces/xy/)[] = `[]` +##### points + +[`XY`](/api/interfaces/xy/)[] = `[]` Array of points (where each point is an object with x and y) -• **options?**: `Props` = `...` +##### options? + +`Props` = `...` Options object #### Returns -[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +`Polyline`\<`Props`, `SProps`, `EventSpec`\> thisArg @@ -146,11 +80,7 @@ var poly = new Polyline([ #### Overrides -[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors) - -#### Defined in - -[src/shapes/Polyline.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L118) +[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructor) ## Properties @@ -158,6 +88,8 @@ var poly = new Polyline([ > `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 @@ -168,16 +100,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 @@ -186,16 +116,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. @@ -210,37 +138,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/polyline/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/polyline/#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 @@ -258,9 +163,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) -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +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/polyline/#setcoords). +You can calculate them without updating with [()](/api/classes/polyline/#calcacoords) + +#### Inherited from + +[`FabricObject`](/api/classes/fabricobject/).[`aCoords`](/api/classes/fabricobject/#acoords) *** @@ -268,6 +188,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 @@ -280,39 +202,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 @@ -325,16 +237,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 @@ -345,16 +255,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 @@ -367,20 +275,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 @@ -392,16 +299,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 @@ -412,26 +317,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. @@ -439,26 +336,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. @@ -468,16 +357,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. @@ -485,16 +372,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 @@ -502,16 +387,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 @@ -524,16 +407,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 @@ -550,16 +431,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 @@ -572,16 +451,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 @@ -598,20 +475,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 @@ -622,24 +501,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) - *** ### 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 @@ -653,56 +526,42 @@ 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 #### 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) - *** ### ~~exactBoundingBox~~ > **exactBoundingBox**: `boolean` +Defined in: [src/shapes/Polyline.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L60) + WARNING: Feature in progress Calculate the exact bounding box taking in account strokeWidth on acute angles this will be turned to true by default on fabric 6.0 maybe will be left in as an optimization since calculations may be slow -#### Default - -```ts -false -``` - :::caution[Deprecated] transient option soon to be removed in favor of a different design ::: -#### Defined in +#### Default -[src/shapes/Polyline.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L61) +```ts +false +``` *** @@ -710,32 +569,26 @@ transient option soon to be removed in favor of a different design > **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/ @@ -749,16 +602,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) @@ -773,16 +624,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 @@ -795,16 +644,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 @@ -817,60 +664,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 @@ -883,38 +712,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 @@ -927,38 +746,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 @@ -973,16 +782,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. @@ -990,19 +797,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 @@ -1014,208 +819,140 @@ 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 #### 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) - *** ### 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 [`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 @@ -1228,16 +965,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 @@ -1250,16 +985,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. @@ -1276,35 +1009,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 @@ -1323,9 +1035,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) *** @@ -1333,6 +1058,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 @@ -1345,16 +1072,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 ::: @@ -1363,16 +1088,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 ::: @@ -1381,32 +1104,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 @@ -1419,38 +1138,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 @@ -1458,19 +1167,13 @@ 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) - *** ### pathOffset > **pathOffset**: [`Point`](/api/classes/point/) -#### Defined in - -[src/shapes/Polyline.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L91) +Defined in: [src/shapes/Polyline.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L90) *** @@ -1478,39 +1181,23 @@ 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 #### 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) - *** ### points > **points**: [`XY`](/api/interfaces/xy/)[] -Points array - -#### Default - -```ts - -``` - -#### Defined in +Defined in: [src/shapes/Polyline.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L49) -[src/shapes/Polyline.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L50) +Points array *** @@ -1518,6 +1205,8 @@ Points array > **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 @@ -1530,16 +1219,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 @@ -1552,48 +1239,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. ::: @@ -1602,16 +1273,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 @@ -1624,16 +1293,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 @@ -1646,16 +1313,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 @@ -1668,32 +1333,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. @@ -1701,16 +1362,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/ @@ -1724,16 +1383,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 @@ -1746,16 +1403,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 @@ -1768,19 +1423,13 @@ 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) - *** ### strokeDiff > **strokeDiff**: [`Point`](/api/classes/point/) -#### Defined in - -[src/shapes/Polyline.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L97) +Defined in: [src/shapes/Polyline.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L96) *** @@ -1788,6 +1437,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 @@ -1800,38 +1451,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 @@ -1844,19 +1485,13 @@ 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) - *** ### strokeOffset > **strokeOffset**: [`Point`](/api/classes/point/) -#### Defined in - -[src/shapes/Polyline.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L93) +Defined in: [src/shapes/Polyline.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L92) *** @@ -1864,6 +1499,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 @@ -1889,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 @@ -1911,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 @@ -1935,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 @@ -1957,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 @@ -1979,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` +Defined in: [src/shapes/Object/ObjectGeometry.ts:565](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/ObjectGeometry.ts#L565) + Object width -#### Default - -```ts - -``` - -#### Inherited from +#### 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 [Polyline.fromElement](../../../../api/classes/polyline/#fromelement)) - -#### Static +Defined in: [src/shapes/Polyline.ts:388](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L388) -#### Member Of - -Polyline +List of attribute names to account for when parsing SVG element (used by [Polyline.fromElement](/api/classes/polyline/#fromelement)) @see: http://www.w3.org/TR/SVG/shapes.html#PolylineElement -#### Defined in - -[src/shapes/Polyline.ts:391](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L391) - *** ### cacheProperties > `static` **cacheProperties**: `string`[] +Defined in: [src/shapes/Polyline.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L94) + 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 @@ -2061,32 +1664,28 @@ and refreshed at the next render [`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties) -#### Defined in - -[src/shapes/Polyline.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L95) - *** ### 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 @@ -2094,15 +1693,13 @@ 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) - *** ### layoutProperties -> `static` **layoutProperties**: keyof [`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +> `static` **layoutProperties**: keyof `Polyline`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] + +Defined in: [src/shapes/Polyline.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L79) A list of properties that if changed trigger a recalculation of dimensions @@ -2110,30 +1707,26 @@ A list of properties that if changed trigger a recalculation of dimensions check if you really need to recalculate for all cases -#### Defined in - -[src/shapes/Polyline.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L80) - *** ### ownDefaults -> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `polylineDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Polyline`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `polylineDefaultValues` + +Defined in: [src/shapes/Polyline.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L64) #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults) -#### Defined in - -[src/shapes/Polyline.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L65) - *** ### 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 @@ -2142,16 +1735,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` = `'Polyline'` +Defined in: [src/shapes/Polyline.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L66) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2165,22 +1756,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/Polyline.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L67) - ## 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 @@ -2188,23 +1779,29 @@ add sustainable warning message This API is no longer supported and may be removed in a future release. ::: -> `set` **type**(`value`): `void` +##### Returns + +`string` -#### Parameters +#### Set Signature -• **value**: `string` +> **set** **type**(`value`): `void` -#### Returns +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 @@ -2212,15 +1809,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 @@ -2230,16 +1835,14 @@ 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) - *** ### \_getNonTransformedDimensions() > **\_getNonTransformedDimensions**(): [`Point`](/api/classes/point/) +Defined in: [src/shapes/Polyline.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L235) + stroke is taken in account in size #### Returns @@ -2250,51 +1853,44 @@ stroke is taken in account in size `FabricObject._getNonTransformedDimensions` -#### Defined in - -[src/shapes/Polyline.ts:236](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L236) - *** ### \_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 @@ -2305,26 +1901,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 @@ -2340,19 +1938,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 @@ -2362,21 +1960,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`\<[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2386,21 +1986,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`\<[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +`CanvasRenderingContext2D` + +##### decl + +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2410,22 +2012,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 @@ -2437,16 +2039,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/Polyline.ts:325](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L325) + Returns svg representation of an instance #### Returns @@ -2460,19 +2060,19 @@ of the instance [`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg) -#### Defined in - -[src/shapes/Polyline.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L326) - *** ### 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 @@ -2482,33 +2082,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 @@ -2517,24 +2121,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. @@ -2546,16 +2148,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 @@ -2569,16 +2169,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 @@ -2592,22 +2190,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. @@ -2622,21 +2220,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 @@ -2648,15 +2246,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. @@ -2665,7 +2261,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. @@ -2684,41 +2282,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`\<[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Polyline`\<`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`\<[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Polyline`\<`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. @@ -2729,13 +2325,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. @@ -2747,16 +2345,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/Polyline.ts:378](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L378) + Returns complexity of an instance #### Returns @@ -2769,21 +2365,21 @@ complexity of this instance [`FabricObject`](/api/classes/fabricobject/).[`complexity`](/api/classes/fabricobject/#complexity) -#### Defined in - -[src/shapes/Polyline.ts:379](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L379) - *** ### 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 @@ -2797,16 +2393,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` @@ -2818,15 +2412,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 @@ -2834,15 +2426,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 @@ -2854,23 +2452,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 -• **ctx**: `CanvasRenderingContext2D` +`CanvasRenderingContext2D` Context to render on @@ -2882,27 +2482,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 -• **canvasWithClipPath**: `HTMLCanvasElement` +[`BaseFabricObject`](/api/classes/basefabricobject/) + +##### canvasWithClipPath + +`HTMLCanvasElement` #### Returns @@ -2912,16 +2516,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 @@ -2931,11 +2533,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 @@ -2947,27 +2553,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 @@ -2979,29 +2587,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 @@ -3013,16 +2625,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 @@ -3030,7 +2640,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3048,25 +2660,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* [`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Polyline`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3078,29 +2692,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 @@ -3112,22 +2730,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 @@ -3139,21 +2757,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 @@ -3167,34 +2785,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` @@ -3205,16 +2819,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. @@ -3228,16 +2840,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` @@ -3246,16 +2856,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 @@ -3266,16 +2874,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/)[] @@ -3286,16 +2892,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 @@ -3306,16 +2910,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 @@ -3326,16 +2928,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 @@ -3345,11 +2945,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' @@ -3361,16 +2965,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 @@ -3381,78 +2983,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/polyline/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/polyline/#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/polyline/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/polyline/#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 @@ -3469,16 +3063,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 @@ -3495,21 +3087,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 @@ -3519,21 +3111,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 @@ -3543,23 +3135,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?**: `boolean` +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -3571,25 +3165,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/)\> + +##### full? + +`boolean` -• **additionalTransform?**: `string` = `''` +##### additionalTransform? + +`string` = `''` #### Returns @@ -3599,16 +3197,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 @@ -3619,16 +3215,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 @@ -3641,16 +3235,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 @@ -3661,83 +3253,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* [`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Polyline`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3747,15 +3335,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 @@ -3766,7 +3352,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3778,15 +3364,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 @@ -3797,7 +3381,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3809,21 +3393,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 @@ -3837,23 +3421,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 @@ -3863,21 +3449,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. @@ -3890,21 +3479,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 @@ -3918,23 +3507,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**: [`Point`](/api/classes/point/) +##### br + +[`Point`](/api/classes/point/) #### Returns @@ -3944,21 +3535,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. @@ -3973,22 +3564,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 @@ -3998,23 +3589,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* [`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Polyline`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -4028,16 +3621,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` @@ -4046,16 +3639,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 @@ -4069,23 +3660,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 @@ -4095,16 +3688,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 @@ -4117,41 +3708,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 @@ -4167,18 +3768,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 @@ -4189,11 +3788,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') @@ -4205,27 +3808,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 @@ -4237,19 +3844,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}) @@ -4261,14 +3868,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 @@ -4279,33 +3884,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 @@ -4323,106 +3934,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 + +once -• **\_e**: `DragEvent` +##### Inherited from -#### Returns +[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once) -`boolean` +#### Call Signature -true to handle the drag event +> **once**(`handlers`): `VoidFunction` -#### Inherited from +Defined in: [src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Observable.ts#L66) -[`FabricObject`](/api/classes/fabricobject/).[`onDragStart`](/api/classes/fabricobject/#ondragstart) +Observes specified event **once** -#### Defined in +##### Parameters -[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691) +###### handlers + +`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) *** -### onSelect() +### onDeselect() + +> **onDeselect**(`_options?`): `boolean` -> **onSelect**(`_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 @@ -4430,75 +4075,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) *** @@ -4506,11 +4141,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 @@ -4522,21 +4161,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 @@ -4546,23 +4187,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 @@ -4572,16 +4213,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 @@ -4589,7 +4228,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4599,21 +4240,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) @@ -4625,21 +4266,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 @@ -4651,21 +4292,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 @@ -4677,21 +4318,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 @@ -4703,120 +4344,120 @@ 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`?): [`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Polyline`\<`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 -[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\> +`Polyline`\<`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) - *** ### setBoundingBox() -> **setBoundingBox**(`adjustPosition`?): `void` +> **setBoundingBox**(`adjustPosition?`): `void` + +Defined in: [src/shapes/Polyline.ts:213](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L213) #### Parameters -• **adjustPosition?**: `boolean` +##### adjustPosition? + +`boolean` #### Returns `void` -#### Defined in - -[src/shapes/Polyline.ts:214](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L214) - *** -### 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() + +> **setControlVisible**(`controlKey`, `visible`): `void` -#### Defined in +Defined in: [src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/InteractiveObject.ts#L599) -[src/shapes/Object/InteractiveObject.ts:599](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/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) *** @@ -4824,8 +4465,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 @@ -4835,30 +4478,26 @@ 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) - *** ### setDimensions() > **setDimensions**(): `void` +Defined in: [src/shapes/Polyline.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L209) + #### Returns `void` -#### Defined in - -[src/shapes/Polyline.ts:210](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L210) - *** ### 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 @@ -4872,29 +4511,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' @@ -4906,22 +4549,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 + +`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/polyline/#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/polyline/#setx) #### Returns @@ -4931,29 +4574,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/polyline/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/polyline/#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' @@ -4965,22 +4612,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/polyline/#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/polyline/#sety) #### Returns @@ -4990,21 +4637,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 @@ -5014,15 +4661,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, @@ -5030,15 +4675,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' @@ -5056,21 +4707,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 @@ -5080,20 +4731,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. @@ -5105,22 +4754,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 @@ -5132,25 +4781,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 @@ -5162,9 +4813,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` = `{}` + +#### 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) +[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob) *** @@ -5172,11 +4841,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 @@ -5190,23 +4863,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. @@ -5220,9 +4895,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) *** @@ -5230,11 +4929,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 @@ -5248,37 +4951,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`): `Polyline`\<`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 +`Polyline`\<`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) *** @@ -5286,6 +4983,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 @@ -5298,27 +4997,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/Polyline.ts:310](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L310) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Polyline`](/api/classes/polyline/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T + +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Polyline`\<`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 @@ -5332,46 +5035,14 @@ Object representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject) -#### Defined in - -[src/shapes/Polyline.ts:311](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L311) - -*** - -### 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 @@ -5382,35 +5053,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`): [`Polyline`](/api/classes/polyline/)\<`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? -[`Polyline`](/api/classes/polyline/)\<`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` + +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) +[`FabricObject`](/api/classes/fabricobject/).[`toSVG`](/api/classes/fabricobject/#tosvg) *** @@ -5418,11 +5091,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 @@ -5434,19 +5111,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 @@ -5456,29 +5133,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' @@ -5490,37 +5171,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' @@ -5532,29 +5221,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' @@ -5566,16 +5259,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 @@ -5591,25 +5282,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 @@ -5619,16 +5314,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 @@ -5645,86 +5338,78 @@ 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`\<[`Polyline`](/api/classes/polyline/)\<`object`, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Polyline`\<\{ `signal?`: `AbortSignal`; \}, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Polyline.ts:395](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L395) Returns Polyline instance from an SVG element #### Parameters -• **element**: `HTMLElement` +##### element Element to parser -• **options?**: [`Abortable`](/api/type-aliases/abortable/) - -Options object - -• **cssRules?**: `CSSRules` +`HTMLElement` | `SVGElement` -#### Returns +##### options? -`Promise`\<[`Polyline`](/api/classes/polyline/)\<`object`, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +[`Abortable`](/api/type-aliases/abortable/) -#### Static +Options object -#### Member Of +##### cssRules? -Polyline +`CSSRules` -#### Defined in +#### Returns -[src/shapes/Polyline.ts:400](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L400) +`Promise`\<`Polyline`\<\{ `signal?`: `AbortSignal`; \}, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> *** ### fromObject() -> `static` **fromObject**\<`T`\>(`object`): `Promise`\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromObject**\<`T`\>(`object`): `Promise`\<`Polyline`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +Defined in: [src/shapes/Polyline.ts:421](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L421) Returns Polyline instance from an object representation #### Type Parameters -• **T** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> +##### T + +`T` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/)\> #### Parameters -• **object**: `T` +##### object + +`T` Object to create an instance from #### Returns -`Promise`\<[`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> - -#### Static - -#### Member Of - -Polyline +`Promise`\<`Polyline`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`fromObject`](/api/classes/fabricobject/#fromobject) -#### Defined in - -[src/shapes/Polyline.ts:428](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L428) - *** ### getDefaults() > `static` **getDefaults**(): `Record`\<`string`, `any`\> +Defined in: [src/shapes/Polyline.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L68) + #### Returns `Record`\<`string`, `any`\> @@ -5732,7 +5417,3 @@ Polyline #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults) - -#### Defined in - -[src/shapes/Polyline.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L69) diff --git a/src/content/docs/api/classes/Rect.md b/src/content/docs/api/classes/Rect.md index adb926012..1ec2a9efb 100644 --- a/src/content/docs/api/classes/Rect.md +++ b/src/content/docs/api/classes/Rect.md @@ -5,87 +5,9 @@ prev: false title: "Rect" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Rect.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.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/)\<[`RectProps`](/api/interfaces/rectprops/)\> = `Partial`\<[`RectProps`](/api/interfaces/rectprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`RectProps`](/api/interfaces/rectprops/)\> = `Partial`\<[`RectProps`](/api/interfaces/rectprops/)\> -• **SProps** *extends* [`SerializedRectProps`](/api/interfaces/serializedrectprops/) = [`SerializedRectProps`](/api/interfaces/serializedrectprops/) +### SProps -• **EventSpec** *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) +`SProps` *extends* [`SerializedRectProps`](/api/interfaces/serializedrectprops/) = [`SerializedRectProps`](/api/interfaces/serializedrectprops/) + +### EventSpec + +`EventSpec` *extends* [`ObjectEvents`](/api/interfaces/objectevents/) = [`ObjectEvents`](/api/interfaces/objectevents/) ## Implements @@ -105,29 +33,29 @@ drop ## Constructors -### new Rect() +### Constructor -> **new Rect**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +> **new Rect**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `Rect`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/Rect.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L66) Constructor #### Parameters -• **options?**: `Props` +##### options? + +`Props` Options object #### Returns -[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +`Rect`\<`Props`, `SProps`, `EventSpec`\> #### Overrides -[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors) - -#### Defined in - -[src/shapes/Rect.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.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/rect/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/rect/#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/rect/#setcoords). +You can calculate them without updating with [()](/api/classes/rect/#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 [`RectProps`](/api/interfaces/rectprops/).[`backgroundColor`](/api/interfaces/rectprops/#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 [`RectProps`](/api/interfaces/rectprops/).[`centeredRotation`](/api/interfaces/rectprops/#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 [`RectProps`](/api/interfaces/rectprops/).[`centeredScaling`](/api/interfaces/rectprops/#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 [`RectProps`](/api/interfaces/rectprops/).[`cornerStyle`](/api/interfaces/rectprops/#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 [`RectProps`](/api/interfaces/rectprops/).[`excludeFromExport`](/api/interfaces/rectprops/#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 [`RectProps`](/api/interfaces/rectprops/).[`lockMovementY`](/api/interfaces/rectprops/#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 border radius - -#### Default - -```ts +Defined in: [src/shapes/Rect.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L41) -``` +Horizontal border radius #### Implementation of [`RectProps`](/api/interfaces/rectprops/).[`rx`](/api/interfaces/rectprops/#rx) -#### Defined in - -[src/shapes/Rect.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L42) - *** ### ry > **ry**: `number` -Vertical border radius - -#### Default - -```ts +Defined in: [src/shapes/Rect.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L47) -``` +Vertical border radius #### Implementation of [`RectProps`](/api/interfaces/rectprops/).[`ry`](/api/interfaces/rectprops/#ry) -#### Defined in - -[src/shapes/Rect.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.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 [`RectProps`](/api/interfaces/rectprops/).[`selectable`](/api/interfaces/rectprops/#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,35 +1858,25 @@ 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`[] +Defined in: [src/shapes/Rect.ts:175](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L175) + List of attribute names to account for when parsing SVG element (used by `Rect.fromElement`) +@see: http://www.w3.org/TR/SVG/shapes.html#RectElement -#### Static - -#### Member Of - -Rect -@see: http://www.w3.org/TR/SVG/shapes.html#RectElement - -#### Defined in - -[src/shapes/Rect.ts:179](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L179) - -*** +*** ### cacheProperties > `static` **cacheProperties**: `string`[] +Defined in: [src/shapes/Rect.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.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 @@ -2285,32 +1886,28 @@ and refreshed at the next render [`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#cacheproperties) -#### Defined in - -[src/shapes/Rect.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.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 @@ -2318,30 +1915,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/)\<[`Rect`](/api/classes/rect/)\<`Partial`\<[`RectProps`](/api/interfaces/rectprops/)\>, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `rectDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Rect`\<`Partial`\<[`RectProps`](/api/interfaces/rectprops/)\>, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `rectDefaultValues` + +Defined in: [src/shapes/Rect.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L53) #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults) -#### Defined in - -[src/shapes/Rect.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.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 @@ -2350,16 +1943,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` = `'Rect'` +Defined in: [src/shapes/Rect.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L49) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2373,22 +1964,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/Rect.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.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 @@ -2396,23 +1987,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 @@ -2420,15 +2017,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 @@ -2438,51 +2043,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 @@ -2493,26 +2091,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 @@ -2528,19 +2128,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 @@ -2550,21 +2150,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`\<[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2574,21 +2176,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`\<[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +`CanvasRenderingContext2D` + +##### decl + +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2598,22 +2202,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 @@ -2625,16 +2229,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/Rect.ts:160](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L160) + Returns svg representation of an instance #### Returns @@ -2648,19 +2250,19 @@ of the instance [`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg) -#### Defined in - -[src/shapes/Rect.ts:162](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L162) - *** ### 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 @@ -2670,33 +2272,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 @@ -2705,24 +2311,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. @@ -2734,16 +2338,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 @@ -2757,16 +2359,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 @@ -2780,22 +2380,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. @@ -2810,21 +2410,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 @@ -2836,15 +2436,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. @@ -2853,7 +2451,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. @@ -2872,41 +2472,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`\<[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Rect`\<`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`\<[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Rect`\<`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. @@ -2917,13 +2515,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. @@ -2935,16 +2535,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 @@ -2957,21 +2555,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 @@ -2985,16 +2583,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` @@ -3006,15 +2602,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 @@ -3022,15 +2616,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 @@ -3042,23 +2642,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 -• **ctx**: `CanvasRenderingContext2D` +`CanvasRenderingContext2D` Context to render on @@ -3070,27 +2672,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 -• **canvasWithClipPath**: `HTMLCanvasElement` +[`BaseFabricObject`](/api/classes/basefabricobject/) + +##### canvasWithClipPath + +`HTMLCanvasElement` #### Returns @@ -3100,16 +2706,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 @@ -3119,11 +2723,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 @@ -3135,27 +2743,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 @@ -3167,29 +2777,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 @@ -3201,16 +2815,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 @@ -3218,7 +2830,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3236,25 +2850,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* [`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Rect`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3266,29 +2882,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 @@ -3300,22 +2920,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 @@ -3327,21 +2947,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 @@ -3355,34 +2975,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` @@ -3393,16 +3009,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. @@ -3416,16 +3030,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` @@ -3434,16 +3046,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 @@ -3454,16 +3064,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/)[] @@ -3474,16 +3082,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 @@ -3494,16 +3100,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 @@ -3514,16 +3118,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 @@ -3533,11 +3135,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' @@ -3549,16 +3155,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 @@ -3569,78 +3173,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/rect/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/rect/#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/rect/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/rect/#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 @@ -3657,16 +3253,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 @@ -3683,21 +3277,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 @@ -3707,21 +3301,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 @@ -3731,23 +3325,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 @@ -3759,25 +3355,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 @@ -3787,16 +3387,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 @@ -3807,16 +3405,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 @@ -3829,16 +3425,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 @@ -3849,83 +3443,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* [`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Rect`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3935,15 +3525,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 @@ -3954,7 +3542,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3966,15 +3554,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 @@ -3985,7 +3571,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3997,21 +3583,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 @@ -4025,23 +3611,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 @@ -4051,21 +3639,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. @@ -4078,21 +3669,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 @@ -4106,23 +3697,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 @@ -4132,21 +3725,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. @@ -4161,22 +3754,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 @@ -4186,23 +3779,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* [`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Rect`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -4216,16 +3811,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` @@ -4234,16 +3829,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 @@ -4257,23 +3850,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 @@ -4283,16 +3878,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 @@ -4305,41 +3898,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 @@ -4355,18 +3958,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 @@ -4377,11 +3978,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') @@ -4393,27 +3998,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 @@ -4425,19 +4034,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}) @@ -4449,14 +4058,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 @@ -4467,33 +4074,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 @@ -4511,106 +4124,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** -#### Defined in +##### Parameters + +###### handlers + +`EventRegistryObject`\<`EventSpec`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) + +##### Returns + +`VoidFunction` + +disposer + +##### Alias + +once + +##### Inherited from -[src/shapes/Object/InteractiveObject.ts:691](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L691) +[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once) *** -### onSelect() +### onDeselect() + +> **onDeselect**(`_options?`): `boolean` -> **onSelect**(`_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 @@ -4618,75 +4265,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) *** @@ -4694,11 +4331,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 @@ -4710,23 +4351,25 @@ 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` -#### Returns +##### options? + +`any` + +#### Returns `void` @@ -4734,23 +4377,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 @@ -4760,16 +4403,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 @@ -4777,7 +4418,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4787,21 +4430,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) @@ -4813,21 +4456,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 @@ -4839,21 +4482,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 @@ -4865,21 +4508,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 @@ -4891,102 +4534,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`?): [`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Rect`\<`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 -[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\> +`Rect`\<`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) *** @@ -4994,8 +4637,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 @@ -5005,16 +4650,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 @@ -5028,29 +4671,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' @@ -5062,22 +4709,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 + +`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/rect/#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/rect/#setx) #### Returns @@ -5087,29 +4734,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/rect/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/rect/#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' @@ -5121,22 +4772,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/rect/#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/rect/#sety) #### Returns @@ -5146,21 +4797,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 @@ -5170,15 +4821,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, @@ -5186,15 +4835,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' @@ -5212,21 +4867,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 @@ -5236,20 +4891,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. @@ -5261,22 +4914,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 @@ -5288,25 +4941,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 @@ -5318,9 +4973,27 @@ the control box size used [`FabricObject`](/api/classes/fabricobject/).[`strokeBorders`](/api/classes/fabricobject/#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 + +[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob) *** @@ -5328,11 +5001,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 @@ -5346,23 +5023,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. @@ -5376,9 +5055,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 -[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143) +#### Inherited from + +[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject) *** @@ -5386,11 +5089,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 @@ -5404,37 +5111,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`): `Rect`\<`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` + +Property to toggle #### Returns -`any` - -Object representation of an instance +`Rect`\<`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) *** @@ -5442,6 +5143,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 @@ -5454,27 +5157,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/Rect.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L148) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Rect`](/api/classes/rect/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T + +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Rect`\<`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 @@ -5488,46 +5195,14 @@ object representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#toobject) -#### Defined in - -[src/shapes/Rect.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L150) - -*** - -### 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 @@ -5538,35 +5213,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`): [`Rect`](/api/classes/rect/)\<`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? -[`Rect`](/api/classes/rect/)\<`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) *** @@ -5574,11 +5251,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 @@ -5590,19 +5271,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 @@ -5612,29 +5293,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' @@ -5646,37 +5331,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' @@ -5688,29 +5381,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' @@ -5722,16 +5419,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 @@ -5747,25 +5442,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 -• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` +[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` #### Returns @@ -5775,16 +5474,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 @@ -5801,59 +5498,61 @@ 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`\<[`Rect`](/api/classes/rect/)\<`object`, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +> `static` **fromElement**(`element`, `options?`, `cssRules?`): `Promise`\<`Rect`\<\{ `height`: `any`; `left`: `any`; `signal?`: `AbortSignal`; `top`: `any`; `visible`: `boolean`; `width`: `any`; \}, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> -Returns [Rect](../../../../api/classes/rect) instance from an SVG element +Defined in: [src/shapes/Rect.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L192) + +Returns [Rect](/api/classes/rect/) instance from an SVG element #### Parameters -• **element**: `HTMLElement` +##### element Element to parse -• **options?**: [`Abortable`](/api/type-aliases/abortable/) - -Options object - -• **cssRules?**: `CSSRules` +`HTMLElement` | `SVGElement` -#### Returns +##### options? -`Promise`\<[`Rect`](/api/classes/rect/)\<`object`, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +[`Abortable`](/api/type-aliases/abortable/) -#### Static +Options object -#### Member Of +##### cssRules? -Rect +`CSSRules` -#### Defined in +#### Returns -[src/shapes/Rect.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L198) +`Promise`\<`Rect`\<\{ `height`: `any`; `left`: `any`; `signal?`: `AbortSignal`; `top`: `any`; `visible`: `boolean`; `width`: `any`; \}, [`SerializedRectProps`](/api/interfaces/serializedrectprops/), [`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?**: [`Abortable`](/api/type-aliases/abortable/) +##### options? + +[`Abortable`](/api/type-aliases/abortable/) #### Returns @@ -5863,16 +5562,14 @@ Rect [`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/Rect.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L55) + #### Returns `Record`\<`string`, `any`\> @@ -5880,7 +5577,3 @@ Rect #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults) - -#### Defined in - -[src/shapes/Rect.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L57) diff --git a/src/content/docs/api/classes/Shadow.md b/src/content/docs/api/classes/Shadow.md index b4eb1fc42..17709da27 100644 --- a/src/content/docs/api/classes/Shadow.md +++ b/src/content/docs/api/classes/Shadow.md @@ -5,45 +5,47 @@ prev: false title: "Shadow" --- +Defined in: [src/Shadow.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L63) + ## Constructors -### new Shadow() +### Constructor + +> **new Shadow**(`options?`): `Shadow` -> **new Shadow**(`options`?): [`Shadow`](/api/classes/shadow/) +Defined in: [src/Shadow.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L118) #### Parameters -• **options?**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Shadow`](/api/classes/shadow/)\>\> +##### options? + +`Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Shadow`\>\> Options object with any of color, blur, offsetX, offsetY properties or string (e.g. "rgba(0,0,0,0.2) 2px 2px 10px") #### Returns -[`Shadow`](/api/classes/shadow/) +`Shadow` #### See -[demo](http://fabricjs.com/shadows|Shadow) +[demo](http://fabric5.fabricjs.com/shadows|Shadow) -#### Defined in +### Constructor -[src/Shadow.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L124) +> **new Shadow**(`svgAttribute`): `Shadow` -### new Shadow() - -> **new Shadow**(`svgAttribute`): [`Shadow`](/api/classes/shadow/) +Defined in: [src/Shadow.ts:119](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L119) #### Parameters -• **svgAttribute**: `string` - -#### Returns +##### svgAttribute -[`Shadow`](/api/classes/shadow/) +`string` -#### Defined in +#### Returns -[src/Shadow.ts:125](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L125) +`Shadow` ## Properties @@ -51,17 +53,9 @@ Options object with any of color, blur, offsetX, offsetY properties or string (e > **affectStroke**: `boolean` -Whether the shadow should affect stroke operations - -#### Default - -```ts - -``` +Defined in: [src/Shadow.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L92) -#### Defined in - -[src/Shadow.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L96) +Whether the shadow should affect stroke operations *** @@ -69,11 +63,9 @@ Whether the shadow should affect stroke operations > **blur**: `number` -Shadow blur - -#### Defined in +Defined in: [src/Shadow.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L74) -[src/Shadow.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L75) +Shadow blur *** @@ -81,17 +73,9 @@ Shadow blur > **color**: `string` -Shadow color +Defined in: [src/Shadow.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L68) -#### Default - -```ts - -``` - -#### Defined in - -[src/Shadow.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L69) +Shadow color *** @@ -99,9 +83,7 @@ Shadow color > **id**: `number` -#### Defined in - -[src/Shadow.ts:114](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L114) +Defined in: [src/Shadow.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L108) *** @@ -109,17 +91,9 @@ Shadow color > **includeDefaultValues**: `boolean` -Indicates whether toObject should include default values - -#### Default - -```ts - -``` - -#### Defined in +Defined in: [src/Shadow.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L98) -[src/Shadow.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L103) +Indicates whether toObject should include default values *** @@ -127,37 +101,21 @@ Indicates whether toObject should include default values > **nonScaling**: `boolean` +Defined in: [src/Shadow.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L106) + When `false`, the shadow will scale with the object. When `true`, the shadow's offsetX, offsetY, and blur will not be affected by the object's scale. default to false -#### Default - -```ts - -``` - -#### Defined in - -[src/Shadow.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L112) - *** ### offsetX > **offsetX**: `number` -Shadow horizontal offset - -#### Default - -```ts - -``` +Defined in: [src/Shadow.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L80) -#### Defined in - -[src/Shadow.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L82) +Shadow horizontal offset *** @@ -165,27 +123,17 @@ Shadow horizontal offset > **offsetY**: `number` -Shadow vertical offset - -#### Default - -```ts +Defined in: [src/Shadow.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L86) -``` - -#### Defined in - -[src/Shadow.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L89) +Shadow vertical offset *** ### ownDefaults -> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Shadow`](/api/classes/shadow/)\>\> = `shadowDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Shadow`\>\> = `shadowDefaultValues` -#### Defined in - -[src/Shadow.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L116) +Defined in: [src/Shadow.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L110) *** @@ -193,9 +141,7 @@ Shadow vertical offset > `static` **type**: `string` = `'shadow'` -#### Defined in - -[src/Shadow.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L118) +Defined in: [src/Shadow.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L112) ## Methods @@ -203,6 +149,8 @@ Shadow vertical offset > **toObject**(): `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/Shadow.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L215) + Returns object representation of a shadow #### Returns @@ -211,71 +159,65 @@ Returns object representation of a shadow Object representation of a shadow instance -#### Defined in - -[src/Shadow.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L221) - *** -### toSVG() - -> **toSVG**(`object`): `string` +### toString() -Returns SVG representation of a shadow +> **toString**(): `string` -#### Parameters +Defined in: [src/Shadow.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L151) -• **object**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Returns a string representation of an instance #### Returns `string` -SVG representation of a shadow +Returns CSS3 text-shadow declaration -#### Defined in +#### See -[src/Shadow.ts:166](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L166) +http://www.w3.org/TR/css-text-decor-3/#text-shadow *** -### toString() +### toSVG() -> **toString**(): `string` +> **toSVG**(`object`): `string` -Returns a string representation of an instance +Defined in: [src/Shadow.ts:160](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L160) -#### Returns +Returns SVG representation of a shadow -`string` +#### Parameters -Returns CSS3 text-shadow declaration +##### object -#### See +[`FabricObject`](/api/classes/fabricobject/) -http://www.w3.org/TR/css-text-decor-3/#text-shadow +#### Returns -#### Defined in +`string` -[src/Shadow.ts:157](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L157) +SVG representation of a shadow *** ### fromObject() -> `static` **fromObject**(`options`): `Promise`\<[`Shadow`](/api/classes/shadow/)\> +> `static` **fromObject**(`options`): `Promise`\<`Shadow`\> -#### Parameters +Defined in: [src/Shadow.ts:231](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L231) -• **options**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Shadow`](/api/classes/shadow/)\>\> +#### Parameters -#### Returns +##### options -`Promise`\<[`Shadow`](/api/classes/shadow/)\> +`Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Shadow`\>\> -#### Defined in +#### Returns -[src/Shadow.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L237) +`Promise`\<`Shadow`\> *** @@ -283,9 +225,13 @@ http://www.w3.org/TR/css-text-decor-3/#text-shadow > `static` **parseShadow**(`value`): `object` +Defined in: [src/Shadow.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L131) + #### Parameters -• **value**: `string` +##### value + +`string` Shadow value to parse @@ -310,7 +256,3 @@ Shadow object with color, offsetX, offsetY and blur ##### offsetY > **offsetY**: `number` - -#### Defined in - -[src/Shadow.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L137) diff --git a/src/content/docs/api/classes/SprayBrush.md b/src/content/docs/api/classes/SprayBrush.md index a989a3d52..36e079e82 100644 --- a/src/content/docs/api/classes/SprayBrush.md +++ b/src/content/docs/api/classes/SprayBrush.md @@ -5,9 +5,11 @@ prev: false title: "SprayBrush" --- +Defined in: [src/brushes/SprayBrush.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L31) + ## See -[demo](http://fabricjs.com/freedrawing|Freedrawing) +[demo](http://fabric5.fabricjs.com/freedrawing|Freedrawing) ## Extends @@ -15,29 +17,29 @@ title: "SprayBrush" ## Constructors -### new SprayBrush() +### Constructor + +> **new SprayBrush**(`canvas`): `SprayBrush` -> **new SprayBrush**(`canvas`): [`SprayBrush`](/api/classes/spraybrush/) +Defined in: [src/brushes/SprayBrush.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L77) Constructor #### Parameters -• **canvas**: [`Canvas`](/api/classes/canvas/) +##### canvas + +[`Canvas`](/api/classes/canvas/) #### Returns -[`SprayBrush`](/api/classes/spraybrush/) +`SprayBrush` Instance of a spray brush #### Overrides -[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructors) - -#### Defined in - -[src/brushes/SprayBrush.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L83) +[`BaseBrush`](/api/classes/basebrush/).[`constructor`](/api/classes/basebrush/#constructor) ## Properties @@ -45,6 +47,8 @@ Instance of a spray brush > **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 @@ -53,49 +57,29 @@ 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 +Defined in: [src/brushes/BaseBrush.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L15) -```ts - -``` +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) - *** ### density > **density**: `number` = `20` -Density of a spray (number of dots per chunk) - -#### Default +Defined in: [src/brushes/SprayBrush.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L42) -```ts - -``` - -#### Defined in - -[src/brushes/SprayBrush.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L44) +Density of a spray (number of dots per chunk) *** @@ -103,17 +87,9 @@ Density of a spray (number of dots per chunk) > **dotWidth**: `number` = `1` -Width of spray dots - -#### Default +Defined in: [src/brushes/SprayBrush.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L48) -```ts - -``` - -#### Defined in - -[src/brushes/SprayBrush.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L51) +Width of spray dots *** @@ -121,17 +97,9 @@ Width of spray dots > **dotWidthVariance**: `number` = `1` -Width variance of spray dots +Defined in: [src/brushes/SprayBrush.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L54) -#### Default - -```ts - -``` - -#### Defined in - -[src/brushes/SprayBrush.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L58) +Width variance of spray dots *** @@ -139,6 +107,8 @@ Width variance of spray dots > **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 @@ -151,27 +121,15 @@ 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) - *** ### optimizeOverlapping > **optimizeOverlapping**: `boolean` = `true` -Whether overlapping dots (rectangles) should be removed (for performance reasons) - -#### Default - -```ts - -``` +Defined in: [src/brushes/SprayBrush.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L66) -#### Defined in - -[src/brushes/SprayBrush.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L72) +Whether overlapping dots (rectangles) should be removed (for performance reasons) *** @@ -179,17 +137,9 @@ Whether overlapping dots (rectangles) should be removed (for performance reasons > **randomOpacity**: `boolean` = `false` -Whether opacity of a dot should be random - -#### Default - -```ts - -``` +Defined in: [src/brushes/SprayBrush.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L60) -#### Defined in - -[src/brushes/SprayBrush.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L65) +Whether opacity of a dot should be random *** @@ -197,140 +147,94 @@ Whether opacity of a dot should be random > **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") +Defined in: [src/brushes/BaseBrush.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L35) -#### Default - -```ts - -``` +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") +Defined in: [src/brushes/BaseBrush.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L41) -#### Default - -```ts - -``` +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 - -```ts +Defined in: [src/brushes/BaseBrush.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/BaseBrush.ts#L47) -``` +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 spray - -#### Default - -```ts +Defined in: [src/brushes/SprayBrush.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L36) -``` +Width of a spray #### Overrides [`BaseBrush`](/api/classes/basebrush/).[`width`](/api/classes/basebrush/#width) -#### Defined in - -[src/brushes/SprayBrush.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L37) - ## Methods ### \_render() > **\_render**(): `void` +Defined in: [src/brushes/SprayBrush.ts:171](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L171) + Render all spray chunks #### Returns @@ -341,39 +245,39 @@ Render all spray chunks [`BaseBrush`](/api/classes/basebrush/).[`_render`](/api/classes/basebrush/#_render) -#### Defined in - -[src/brushes/SprayBrush.ts:177](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L177) - *** ### addSprayChunk() > **addSprayChunk**(`pointer`): `void` +Defined in: [src/brushes/SprayBrush.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L186) + #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer + +[`Point`](/api/classes/point/) #### Returns `void` -#### Defined in - -[src/brushes/SprayBrush.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L192) - *** ### onMouseDown() > **onMouseDown**(`pointer`): `void` +Defined in: [src/brushes/SprayBrush.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L87) + Invoked on mouse down #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer + +[`Point`](/api/classes/point/) #### Returns @@ -383,21 +287,21 @@ Invoked on mouse down [`BaseBrush`](/api/classes/basebrush/).[`onMouseDown`](/api/classes/basebrush/#onmousedown) -#### Defined in - -[src/brushes/SprayBrush.ts:93](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L93) - *** ### onMouseMove() > **onMouseMove**(`pointer`): `void` +Defined in: [src/brushes/SprayBrush.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L100) + Invoked on mouse move #### Parameters -• **pointer**: [`Point`](/api/classes/point/) +##### pointer + +[`Point`](/api/classes/point/) #### Returns @@ -407,16 +311,14 @@ Invoked on mouse move [`BaseBrush`](/api/classes/basebrush/).[`onMouseMove`](/api/classes/basebrush/#onmousemove) -#### Defined in - -[src/brushes/SprayBrush.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L106) - *** ### onMouseUp() > **onMouseUp**(): `void` +Defined in: [src/brushes/SprayBrush.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L111) + Invoked on mouse up #### Returns @@ -427,24 +329,20 @@ Invoked on mouse up [`BaseBrush`](/api/classes/basebrush/).[`onMouseUp`](/api/classes/basebrush/#onmouseup) -#### Defined in - -[src/brushes/SprayBrush.ts:117](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L117) - *** ### renderChunck() > **renderChunck**(`sprayChunck`): `void` +Defined in: [src/brushes/SprayBrush.ts:153](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/SprayBrush.ts#L153) + #### Parameters -• **sprayChunck**: [`SprayBrushPoint`](/api/type-aliases/spraybrushpoint/)[] +##### sprayChunck + +[`SprayBrushPoint`](/api/type-aliases/spraybrushpoint/)[] #### Returns `void` - -#### Defined in - -[src/brushes/SprayBrush.ts:159](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/SprayBrush.ts#L159) diff --git a/src/content/docs/api/classes/StaticCanvas.md b/src/content/docs/api/classes/StaticCanvas.md index 51971fd3b..b82ff2b50 100644 --- a/src/content/docs/api/classes/StaticCanvas.md +++ b/src/content/docs/api/classes/StaticCanvas.md @@ -5,11 +5,13 @@ prev: false title: "StaticCanvas" --- +Defined in: [src/canvas/StaticCanvas.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L86) + Static canvas class ## See -[demo](http://fabricjs.com/static_canvas|StaticCanvas) +[demo](http://fabric5.fabricjs.com/static_canvas|StaticCanvas) ## Fires @@ -33,11 +35,13 @@ object:removed ## Extends -- `Collection`\<() => `CommonMethods`\<[`CanvasEvents`](/api/interfaces/canvasevents/)\>, `this`\> & `CommonMethods`\<[`CanvasEvents`](/api/interfaces/canvasevents/), `this`\> +- `Collection`\<\{(): `CommonMethods`\<[`CanvasEvents`](/api/interfaces/canvasevents/)\>; `prototype`: `CommonMethods`\<`any`\>; \}, `this`\> & `CommonMethods`\<[`CanvasEvents`](/api/interfaces/canvasevents/), `this`\> ## Type Parameters -• **EventSpec** *extends* [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/) = [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/) +### EventSpec + +`EventSpec` *extends* [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/) = [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/) ## Implements @@ -45,45 +49,45 @@ object:removed ## Constructors -### new StaticCanvas() +### Constructor -> **new StaticCanvas**\<`EventSpec`\>(`el`?, `options`?): [`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> +> **new StaticCanvas**\<`EventSpec`\>(`el?`, `options?`): `StaticCanvas`\<`EventSpec`\> + +Defined in: [src/canvas/StaticCanvas.ts:186](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L186) #### Parameters -• **el?**: `string` \| `HTMLCanvasElement` +##### el? + +`string` | `HTMLCanvasElement` -• **options?**: [`TOptions`](/api/type-aliases/toptions/)\<[`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/)\> = `{}` +##### options? + +[`TOptions`](/api/type-aliases/toptions/)\<[`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/)\> = `{}` #### Returns -[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> +`StaticCanvas`\<`EventSpec`\> #### Overrides `createCollectionMixin(CommonMethods).constructor` -#### Defined in - -[src/canvas/StaticCanvas.ts:186](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L186) - ## Properties ### \_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 #### Inherited from -`createCollectionMixin(CommonMethods)._objects` - -#### Defined in - -[src/Collection.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L21) +[`StaticCanvas`](/api/classes/staticcanvas/).[`_objects`](/api/classes/staticcanvas/#_objects) *** @@ -91,6 +95,8 @@ needs to end up in the constructor too > **\_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` @@ -99,16 +105,14 @@ needs to end up in the constructor too > **top**: `number` -#### 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 @@ -117,63 +121,45 @@ move to Canvas [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`allowTouchScrolling`](/api/interfaces/staticcanvasoptions/#allowtouchscrolling) -#### Defined in - -[src/canvas/StaticCanvas.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L123) - *** ### 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundColor`](/api/interfaces/staticcanvasoptions/#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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundImage`](/api/interfaces/staticcanvasoptions/#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 @@ -184,26 +170,18 @@ 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundVpt`](/api/interfaces/staticcanvasoptions/#backgroundvpt) -#### Defined in - -[src/canvas/StaticCanvas.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L97) - *** ### 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. @@ -213,16 +191,14 @@ clipPath will clip away controls, if you do not want this to happen use controls [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`clipPath`](/api/interfaces/staticcanvasoptions/#clippath) -#### Defined in - -[src/canvas/StaticCanvas.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L105) - *** ### 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 @@ -231,45 +207,35 @@ move to Canvas [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`controlsAboveOverlay`](/api/interfaces/staticcanvasoptions/#controlsaboveoverlay) -#### Defined in - -[src/canvas/StaticCanvas.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L118) - *** ### 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. -#### 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. -#### Defined in - -[src/canvas/StaticCanvas.ts:157](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L157) - *** ### elements > **elements**: [`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/) -#### Defined in - -[src/canvas/StaticCanvas.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L163) +Defined in: [src/canvas/StaticCanvas.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L163) *** @@ -277,28 +243,22 @@ WIll likely complete the render cycle already scheduled but stopping adding more > **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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`enableRetinaScaling`](/api/interfaces/staticcanvasoptions/#enableretinascaling) -#### Defined in - -[src/canvas/StaticCanvas.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L112) - *** ### 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 @@ -306,112 +266,78 @@ The canvas can be taller than width if retina scaling is active [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`height`](/api/interfaces/staticcanvasoptions/#height) -#### Defined in - -[src/canvas/StaticCanvas.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L94) - *** ### 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`imageSmoothingEnabled`](/api/interfaces/staticcanvasoptions/#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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`includeDefaultValues`](/api/interfaces/staticcanvasoptions/#includedefaultvalues) -#### Defined in - -[src/canvas/StaticCanvas.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L107) - *** ### 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayColor`](/api/interfaces/staticcanvasoptions/#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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayImage`](/api/interfaces/staticcanvasoptions/#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 @@ -422,53 +348,37 @@ 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayVpt`](/api/interfaces/staticcanvasoptions/#overlayvpt) -#### Defined in - -[src/canvas/StaticCanvas.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L101) - *** ### 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`renderOnAddRemove`](/api/interfaces/staticcanvasoptions/#renderonaddremove) -#### Defined in - -[src/canvas/StaticCanvas.ts:110](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L110) - *** ### 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 @@ -485,39 +395,29 @@ true [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`skipOffscreen`](/api/interfaces/staticcanvasoptions/#skipoffscreen) -#### Defined in - -[src/canvas/StaticCanvas.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L111) - *** ### 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 [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`svgViewportTransformation`](/api/interfaces/staticcanvasoptions/#svgviewporttransformation) -#### Defined in - -[src/canvas/StaticCanvas.ts:954](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L954) - *** ### 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 @@ -530,31 +430,19 @@ canvas.viewportTransform = [1, 0, 0, 1, 0, 0]; canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50]; ``` -#### Default - -```ts - -``` - #### Implementation of [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`viewportTransform`](/api/interfaces/staticcanvasoptions/#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/staticcanvas/#calcviewportboundaries) - -#### Defined in +Defined in: [src/canvas/StaticCanvas.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L130) -[src/canvas/StaticCanvas.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L130) +The viewport bounding box in scene plane coordinates, see [calcViewportBoundaries](/api/classes/staticcanvas/#calcviewportboundaries) *** @@ -562,6 +450,8 @@ The viewport bounding box in scene plane coordinates, see [calcViewportBoundarie > **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 @@ -569,60 +459,58 @@ The canvas can be larger than width if retina scaling is active [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`width`](/api/interfaces/staticcanvasoptions/#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/)\<[`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/)\> = `staticCanvasDefaults` -#### Defined in - -[src/canvas/StaticCanvas.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L174) +Defined in: [src/canvas/StaticCanvas.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L174) ## Accessors ### contextContainer -> `get` **contextContainer**(): `CanvasRenderingContext2D` +#### Get Signature -#### Returns +> **get** **contextContainer**(): `CanvasRenderingContext2D` -`CanvasRenderingContext2D` +Defined in: [src/canvas/StaticCanvas.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L141) -#### Defined in +##### Returns -[src/canvas/StaticCanvas.ts:141](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L141) +`CanvasRenderingContext2D` *** ### 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` -#### Defined in - -[src/canvas/StaticCanvas.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L137) - ## Methods ### \_onObjectAdded() > **\_onObjectAdded**(`obj`): `void` +Defined in: [src/canvas/StaticCanvas.ts:228](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L228) + #### Parameters -• **obj**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +##### obj + +[`FabricObject`](/api/classes/fabricobject/) #### Returns @@ -632,19 +520,19 @@ Can be use to read the raw pixels, but never write or manipulate `createCollectionMixin(CommonMethods)._onObjectAdded` -#### Defined in - -[src/canvas/StaticCanvas.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L228) - *** ### \_onObjectRemoved() > **\_onObjectRemoved**(`obj`): `void` +Defined in: [src/canvas/StaticCanvas.ts:243](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L243) + #### Parameters -• **obj**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +##### obj + +[`FabricObject`](/api/classes/fabricobject/) #### Returns @@ -654,16 +542,14 @@ Can be use to read the raw pixels, but never write or manipulate `createCollectionMixin(CommonMethods)._onObjectRemoved` -#### Defined in - -[src/canvas/StaticCanvas.ts:243](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L243) - *** ### \_onStackOrderChanged() > **\_onStackOrderChanged**(): `void` +Defined in: [src/canvas/StaticCanvas.ts:249](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L249) + #### Returns `void` @@ -672,21 +558,23 @@ Can be use to read the raw pixels, but never write or manipulate `createCollectionMixin(CommonMethods)._onStackOrderChanged` -#### Defined in - -[src/canvas/StaticCanvas.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L249) - *** ### \_set() > **\_set**(`key`, `value`): `void` +Defined in: [src/CommonMethods.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/CommonMethods.ts#L38) + #### Parameters -• **key**: `string` +##### key + +`string` + +##### value -• **value**: `any` +`any` #### Returns @@ -696,21 +584,21 @@ Can be use to read the raw pixels, but never write or manipulate `createCollectionMixin(CommonMethods)._set` -#### Defined in - -[src/CommonMethods.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L38) - *** ### 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 @@ -718,22 +606,22 @@ to move to `void` -#### 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 @@ -747,15 +635,13 @@ new array length `createCollectionMixin(CommonMethods).add` -#### Defined in - -[src/canvas/StaticCanvas.ts:210](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L210) - *** ### 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 @@ -765,11 +651,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 @@ -783,22 +673,22 @@ true if change occurred `createCollectionMixin(CommonMethods).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 @@ -812,16 +702,14 @@ true if change occurred `createCollectionMixin(CommonMethods).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 @@ -837,16 +725,14 @@ This method is also attached as "resize" event handler of window > **top**: `number` = `0` -#### 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 @@ -854,35 +740,33 @@ helps to determinate when an object is in the current rendering viewport [`TCornerPoint`](/api/type-aliases/tcornerpoint/) -#### 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` -#### 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 @@ -890,41 +774,41 @@ Object to center vertically and horizontally `void` -#### 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 `void` -#### 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 @@ -932,37 +816,35 @@ Object to center vertically `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:745](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L745) - *** ### clear() > **clear**(): `void` +Defined in: [src/canvas/StaticCanvas.ts:438](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L438) + Clears all contexts (background, main, top) of an instance #### Returns `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:478](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L478) - *** ### 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 @@ -970,48 +852,42 @@ Context to clear `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:463](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L463) - *** ### clone() -> **clone**(`properties`?): `Promise`\<[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\>\> +> **clone**(`properties?`): `Promise`\<`StaticCanvas`\<`EventSpec`\>\> + +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`\<[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\>\> - -#### Defined in - -[src/canvas/StaticCanvas.ts:1327](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1327) +`Promise`\<`StaticCanvas`\<`EventSpec`\>\> *** ### cloneWithoutData() -> **cloneWithoutData**(): [`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> +> **cloneWithoutData**(): `StaticCanvas`\<`EventSpec`\> + +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 -[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> - -#### Defined in - -[src/canvas/StaticCanvas.ts:1337](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1337) +`StaticCanvas`\<`EventSpec`\> *** @@ -1019,21 +895,27 @@ This essentially copies canvas dimensions since loadFromJSON does not affect can > **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 @@ -1045,16 +927,14 @@ array of objects contained in the bounding box, ordered from top to bottom stack `createCollectionMixin(CommonMethods).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 @@ -1067,27 +947,29 @@ complexity `createCollectionMixin(CommonMethods).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` @@ -1101,34 +983,32 @@ Object to check against `createCollectionMixin(CommonMethods).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 `string` -#### 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 @@ -1137,32 +1017,28 @@ and are not extracted from the DOM by fabricjs `string` -#### 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 `string` -#### Defined in - -[src/canvas/StaticCanvas.ts:1095](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1095) - *** ### 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 @@ -1175,65 +1051,71 @@ a promise resolving to `true` once the canvas has been destroyed or to `false` i if aborted by a consequent call -#### 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 `void` -#### 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/StaticCanvas.ts:513](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L513) + #### Parameters -• **\_ctx**: `CanvasRenderingContext2D` +##### \_ctx + +`CanvasRenderingContext2D` #### Returns `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:553](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L553) - *** ### 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 @@ -1243,23 +1125,27 @@ Context to render on `createCollectionMixin(CommonMethods).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 -• **idx**: `number` +[`FabricObject`](/api/classes/fabricobject/) -• **intersecting?**: `boolean` +##### idx + +`number` + +##### intersecting? + +`boolean` #### Returns @@ -1269,29 +1155,33 @@ Context to render on `createCollectionMixin(CommonMethods).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 [`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 @@ -1303,23 +1193,23 @@ Options object `createCollectionMixin(CommonMethods).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. @@ -1332,21 +1222,21 @@ Callback invoked with current object as first argument, `createCollectionMixin(CommonMethods).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 @@ -1360,116 +1250,77 @@ value of a property `createCollectionMixin(CommonMethods).get` -#### Defined in - -[src/CommonMethods.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L59) - -*** - -### ~~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` - -#### 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 [`Point`](/api/classes/point/) -#### 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 `CanvasRenderingContext2D` -#### 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 `HTMLCanvasElement` -#### 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 `number` -#### 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 @@ -1481,16 +1332,14 @@ When specified, only objects of these types are returned `createCollectionMixin(CommonMethods).getObjects` -#### Defined in - -[src/Collection.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L108) - *** ### 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 @@ -1499,57 +1348,55 @@ Calculate the point in canvas that correspond to the center of actual viewport. vpCenter, viewport center -#### 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 `number` -#### 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 `number` -#### 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 @@ -1563,16 +1410,14 @@ new array length `createCollectionMixin(CommonMethods).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 @@ -1585,21 +1430,21 @@ true if collection is empty `createCollectionMixin(CommonMethods).isEmpty` -#### Defined in - -[src/Collection.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L128) - *** ### 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 @@ -1611,15 +1456,13 @@ object at index `createCollectionMixin(CommonMethods).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`\<[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\>\> +> **loadFromJSON**(`json`, `reviver?`, `options?`): `Promise`\<`StaticCanvas`\<`EventSpec`\>\> + +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 @@ -1628,31 +1471,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`\<[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\>\> +`Promise`\<`StaticCanvas`\<`EventSpec`\>\> 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 @@ -1670,25 +1516,27 @@ canvas.loadFromJSON(json, function(o, object) { }); ``` -#### 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 @@ -1702,18 +1550,16 @@ true if change occurred `createCollectionMixin(CommonMethods).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 @@ -1724,11 +1570,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') @@ -1740,27 +1590,31 @@ event name (eg. 'after:render') `createCollectionMixin(CommonMethods).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 @@ -1772,19 +1626,19 @@ event listener to unsubscribe `createCollectionMixin(CommonMethods).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}) @@ -1796,14 +1650,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han `createCollectionMixin(CommonMethods).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 @@ -1814,33 +1666,39 @@ unsubscribe all event listeners `createCollectionMixin(CommonMethods).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 @@ -1858,53 +1716,69 @@ on `createCollectionMixin(CommonMethods).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 -`createCollectionMixin(CommonMethods).on` +##### Alias -##### Defined in +on -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +##### Inherited from + +`createCollectionMixin(CommonMethods).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 @@ -1922,29 +1796,35 @@ once `createCollectionMixin(CommonMethods).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 -`createCollectionMixin(CommonMethods).once` +##### Alias -##### Defined in +once -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +##### Inherited from + +`createCollectionMixin(CommonMethods).once` *** @@ -1952,11 +1832,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 @@ -1964,39 +1848,39 @@ Pans viewpoint relatively `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:442](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L442) - *** ### renderAll() > **renderAll**(): `void` +Defined in: [src/canvas/StaticCanvas.ts:452](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L452) + Renders the canvas #### Returns `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:492](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L492) - *** ### 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 -• **objects**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +`CanvasRenderingContext2D` + +##### objects + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] to render @@ -2004,16 +1888,14 @@ to render `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:562](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L562) - *** ### 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. @@ -2022,15 +1904,13 @@ a boolean flag will avoid appending more. `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:518](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L518) - *** ### 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 @@ -2040,11 +1920,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 @@ -2058,22 +1942,22 @@ true if change occurred `createCollectionMixin(CommonMethods).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 @@ -2087,65 +1971,71 @@ true if change occurred `createCollectionMixin(CommonMethods).sendObjectToBack` -#### Defined in - -[src/Collection.ts:178](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L178) - *** ### set() -> **set**(`key`, `value`?): [`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> +> **set**(`key`, `value?`): `StaticCanvas`\<`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 -[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> +`StaticCanvas`\<`EventSpec`\> #### Inherited from `createCollectionMixin(CommonMethods).set` -#### Defined in - -[src/CommonMethods.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/CommonMethods.ts#L29) - *** ### 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 @@ -2153,124 +2043,83 @@ Set the given dimensions only as css dimensions `void` -##### 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/)\> +###### dimensions -• **options?** +`Partial`\<[`TSize`](/api/type-aliases/tsize/)\> -• **options.backstoreOnly?**: `true` - -• **options.cssOnly?**: `false` +Object with width/height properties -##### Returns +###### options? -`void` +Options object -##### Defined in +###### backstoreOnly? -[src/canvas/StaticCanvas.ts:365](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L365) +`true` -#### setDimensions(dimensions, options) +Set the given dimensions only as canvas backstore dimensions -> **setDimensions**(`dimensions`, `options`?): `void` +###### cssOnly? -##### Parameters +`false` -• **dimensions**: `Partial`\<[`TSize`](/api/type-aliases/tsize/)\> - -• **options?**: `undefined` +Set the given dimensions only as css dimensions ##### Returns `void` -##### 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 +###### dimensions -• **options.backstoreOnly?**: `true` +`Partial`\<[`TSize`](/api/type-aliases/tsize/)\> -Set the given dimensions only as canvas backstore dimensions - -• **options.cssOnly?**: `false` - -Set the given dimensions only as css dimensions - -##### Returns - -`void` - -##### Defined in - -[src/canvas/StaticCanvas.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L314) - -#### 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 `void` -##### Defined in - -[src/canvas/StaticCanvas.ts:318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L318) - *** ### setViewportTransform() > **setViewportTransform**(`vpt`): `void` +Defined in: [src/canvas/StaticCanvas.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L352) + 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 @@ -2278,157 +2127,161 @@ a Canvas 2D API transform matrix `void` -#### Defined in - -[src/canvas/StaticCanvas.ts:392](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L392) - *** -### 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` +*** -Set the given dimensions only as canvas backstore dimensions +### size() -• **options.cssOnly?**: `false` +> **size**(): `number` -Set the given dimensions only as css dimensions +Defined in: [src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L136) -##### Returns +Returns a size of a collection (i.e: length of an array containing its objects) -`void` +#### 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` +`createCollectionMixin(CommonMethods).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/) = `...` -##### Defined in +#### Returns -[src/canvas/StaticCanvas.ts:298](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L298) +`Promise`\<`null` \| `Blob`\> *** -### 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` -#### Returns +a zoom factor. -`void` +##### options? -#### Defined in +[`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/) = `...` + +Cropping informations -[src/canvas/StaticCanvas.ts:423](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L423) +#### Returns + +`HTMLCanvasElement` *** -### size() +### toDatalessJSON() -> **size**(): `number` +> **toDatalessJSON**(`propertiesToInclude?`): `any` -Returns a size of a collection (i.e: length of an array containing its objects) +Defined in: [src/canvas/StaticCanvas.ts:764](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L764) -#### Returns +Returns dataless JSON representation of canvas -`number` +#### Parameters -Collection size +##### propertiesToInclude? -#### Inherited from +`string`[] -`createCollectionMixin(CommonMethods).size` +Any properties that you might want to additionally include in the output + +#### Returns -#### Defined in +`any` -[src/Collection.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L136) +json string *** -### 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) + +Returns dataless object representation of canvas #### Parameters -• **multiplier?**: `number` = `1` +##### propertiesToInclude? -a zoom factor. +`string`[] -• **options?**: [`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/) = `...` - -Cropping informations +Any properties that you might want to additionally include in the output #### Returns -`HTMLCanvasElement` - -#### Defined in +`any` -[src/canvas/StaticCanvas.ts:1411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1411) +object representation of an instance *** ### 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 @@ -2475,57 +2328,31 @@ var dataURL = canvas.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 - -#### Defined in - -[src/canvas/StaticCanvas.ts:817](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L817) - -*** +### toggle() -### toDatalessObject() +> **toggle**(`property`): `StaticCanvas`\<`EventSpec`\> -> **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 +`StaticCanvas`\<`EventSpec`\> -#### Defined in +#### Inherited from -[src/canvas/StaticCanvas.ts:854](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L854) +`createCollectionMixin(CommonMethods).toggle` *** @@ -2533,10 +2360,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 @@ -2544,43 +2374,36 @@ 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']); +const json = JSON.stringify(canvas); ``` -```ts -var json = canvas.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 @@ -2590,25 +2413,43 @@ Any properties that you might want to additionally include in the output object representation of an instance -#### Defined in +*** -[src/canvas/StaticCanvas.ts:826](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L826) +### 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 + +`string` + +string representation of an instance *** ### 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. @@ -2618,15 +2459,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 @@ -2659,65 +2495,21 @@ var svg = canvas.toSVG(null, function(svg) { }); ``` -#### 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 - -#### Defined in - -[src/canvas/StaticCanvas.ts:1514](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L1514) - -*** - -### toggle() - -> **toggle**(`property`): [`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> - -Toggles specified property from `true` to `false` or from `false` to `true` - -#### Parameters - -• **property**: `string` - -Property to toggle - -#### Returns - -[`StaticCanvas`](/api/classes/staticcanvas/)\<`EventSpec`\> - -#### Inherited from - -`createCollectionMixin(CommonMethods).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 @@ -2725,21 +2517,21 @@ Object to center vertically and horizontally `void` -#### 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 @@ -2747,21 +2539,21 @@ Object to center vertically and horizontally `void` -#### 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 @@ -2769,16 +2561,14 @@ Object to center vertically and horizontally `void` -#### 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. @@ -2786,11 +2576,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 @@ -2798,20 +2592,14 @@ to set zoom to, less than 1 zooms out `void` -#### 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/StaticCanvas.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L182) + #### Returns `Record`\<`string`, `any`\> - -#### Defined in - -[src/canvas/StaticCanvas.ts:182](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L182) diff --git a/src/content/docs/api/classes/StaticCanvasDOMManager.md b/src/content/docs/api/classes/StaticCanvasDOMManager.md index cfa8aba52..71c339ee5 100644 --- a/src/content/docs/api/classes/StaticCanvasDOMManager.md +++ b/src/content/docs/api/classes/StaticCanvasDOMManager.md @@ -5,27 +5,29 @@ prev: false title: "StaticCanvasDOMManager" --- +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L14) + ## Extended by - [`CanvasDOMManager`](/api/classes/canvasdommanager/) ## Constructors -### new StaticCanvasDOMManager() +### Constructor -> **new StaticCanvasDOMManager**(`arg0`?): [`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/) +> **new StaticCanvasDOMManager**(`arg0?`): `StaticCanvasDOMManager` -#### Parameters +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L24) -• **arg0?**: `string` \| `HTMLCanvasElement` +#### Parameters -#### Returns +##### arg0? -[`StaticCanvasDOMManager`](/api/classes/staticcanvasdommanager/) +`string` | `HTMLCanvasElement` -#### Defined in +#### Returns -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L24) +`StaticCanvasDOMManager` ## Properties @@ -33,9 +35,7 @@ title: "StaticCanvasDOMManager" > **lower**: `CanvasItem` -#### Defined in - -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L22) +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L22) ## Methods @@ -43,6 +43,8 @@ title: "StaticCanvasDOMManager" > **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 @@ -57,76 +59,72 @@ Calculates canvas element offset relative to the document > **top**: `number` = `0` -#### Defined in - -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L71) - *** ### cleanupDOM() > **cleanupDOM**(`__namedParameters`): `void` +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L47) + #### Parameters -• **\_\_namedParameters**: [`TSize`](/api/type-aliases/tsize/) +##### \_\_namedParameters + +[`TSize`](/api/type-aliases/tsize/) #### Returns `void` -#### Defined in - -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L47) - *** ### dispose() > **dispose**(): `void` +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L75) + #### Returns `void` -#### Defined in - -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L75) - *** ### setCSSDimensions() > **setCSSDimensions**(`size`): `void` +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L64) + #### Parameters -• **size**: `Partial`\<`CSSDimensions`\> +##### size + +`Partial`\<`CSSDimensions`\> #### Returns `void` -#### Defined in - -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L64) - *** ### setDimensions() > **setDimensions**(`size`, `retinaScaling`): `void` +Defined in: [src/canvas/DOMManagers/StaticCanvasDOMManager.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L59) + #### Parameters -• **size**: [`TSize`](/api/type-aliases/tsize/) +##### size -• **retinaScaling**: `number` +[`TSize`](/api/type-aliases/tsize/) -#### Returns +##### retinaScaling -`void` +`number` -#### Defined in +#### Returns -[src/canvas/DOMManagers/StaticCanvasDOMManager.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/DOMManagers/StaticCanvasDOMManager.ts#L59) +`void` diff --git a/src/content/docs/api/classes/Textbox.md b/src/content/docs/api/classes/Textbox.md index 1579bff6e..34eb8c250 100644 --- a/src/content/docs/api/classes/Textbox.md +++ b/src/content/docs/api/classes/Textbox.md @@ -5,6 +5,8 @@ prev: false title: "Textbox" --- +Defined in: [src/shapes/Textbox.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L54) + Textbox class, based on IText, allows the user to resize the text rectangle and wraps lines automatically. Textboxes have their Y scaling locked, the user can only change width. Height is adjusted automatically based on the @@ -16,11 +18,17 @@ wrapping of lines. ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`TextboxProps`](/api/interfaces/textboxprops/)\> = `Partial`\<[`TextboxProps`](/api/interfaces/textboxprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`TextboxProps`](/api/interfaces/textboxprops/)\> = `Partial`\<[`TextboxProps`](/api/interfaces/textboxprops/)\> + +### SProps + +`SProps` *extends* [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/) = [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/) -• **SProps** *extends* [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/) = [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/) +### EventSpec -• **EventSpec** *extends* [`ITextEvents`](/api/type-aliases/itextevents/) = [`ITextEvents`](/api/type-aliases/itextevents/) +`EventSpec` *extends* [`ITextEvents`](/api/type-aliases/itextevents/) = [`ITextEvents`](/api/type-aliases/itextevents/) ## Implements @@ -28,62 +36,44 @@ wrapping of lines. ## Constructors -### new Textbox() +### Constructor -> **new Textbox**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options`?): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +> **new Textbox**\<`Props`, `SProps`, `EventSpec`\>(`text`, `options?`): `Textbox`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/Textbox.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L108) Constructor #### Parameters -• **text**: `string` +##### text + +`string` Text string -• **options?**: `Props` +##### options? + +`Props` Options object #### Returns -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +`Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Overrides -[`IText`](/api/classes/itext/).[`constructor`](/api/classes/itext/#constructors) - -#### Defined in - -[src/shapes/Textbox.ts:110](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L110) +[`IText`](/api/classes/itext/).[`constructor`](/api/classes/itext/#constructor) ## Properties -### MIN\_TEXT\_WIDTH - -> **MIN\_TEXT\_WIDTH**: `number` - -contains the min text width to avoid getting 0 - -#### Default - -```ts - -``` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`MIN_TEXT_WIDTH`](/api/classes/itext/#min_text_width) - -#### 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 @@ -94,44 +84,38 @@ this isn't cleaned automatically. Non selected objects may have wrong values [`IText`](/api/classes/itext/).[`__corner`](/api/classes/itext/#__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:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L405) + #### Inherited from [`IText`](/api/classes/itext/).[`__lineHeights`](/api/classes/itext/#__lineheights) -#### Defined in - -[src/shapes/Text/Text.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L411) - *** ### \_\_lineWidths > **\_\_lineWidths**: `number`[] +Defined in: [src/shapes/Text/Text.ts:406](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L406) + #### Inherited from [`IText`](/api/classes/itext/).[`__lineWidths`](/api/classes/itext/#__linewidths) -#### Defined in - -[src/shapes/Text/Text.ts:412](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L412) - *** ### \_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 @@ -140,38 +124,28 @@ this takes priority over the generic control visibility [`IText`](/api/classes/itext/).[`_controlsVisibility`](/api/classes/itext/#_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: [src/shapes/Text/Text.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L340) -``` +Text Line proportion to font Size (in pixels) #### Inherited from [`IText`](/api/classes/itext/).[`_fontSizeMult`](/api/classes/itext/#_fontsizemult) -#### Defined in - -[src/shapes/Text/Text.ts:339](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L339) - *** ### \_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. @@ -186,19 +160,13 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT [`IText`](/api/classes/itext/).[`_scaling`](/api/classes/itext/#_scaling) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L134) - *** ### \_styleMap > **\_styleMap**: `StyleMap` -#### Defined in - -[src/shapes/Textbox.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L88) +Defined in: [src/shapes/Textbox.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L86) *** @@ -206,91 +174,58 @@ DON'T USE IT. WE WILL TRY TO REMOVE IT > **\_text**: `string`[] +Defined in: [src/shapes/Text/Text.ts:403](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L403) + #### Inherited from [`IText`](/api/classes/itext/).[`_text`](/api/classes/itext/#_text) -#### Defined in - -[src/shapes/Text/Text.ts:409](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L409) - *** ### \_textLines > **\_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 #### Inherited from [`IText`](/api/classes/itext/).[`_textLines`](/api/classes/itext/#_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:402](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L402) + #### Inherited from [`IText`](/api/classes/itext/).[`_unwrappedTextLines`](/api/classes/itext/#_unwrappedtextlines) -#### Defined in - -[src/shapes/Text/Text.ts:408](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L408) - *** ### \_wordJoiners > **\_wordJoiners**: `RegExp` +Defined in: [src/shapes/Textbox.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L84) + #### Implementation of `UniqueTextboxProps._wordJoiners` -#### Defined in - -[src/shapes/Textbox.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L86) - -*** - -### 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/textbox/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/textbox/#calcacoords) - -#### Inherited from - -[`IText`](/api/classes/itext/).[`aCoords`](/api/classes/itext/#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 @@ -308,9 +243,24 @@ false [`IText`](/api/classes/itext/).[`absolutePositioned`](/api/classes/itext/#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/textbox/#setcoords). +You can calculate them without updating with [()](/api/classes/textbox/#calcacoords) + +#### Inherited from -[src/shapes/Object/Object.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L218) +[`IText`](/api/classes/itext/).[`aCoords`](/api/classes/itext/#acoords) *** @@ -318,6 +268,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 @@ -330,39 +282,29 @@ Angle of rotation of an object (in degrees) [`IText`](/api/classes/itext/).[`angle`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`backgroundColor`](/api/classes/itext/#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 @@ -375,16 +317,14 @@ rgb(178,204,255) [`IText`](/api/classes/itext/).[`borderColor`](/api/classes/itext/#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 @@ -395,16 +335,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`IText`](/api/classes/itext/).[`borderDashArray`](/api/classes/itext/#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 @@ -417,20 +355,19 @@ Opacity of object's controlling borders when object is active and moving [`IText`](/api/classes/itext/).[`borderOpacityWhenMoving`](/api/classes/itext/#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 @@ -442,38 +379,28 @@ since there is no way to change the border itself. [`IText`](/api/classes/itext/).[`borderScaleFactor`](/api/classes/itext/#borderscalefactor) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L77) - *** ### caching > **caching**: `boolean` -Indicates whether internal text char widths can be cached - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L204) -``` +Indicates whether internal text char widths can be cached #### Inherited from [`IText`](/api/classes/itext/).[`caching`](/api/classes/itext/#caching) -#### Defined in - -[src/shapes/IText/IText.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L212) - *** ### 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 @@ -484,26 +411,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`centeredRotation`](/api/classes/itext/#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. @@ -511,63 +430,30 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`centeredScaling`](/api/classes/itext/#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 - -``` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`charSpacing`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`clipPath`](/api/classes/itext/#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. @@ -575,58 +461,50 @@ This reference is a UID in the fabric namespace and is temporary stored here. [`IText`](/api/classes/itext/).[`clipPathId`](/api/classes/itext/#clippathid) -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L14) - *** ### compositionColor > **compositionColor**: `string` +Defined in: [src/shapes/IText/IText.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L198) + #### Inherited from [`IText`](/api/classes/itext/).[`compositionColor`](/api/classes/itext/#compositioncolor) -#### Defined in - -[src/shapes/IText/IText.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L205) - *** ### compositionEnd > **compositionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L145) + #### Inherited from [`IText`](/api/classes/itext/).[`compositionEnd`](/api/classes/itext/#compositionend) -#### Defined in - -[src/shapes/IText/IText.ts:144](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L144) - *** ### compositionStart > **compositionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L143) + #### Inherited from [`IText`](/api/classes/itext/).[`compositionStart`](/api/classes/itext/#compositionstart) -#### Defined in - -[src/shapes/IText/IText.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L142) - *** ### 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 @@ -634,16 +512,14 @@ controls are added by default_controls.js [`IText`](/api/classes/itext/).[`controls`](/api/classes/itext/#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 @@ -656,16 +532,14 @@ rgb(178,204,255) [`IText`](/api/classes/itext/).[`cornerColor`](/api/classes/itext/#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 @@ -682,16 +556,14 @@ null [`IText`](/api/classes/itext/).[`cornerDashArray`](/api/classes/itext/#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 @@ -704,16 +576,14 @@ Size of object's controlling corners (in pixels) [`IText`](/api/classes/itext/).[`cornerSize`](/api/classes/itext/#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 @@ -730,20 +600,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`IText`](/api/classes/itext/).[`cornerStrokeColor`](/api/classes/itext/#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 @@ -754,140 +626,96 @@ 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 [`IText`](/api/classes/itext/).[`cornerStyle`](/api/classes/itext/#cornerstyle) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L70) - *** ### ctrlKeysMapDown > **ctrlKeysMapDown**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L42) + For functionalities on keyDown + ctrl || cmd #### Inherited from [`IText`](/api/classes/itext/).[`ctrlKeysMapDown`](/api/classes/itext/#ctrlkeysmapdown) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L42) - *** ### ctrlKeysMapUp > **ctrlKeysMapUp**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L37) + For functionalities on keyUp + ctrl || cmd #### Inherited from [`IText`](/api/classes/itext/).[`ctrlKeysMapUp`](/api/classes/itext/#ctrlkeysmapup) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L37) - *** ### cursorColor > **cursorColor**: `string` +Defined in: [src/shapes/IText/IText.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L184) + Color of text cursor color in editing mode. if not set (default) will take color from the text. if set to a color value that fabric can understand, it will be used instead of the color of the text at the current position. -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`cursorColor`](/api/classes/itext/#cursorcolor) -#### Defined in - -[src/shapes/IText/IText.ts:189](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L189) - *** ### cursorDelay > **cursorDelay**: `number` -Delay between cursor blink (in ms) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L190) -``` +Delay between cursor blink (in ms) #### Inherited from [`IText`](/api/classes/itext/).[`cursorDelay`](/api/classes/itext/#cursordelay) -#### Defined in - -[src/shapes/IText/IText.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L196) - *** ### cursorDuration > **cursorDuration**: `number` -Duration of cursor fade in (in ms) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L196) -``` +Duration of cursor fade in (in ms) #### Inherited from [`IText`](/api/classes/itext/).[`cursorDuration`](/api/classes/itext/#cursorduration) -#### Defined in - -[src/shapes/IText/IText.ts:203](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L203) - *** ### cursorWidth > **cursorWidth**: `number` +Defined in: [src/shapes/IText/IText.ts:175](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L175) + Width of cursor (in px) -#### Default +#### Inherited from -```ts - -``` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`cursorWidth`](/api/classes/itext/#cursorwidth) - -#### Defined in - -[src/shapes/IText/IText.ts:179](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L179) +[`IText`](/api/classes/itext/).[`cursorWidth`](/api/classes/itext/#cursorwidth) *** @@ -895,28 +723,22 @@ Width of cursor (in px) > **deltaY**: `number` -Baseline shift, styles only, keep at 0 for the main text object - -#### Default - -```ts +Defined in: [src/shapes/Text/Text.ts:353](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L353) -``` +Baseline shift, styles only, keep at 0 for the main text object #### Inherited from [`IText`](/api/classes/itext/).[`deltaY`](/api/classes/itext/#deltay) -#### Defined in - -[src/shapes/Text/Text.ts:354](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L354) - *** ### direction > **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 @@ -928,26 +750,18 @@ https://www.w3.org/International/questions/qa-bidi-unicode-controls 4.5.0 -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`direction`](/api/classes/itext/#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 @@ -961,146 +775,102 @@ true [`IText`](/api/classes/itext/).[`dirty`](/api/classes/itext/#dirty) -#### Defined in - -[src/shapes/Object/Object.ts:245](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L245) - *** ### dynamicMinWidth > **dynamicMinWidth**: `number` +Defined in: [src/shapes/Textbox.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L74) + Minimum calculated width of a textbox, in pixels. fixed to 2 so that an empty textbox cannot go to 0 and is still selectable without text. -#### Default - -```ts - -``` - #### Implementation of `UniqueTextboxProps.dynamicMinWidth` -#### Defined in - -[src/shapes/Textbox.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L76) - *** ### editable > **editable**: `boolean` -Indicates whether a text can be edited - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:163](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L163) -``` +Indicates whether a text can be edited #### Inherited from [`IText`](/api/classes/itext/).[`editable`](/api/classes/itext/#editable) -#### Defined in - -[src/shapes/IText/IText.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L165) - *** ### editingBorderColor > **editingBorderColor**: `string` -Border color of text object while it's in editing mode - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L169) -``` +Border color of text object while it's in editing mode #### Inherited from [`IText`](/api/classes/itext/).[`editingBorderColor`](/api/classes/itext/#editingbordercolor) -#### Defined in - -[src/shapes/IText/IText.ts:172](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L172) - *** ### 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 [`IText`](/api/classes/itext/).[`evented`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`excludeFromExport`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`fill`](/api/classes/itext/#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) @@ -1115,16 +885,14 @@ nonzero [`IText`](/api/classes/itext/).[`fillRule`](/api/classes/itext/#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 @@ -1137,16 +905,14 @@ false [`IText`](/api/classes/itext/).[`flipX`](/api/classes/itext/#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 @@ -1159,148 +925,98 @@ false [`IText`](/api/classes/itext/).[`flipY`](/api/classes/itext/#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 #### Inherited from [`IText`](/api/classes/itext/).[`fontFamily`](/api/classes/itext/#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) #### Inherited from [`IText`](/api/classes/itext/).[`fontSize`](/api/classes/itext/#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` -Font style . Possible values: "", "normal", "italic" or "oblique". - -#### Default - -```ts +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". #### Inherited from [`IText`](/api/classes/itext/).[`fontStyle`](/api/classes/itext/#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) - -#### Default - -```ts +Defined in: [src/shapes/Text/Text.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L182) -``` +Font weight (e.g. bold, normal, 400, 600, 800) #### Inherited from [`IText`](/api/classes/itext/).[`fontWeight`](/api/classes/itext/#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 - -```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 [`IText`](/api/classes/itext/).[`globalCompositeOperation`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`hasBorders`](/api/classes/itext/#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 @@ -1313,77 +1029,57 @@ true [`IText`](/api/classes/itext/).[`hasControls`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`height`](/api/classes/itext/#height) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:566](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L566) - *** ### hiddenTextarea > **hiddenTextarea**: `null` \| `HTMLTextAreaElement` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:44](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L44) + #### Inherited from [`IText`](/api/classes/itext/).[`hiddenTextarea`](/api/classes/itext/#hiddentextarea) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L44) - *** ### hiddenTextareaContainer? > `optional` **hiddenTextareaContainer**: `null` \| `HTMLElement` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L53) + DOM container to append the hiddenTextarea. An alternative to attaching to the document.body. Useful to reduce laggish redraw of the full document.body tree and also with modals event capturing that won't let the textarea take focus. -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`hiddenTextareaContainer`](/api/classes/itext/#hiddentextareacontainer) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L54) - *** ### 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 @@ -1396,9 +1092,20 @@ null [`IText`](/api/classes/itext/).[`hoverCursor`](/api/classes/itext/#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 + +#### Inherited from -[src/shapes/Object/InteractiveObject.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L86) +[`IText`](/api/classes/itext/).[`charSpacing`](/api/classes/itext/#charspacing) *** @@ -1406,42 +1113,34 @@ 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 [`IText`](/api/classes/itext/).[`includeDefaultValues`](/api/classes/itext/#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:407](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L407) + #### Inherited from [`IText`](/api/classes/itext/).[`initialized`](/api/classes/itext/#initialized) -#### Defined in - -[src/shapes/Text/Text.ts:413](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L413) - *** ### 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 @@ -1456,38 +1155,28 @@ false [`IText`](/api/classes/itext/).[`inverted`](/api/classes/itext/#inverted) -#### Defined in - -[src/shapes/Object/Object.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L217) - *** ### isEditing > **isEditing**: `boolean` -Indicates whether text is in editing mode - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:157](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L157) -``` +Indicates whether text is in editing mode #### Inherited from [`IText`](/api/classes/itext/).[`isEditing`](/api/classes/itext/#isediting) -#### Defined in - -[src/shapes/IText/IText.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L158) - *** ### 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. @@ -1495,19 +1184,13 @@ part of the move action. [`IText`](/api/classes/itext/).[`isMoving`](/api/classes/itext/#ismoving) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L124) - *** ### isWrapping > **isWrapping**: `boolean` -#### Defined in - -[src/shapes/Textbox.ts:90](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L90) +Defined in: [src/shapes/Textbox.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L88) *** @@ -1515,6 +1198,8 @@ part of the move action. > **keysMap**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L30) + For functionalities on keyDown Map a special key to a function of the instance/prototype If you need different behavior for ESC or TAB or arrows, you have to change @@ -1529,33 +1214,29 @@ The function must be in IText.prototype.myFunction And will receive event as arg [`IText`](/api/classes/itext/).[`keysMap`](/api/classes/itext/#keysmap) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L30) - *** ### keysMapRtl > **keysMapRtl**: `TKeyMapIText` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L32) + #### Inherited from [`IText`](/api/classes/itext/).[`keysMapRtl`](/api/classes/itext/#keysmaprtl) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L32) - *** ### 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 @@ -1567,119 +1248,75 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`IText`](/api/classes/itext/).[`left`](/api/classes/itext/#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 #### Inherited from [`IText`](/api/classes/itext/).[`lineHeight`](/api/classes/itext/#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 - -```ts +Defined in: [src/shapes/Text/Text.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L206) -``` +Text decoration linethrough. #### Inherited from [`IText`](/api/classes/itext/).[`linethrough`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockMovementX`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockMovementY`](/api/classes/itext/#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` +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 -#### Default +#### Inherited from -```ts - -``` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`lockRotation`](/api/classes/itext/#lockrotation) - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L58) +[`IText`](/api/classes/itext/).[`lockRotation`](/api/classes/itext/#lockrotation) *** @@ -1687,125 +1324,97 @@ 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 #### Inherited from [`IText`](/api/classes/itext/).[`lockScalingFlip`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockScalingX`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockScalingY`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockSkewingX`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`lockSkewingY`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`matrixCache`](/api/classes/itext/#matrixcache) -#### Defined in +*** + +### 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 + +#### Inherited from -[src/shapes/Object/ObjectGeometry.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L73) +[`IText`](/api/classes/itext/).[`MIN_TEXT_WIDTH`](/api/classes/itext/#min_text_width) *** @@ -1813,6 +1422,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 @@ -1825,38 +1436,28 @@ Minimum allowed scale value of an object [`IText`](/api/classes/itext/).[`minScaleLimit`](/api/classes/itext/#minscalelimit) -#### Defined in - -[src/shapes/Object/Object.ts:190](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L190) - *** ### minWidth > **minWidth**: `number` -Minimum width of textbox, in pixels. - -#### Default - -```ts +Defined in: [src/shapes/Textbox.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L66) -``` +Minimum width of textbox, in pixels. #### Implementation of `UniqueTextboxProps.minWidth` -#### Defined in - -[src/shapes/Textbox.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L67) - *** ### 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 @@ -1869,16 +1470,14 @@ null [`IText`](/api/classes/itext/).[`moveCursor`](/api/classes/itext/#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. @@ -1895,35 +1494,14 @@ true [`IText`](/api/classes/itext/).[`noScaleCache`](/api/classes/itext/#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 - -[`IText`](/api/classes/itext/).[`oCoords`](/api/classes/itext/#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 @@ -1942,9 +1520,22 @@ true [`IText`](/api/classes/itext/).[`objectCaching`](/api/classes/itext/#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) +[`IText`](/api/classes/itext/).[`oCoords`](/api/classes/itext/#ocoords) *** @@ -1952,6 +1543,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 @@ -1964,16 +1557,14 @@ Opacity of an object [`IText`](/api/classes/itext/).[`opacity`](/api/classes/itext/#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 ::: @@ -1982,16 +1573,14 @@ please use 'center' as value in new projects [`IText`](/api/classes/itext/).[`originX`](/api/classes/itext/#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 ::: @@ -2000,54 +1589,42 @@ please use 'center' as value in new projects [`IText`](/api/classes/itext/).[`originY`](/api/classes/itext/#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 - -```ts +Defined in: [src/shapes/Text/Text.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L200) -``` +Text decoration overline. #### Inherited from [`IText`](/api/classes/itext/).[`overline`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`ownMatrixCache`](/api/classes/itext/#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 @@ -2060,38 +1637,28 @@ Padding between object and its controlling borders (in pixels) [`IText`](/api/classes/itext/).[`padding`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`paintFirst`](/api/classes/itext/#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 @@ -2099,16 +1666,14 @@ Used to keep the original parent ref when the object has been added to an Active [`IText`](/api/classes/itext/).[`parent`](/api/classes/itext/#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 @@ -2132,119 +1697,79 @@ const textPath = new Text('Text on a path', { }); ``` -#### Default - -```ts - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`path`](/api/classes/itext/#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 - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`pathAlign`](/api/classes/itext/#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 - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`pathSide`](/api/classes/itext/#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 - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`pathStartOffset`](/api/classes/itext/#pathstartoffset) -#### 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 [`IText`](/api/classes/itext/).[`perPixelTargetFind`](/api/classes/itext/#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 @@ -2257,16 +1782,14 @@ Object scale factor (horizontal) [`IText`](/api/classes/itext/).[`scaleX`](/api/classes/itext/#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 @@ -2279,48 +1802,32 @@ Object scale factor (vertical) [`IText`](/api/classes/itext/).[`scaleY`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`selectable`](/api/classes/itext/#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. ::: @@ -2329,96 +1836,68 @@ This API is no longer supported and may be removed in a future release. [`IText`](/api/classes/itext/).[`selectionBackgroundColor`](/api/classes/itext/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L79) - *** ### selectionColor > **selectionColor**: `string` -Color of text selection - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L151) -``` +Color of text selection #### Inherited from [`IText`](/api/classes/itext/).[`selectionColor`](/api/classes/itext/#selectioncolor) -#### Defined in - -[src/shapes/IText/IText.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L151) - *** ### selectionEnd > **selectionEnd**: `number` -Index where text selection ends - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L141) -``` +Index where text selection ends #### Inherited from [`IText`](/api/classes/itext/).[`selectionEnd`](/api/classes/itext/#selectionend) -#### Defined in - -[src/shapes/IText/IText.ts:140](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L140) - *** ### selectionStart > **selectionStart**: `number` -Index where text selection starts (or where cursor is when there is no selection) - -#### Default - -```ts +Defined in: [src/shapes/IText/IText.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L135) -``` +Index where text selection starts (or where cursor is when there is no selection) #### Inherited from [`IText`](/api/classes/itext/).[`selectionStart`](/api/classes/itext/#selectionstart) -#### Defined in - -[src/shapes/IText/IText.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L133) - *** ### 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 [`IText`](/api/classes/itext/).[`shadow`](/api/classes/itext/#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 @@ -2431,16 +1910,14 @@ Angle of skew on x axes of an object (in degrees) [`IText`](/api/classes/itext/).[`skewX`](/api/classes/itext/#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 @@ -2453,32 +1930,28 @@ Angle of skew on y axes of an object (in degrees) [`IText`](/api/classes/itext/).[`skewY`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`snapAngle`](/api/classes/itext/#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. @@ -2486,16 +1959,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`IText`](/api/classes/itext/).[`snapThreshold`](/api/classes/itext/#snapthreshold) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L54) - *** ### splitByGrapheme > **splitByGrapheme**: `boolean` +Defined in: [src/shapes/Textbox.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L82) + Use this boolean property in order to split strings that have no white space concept. this is a cheap way to help with chinese/japanese @@ -2507,30 +1978,26 @@ this is a cheap way to help with chinese/japanese `UniqueTextboxProps.splitByGrapheme` -#### Defined in - -[src/shapes/Textbox.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L84) - *** ### 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 [`IText`](/api/classes/itext/).[`stroke`](/api/classes/itext/#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 @@ -2543,16 +2010,14 @@ null; [`IText`](/api/classes/itext/).[`strokeDashArray`](/api/classes/itext/#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 @@ -2565,16 +2030,14 @@ Line offset of an object's stroke [`IText`](/api/classes/itext/).[`strokeDashOffset`](/api/classes/itext/#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 @@ -2587,38 +2050,28 @@ butt [`IText`](/api/classes/itext/).[`strokeLineCap`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`strokeLineJoin`](/api/classes/itext/#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 @@ -2631,16 +2084,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`IText`](/api/classes/itext/).[`strokeMiterLimit`](/api/classes/itext/#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 @@ -2666,16 +2117,14 @@ false [`IText`](/api/classes/itext/).[`strokeUniform`](/api/classes/itext/#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 @@ -2688,30 +2137,26 @@ Width of a stroke used to render this object [`IText`](/api/classes/itext/).[`strokeWidth`](/api/classes/itext/#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) + #### Inherited from [`IText`](/api/classes/itext/).[`styles`](/api/classes/itext/#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 @@ -2742,16 +2187,14 @@ fontSize factor [`IText`](/api/classes/itext/).[`subscript`](/api/classes/itext/#subscript) -#### 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 @@ -2782,68 +2225,74 @@ fontSize factor [`IText`](/api/classes/itext/).[`superscript`](/api/classes/itext/#superscript) -#### 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:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L170) + #### Inherited from [`IText`](/api/classes/itext/).[`text`](/api/classes/itext/#text) -#### Defined in - -[src/shapes/Text/Text.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L167) - *** ### textAlign > **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 - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`textAlign`](/api/classes/itext/#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 +#### Inherited from + +[`IText`](/api/classes/itext/).[`textBackgroundColor`](/api/classes/itext/#textbackgroundcolor) + +*** + +### 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 ``` #### Inherited from -[`IText`](/api/classes/itext/).[`textBackgroundColor`](/api/classes/itext/#textbackgroundcolor) - -#### Defined in - -[src/shapes/Text/Text.ts:270](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L270) +[`IText`](/api/classes/itext/).[`textDecorationThickness`](/api/classes/itext/#textdecorationthickness) *** @@ -2851,32 +2300,26 @@ 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 - -``` - #### Inherited from [`IText`](/api/classes/itext/).[`textLines`](/api/classes/itext/#textlines) -#### 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 @@ -2888,16 +2331,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`IText`](/api/classes/itext/).[`top`](/api/classes/itext/#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 @@ -2910,16 +2351,14 @@ Size of object's controlling corners when touch interaction is detected [`IText`](/api/classes/itext/).[`touchCornerSize`](/api/classes/itext/#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 @@ -2932,112 +2371,74 @@ true [`IText`](/api/classes/itext/).[`transparentCorners`](/api/classes/itext/#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 - -```ts +Defined in: [src/shapes/Text/Text.ts:194](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L194) -``` +Text decoration underline. #### Inherited from [`IText`](/api/classes/itext/).[`underline`](/api/classes/itext/#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 +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 [`IText`](/api/classes/itext/).[`visible`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`width`](/api/classes/itext/#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 [FabricText.fromElement](../../../../api/classes/fabrictext/#fromelement)) - -#### Static +### \_styleProperties -#### Member Of +> `static` **\_styleProperties**: readonly `StylePropertiesType`[] = `styleProperties` -Text -@see: http://www.w3.org/TR/SVG/text.html#TextElement +Defined in: [src/shapes/Text/StyledText.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L30) #### Inherited from -[`IText`](/api/classes/itext/).[`ATTRIBUTE_NAMES`](/api/classes/itext/#attribute_names) - -#### Defined in - -[src/shapes/Text/Text.ts:1826](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1826) +[`IText`](/api/classes/itext/).[`_styleProperties`](/api/classes/itext/#_styleproperties) *** -### \_styleProperties +### ATTRIBUTE\_NAMES -> `static` **\_styleProperties**: readonly `StylePropertiesType`[] = `styleProperties` +> `static` **ATTRIBUTE\_NAMES**: `string`[] -#### Inherited from +Defined in: [src/shapes/Text/Text.ts:1836](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L1836) -[`IText`](/api/classes/itext/).[`_styleProperties`](/api/classes/itext/#_styleproperties) +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 -#### Defined in +#### Inherited from -[src/shapes/Text/StyledText.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L30) +[`IText`](/api/classes/itext/).[`ATTRIBUTE_NAMES`](/api/classes/itext/#attribute_names) *** @@ -3045,6 +2446,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 @@ -3054,32 +2457,28 @@ and refreshed at the next render [`IText`](/api/classes/itext/).[`cacheProperties`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`colorProperties`](/api/classes/itext/#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 @@ -3087,16 +2486,14 @@ instance.toObject() gets called [`IText`](/api/classes/itext/).[`customProperties`](/api/classes/itext/#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 @@ -3107,30 +2504,26 @@ https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name [`IText`](/api/classes/itext/).[`genericFonts`](/api/classes/itext/#genericfonts) -#### 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/)\<[`Textbox`](/api/classes/textbox/)\<`Partial`\<[`TextboxProps`](/api/interfaces/textboxprops/)\>, [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\>\>\> = `textboxDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Textbox`\<`Partial`\<[`TextboxProps`](/api/interfaces/textboxprops/)\>, [`SerializedTextboxProps`](/api/interfaces/serializedtextboxprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\>\>\> = `textboxDefaultValues` + +Defined in: [src/shapes/Textbox.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L94) #### Overrides [`IText`](/api/classes/itext/).[`ownDefaults`](/api/classes/itext/#owndefaults) -#### Defined in - -[src/shapes/Textbox.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L96) - *** ### 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 @@ -3139,36 +2532,34 @@ needs its cache regenerated during a .set call [`IText`](/api/classes/itext/).[`stateProperties`](/api/classes/itext/#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` = `'Textbox'` +Defined in: [src/shapes/Textbox.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L90) + #### Overrides [`IText`](/api/classes/itext/).[`type`](/api/classes/itext/#type) -#### Defined in - -[src/shapes/Textbox.ts:92](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L92) - ## Accessors ### type -> `get` **type**(): `string` +#### Get Signature + +> **get** **type**(): `string` + +Defined in: [src/shapes/IText/IText.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L214) 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 @@ -3176,7 +2567,7 @@ add sustainable warning message This API is no longer supported and may be removed in a future release. ::: -#### Returns +##### Returns `string` @@ -3184,25 +2575,29 @@ This API is no longer supported and may be removed in a future release. [`IText`](/api/classes/itext/).[`type`](/api/classes/itext/#type-1) -#### Defined in - -[src/shapes/IText/IText.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L222) - ## 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 + +`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 @@ -3212,23 +2607,25 @@ Prepare clipPath state and cache and draw it on instance's cache [`IText`](/api/classes/itext/).[`_drawClipPath`](/api/classes/itext/#_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?**: `boolean` +##### forMeasuring? + +`boolean` #### Returns @@ -3240,35 +2637,43 @@ font declaration formatted for canvas context. [`IText`](/api/classes/itext/).[`_getFontDeclaration`](/api/classes/itext/#_getfontdeclaration) -#### 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 @@ -3280,26 +2685,28 @@ grapheme bbox [`IText`](/api/classes/itext/).[`_getGraphemeBox`](/api/classes/itext/#_getgraphemebox) -#### Defined in - -[src/shapes/Text/Text.ts:983](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L983) - *** ### \_getSelectionForOffset() > **\_getSelectionForOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:383](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L383) + private Helps finding if the offset should be counted from Start or End #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -3309,16 +2716,14 @@ Event object [`IText`](/api/classes/itext/).[`_getSelectionForOffset`](/api/classes/itext/#_getselectionforoffset) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:377](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L377) - *** ### \_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` @@ -3327,56 +2732,51 @@ Event object [`IText`](/api/classes/itext/).[`_getWidthOfCharSpacing`](/api/classes/itext/#_getwidthofcharspacing) -#### 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 [`IText`](/api/classes/itext/).[`_limitCacheSize`](/api/classes/itext/#_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 @@ -3384,8 +2784,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` @@ -3398,36 +2796,36 @@ object.numOfSpaces length of chars that match this._reSpacesAndTabs [`IText`](/api/classes/itext/).[`_measureLine`](/api/classes/itext/#_measureline) -#### Defined in - -[src/shapes/Text/Text.ts:891](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L891) - *** ### \_measureWord() > **\_measureWord**(`word`, `lineIndex`, `charOffset`): `number` +Defined in: [src/shapes/Textbox.ts:386](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L386) + Helper function to measure a string of text, given its lineIndex and charIndex offset It gets called when charBounds are not available yet. Override if necessary -Use with [Textbox#wordSplit](../../../../api/classes/textbox/#wordsplit) +Use with [Textbox#wordSplit](/api/classes/textbox/#wordsplit) #### Parameters -• **word**: `string`[] +##### word -• **lineIndex**: `number` - -• **charOffset**: `number` = `0` +`string`[] -#### Returns +##### lineIndex `number` -#### Defined in +##### charOffset + +`number` = `0` + +#### Returns -[src/shapes/Textbox.ts:389](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L389) +`number` *** @@ -3435,6 +2833,8 @@ Use with [Textbox#wordSplit](../../../../api/classes/textbox/#wordsplit) > **\_mouseDownHandler**(`__namedParameters`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L98) + Default event handler for the basic functionalities needed on _mouseDown can be overridden to do something different. Scope of this implementation is: find the click position, set selectionStart @@ -3444,33 +2844,9 @@ current compositionMode. It will be set to false. #### Parameters -• **\_\_namedParameters**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Returns - -`void` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`_mouseDownHandler`](/api/classes/itext/#_mousedownhandler) - -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L136) - -*** - -### \_mouseDownHandlerBefore() +##### \_\_namedParameters -> **\_mouseDownHandlerBefore**(`__namedParameters`): `void` - -Default event handler for the basic functionalities needed on mousedown:before -can be overridden to do something different. -Scope of this implementation is: verify the object is already selected when mousing down - -#### Parameters - -• **\_\_namedParameters**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` #### Returns @@ -3478,11 +2854,7 @@ Scope of this implementation is: verify the object is already selected when mous #### Inherited from -[`IText`](/api/classes/itext/).[`_mouseDownHandlerBefore`](/api/classes/itext/#_mousedownhandlerbefore) - -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:171](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L171) +[`IText`](/api/classes/itext/).[`_mouseDownHandler`](/api/classes/itext/#_mousedownhandler) *** @@ -3490,15 +2862,21 @@ Scope of this implementation is: verify the object is already selected when mous > **\_moveCursorLeftOrRight**(`direction`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:645](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L645) + Moves cursor right or Left, fires event #### Parameters -• **direction**: `"Left"` \| `"Right"` +##### direction 'Left', 'Right' -• **e**: `KeyboardEvent` +`"Left"` | `"Right"` + +##### e + +`KeyboardEvent` Event object @@ -3510,25 +2888,27 @@ Event object [`IText`](/api/classes/itext/).[`_moveCursorLeftOrRight`](/api/classes/itext/#_movecursorleftorright) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:639](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L639) - *** ### \_moveCursorUpOrDown() > **\_moveCursorUpOrDown**(`direction`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:483](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L483) + Moves cursor up or down, fires the events #### Parameters -• **direction**: `"Up"` \| `"Down"` +##### direction 'Up' or 'Down' -• **e**: `KeyboardEvent` +`"Up"` | `"Down"` + +##### e + +`KeyboardEvent` Event object @@ -3540,16 +2920,14 @@ Event object [`IText`](/api/classes/itext/).[`_moveCursorUpOrDown`](/api/classes/itext/#_movecursorupordown) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:477](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L477) - *** ### \_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 @@ -3560,26 +2938,28 @@ Remove cacheCanvas and its dimensions from the objects [`IText`](/api/classes/itext/).[`_removeCacheCanvas`](/api/classes/itext/#_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 @@ -3595,25 +2975,31 @@ move to interactivity [`IText`](/api/classes/itext/).[`_renderControls`](/api/classes/itext/#_rendercontrols) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:435](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L435) - *** ### \_renderCursor() > **\_renderCursor**(`ctx`, `boundaries`, `selectionStart`): `void` +Defined in: [src/shapes/IText/IText.ts:604](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L604) + Render the cursor at the given selectionStart. #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` + +transformed context to draw on + +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +##### selectionStart -• **selectionStart**: `number` +`number` #### Returns @@ -3623,19 +3009,19 @@ Render the cursor at the given selectionStart. [`IText`](/api/classes/itext/).[`_renderCursor`](/api/classes/itext/#_rendercursor) -#### Defined in - -[src/shapes/IText/IText.ts:550](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L550) - *** ### \_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 @@ -3645,24 +3031,26 @@ Render the cursor at the given selectionStart. [`IText`](/api/classes/itext/).[`_setClippingProperties`](/api/classes/itext/#_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`\<[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### style + +`Pick`\<`this`, `"fill"`\> with ill defined @@ -3682,24 +3070,26 @@ with ill defined [`IText`](/api/classes/itext/).[`_setFillStyles`](/api/classes/itext/#_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 @@ -3719,22 +3109,22 @@ with stroke and strokeWidth defined [`IText`](/api/classes/itext/).[`_setStrokeStyles`](/api/classes/itext/#_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 @@ -3746,22 +3136,22 @@ Rendering canvas context [`IText`](/api/classes/itext/).[`_setupCompositeOperation`](/api/classes/itext/#_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/Textbox.ts:530](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L530) + Gets lines of text to render in the Textbox. This function calculates text wrapping on the fly every time it is called. #### Parameters -• **text**: `string` +##### text + +`string` text to split @@ -3775,15 +3165,13 @@ Array of lines in the Textbox. [`IText`](/api/classes/itext/).[`_splitTextIntoLines`](/api/classes/itext/#_splittextintolines) -#### Defined in - -[src/shapes/Textbox.ts:533](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L533) - *** ### \_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 @@ -3791,7 +3179,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 @@ -3804,16 +3194,14 @@ of the instance [`IText`](/api/classes/itext/).[`_toSVG`](/api/classes/itext/#_tosvg) -#### Defined in - -[src/shapes/Object/FabricObjectSVGExportMixin.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L120) - *** ### \_wrapText() > **\_wrapText**(`lines`, `desiredWidth`): `string`[][] +Defined in: [src/shapes/Textbox.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L321) + Wraps text using the 'width' property of Textbox. First this function splits text on newlines, so we preserve newlines entered by the user. Then it wraps each line using the width of the Textbox by calling @@ -3821,11 +3209,15 @@ _wrapLine(). #### Parameters -• **lines**: `string`[] +##### lines + +`string`[] The string array of text that is split into lines -• **desiredWidth**: `number` +##### desiredWidth + +`number` width you want to wrap to @@ -3835,16 +3227,14 @@ width you want to wrap to Array of lines -#### Defined in - -[src/shapes/Textbox.ts:324](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L324) - *** ### abortCursorAnimation() > **abortCursorAnimation**(): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:182](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L182) + Aborts cursor animation, clears all timeouts and clear textarea context if necessary #### Returns @@ -3855,19 +3245,19 @@ Aborts cursor animation, clears all timeouts and clear textarea context if neces [`IText`](/api/classes/itext/).[`abortCursorAnimation`](/api/classes/itext/#abortcursoranimation) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:183](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L183) - *** ### 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 @@ -3877,33 +3267,37 @@ Aborts cursor animation, clears all timeouts and clear textarea context if neces [`IText`](/api/classes/itext/).[`addPaintOrder`](/api/classes/itext/#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 @@ -3912,24 +3306,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 [`IText`](/api/classes/itext/).[`animate`](/api/classes/itext/#animate) -#### Defined in - -[src/shapes/Object/Object.ts:1557](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1557) - *** ### blur() > **blur**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L106) + Override this method to customize cursor behavior on textbox blur #### Returns @@ -3940,16 +3332,14 @@ Override this method to customize cursor behavior on textbox blur [`IText`](/api/classes/itext/).[`blur`](/api/classes/itext/#blur) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L106) - *** ### 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. @@ -3961,16 +3351,14 @@ those never change with zoom or viewport changes. [`IText`](/api/classes/itext/).[`calcACoords`](/api/classes/itext/#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 @@ -3984,16 +3372,14 @@ is a public api and should be done just if extremely necessary [`IText`](/api/classes/itext/).[`calcOCoords`](/api/classes/itext/#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 @@ -4007,16 +3393,14 @@ transform matrix for the object [`IText`](/api/classes/itext/).[`calcOwnMatrix`](/api/classes/itext/#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 @@ -4027,22 +3411,22 @@ Calculate text box height [`IText`](/api/classes/itext/).[`calcTextHeight`](/api/classes/itext/#calctextheight) -#### 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. @@ -4057,21 +3441,21 @@ transform matrix for the object [`IText`](/api/classes/itext/).[`calcTransformMatrix`](/api/classes/itext/#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/IText/ITextClickBehavior.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L64) + override this method to control whether instance should/shouldn't become a drop target #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -4081,16 +3465,14 @@ override this method to control whether instance should/shouldn't become a drop [`IText`](/api/classes/itext/).[`canDrop`](/api/classes/itext/#candrop) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L75) - *** ### 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 @@ -4100,9 +3482,9 @@ then it also is deleted. #### Parameters -• **property**: `StylePropertiesType` +##### property -The property to compare between characters and text. +`StylePropertiesType` #### Returns @@ -4112,15 +3494,13 @@ The property to compare between characters and text. [`IText`](/api/classes/itext/).[`cleanStyle`](/api/classes/itext/#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. @@ -4129,7 +3509,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. @@ -4148,41 +3530,39 @@ discuss swapping restoreManually with a renderCallback, but think of async issue [`IText`](/api/classes/itext/).[`clearContextTop`](/api/classes/itext/#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`\<[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Textbox`\<`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`\<[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Textbox`\<`Props`, `SProps`, `EventSpec`\>\> #### Inherited from [`IText`](/api/classes/itext/).[`clone`](/api/classes/itext/#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. @@ -4193,13 +3573,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. @@ -4211,9 +3593,23 @@ fix the export type, it could not be Image but the type that getClass return for [`IText`](/api/classes/itext/).[`cloneAsImage`](/api/classes/itext/#cloneasimage) -#### Defined in +*** + +### cmdAll() + +> **cmdAll**(): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:229](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L229) + +Selects entire text and updates the visual state + +#### Returns + +`void` + +#### Inherited from -[src/shapes/Object/Object.ts:1318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1318) +[`IText`](/api/classes/itext/).[`cmdAll`](/api/classes/itext/#cmdall) *** @@ -4221,6 +3617,8 @@ fix the export type, it could not be Image but the type that getClass return for > **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 @@ -4233,21 +3631,21 @@ complexity [`IText`](/api/classes/itext/).[`complexity`](/api/classes/itext/#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 @@ -4261,16 +3659,14 @@ true if point is inside the object [`IText`](/api/classes/itext/).[`containsPoint`](/api/classes/itext/#containspoint) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:282](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L282) - *** ### copy() > **copy**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:301](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L301) + Copies selected text #### Returns @@ -4281,16 +3677,14 @@ Copies selected text [`IText`](/api/classes/itext/).[`copy`](/api/classes/itext/#copy) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:295](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L295) - *** ### dispose() > **dispose**(): `void` +Defined in: [src/shapes/IText/IText.ts:776](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L776) + cancel instance's running animations override if necessary to dispose artifacts such as `clipPath` @@ -4302,21 +3696,21 @@ override if necessary to dispose artifacts such as `clipPath` [`IText`](/api/classes/itext/).[`dispose`](/api/classes/itext/#dispose) -#### Defined in - -[src/shapes/IText/IText.ts:722](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L722) - *** ### doubleClickHandler() > **doubleClickHandler**(`options`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L71) + Default handler for double click, select a word #### Parameters -• **options**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### options + +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/) #### Returns @@ -4326,15 +3720,13 @@ Default handler for double click, select a word [`IText`](/api/classes/itext/).[`doubleClickHandler`](/api/classes/itext/#doubleclickhandler) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L111) - *** ### 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 @@ -4342,15 +3734,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 @@ -4362,23 +3760,25 @@ object to override the object style [`IText`](/api/classes/itext/).[`drawBorders`](/api/classes/itext/#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 @@ -4390,27 +3790,31 @@ Context to render on [`IText`](/api/classes/itext/).[`drawCacheOnCanvas`](/api/classes/itext/#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 @@ -4420,16 +3824,14 @@ Context to render on [`IText`](/api/classes/itext/).[`drawClipPathOnCache`](/api/classes/itext/#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 @@ -4439,11 +3841,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 @@ -4455,27 +3861,29 @@ object to override the object style [`IText`](/api/classes/itext/).[`drawControls`](/api/classes/itext/#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 @@ -4487,29 +3895,33 @@ object size x = width, y = height [`IText`](/api/classes/itext/).[`drawControlsConnectingLines`](/api/classes/itext/#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 @@ -4521,16 +3933,14 @@ additional context for rendering [`IText`](/api/classes/itext/).[`drawObject`](/api/classes/itext/#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 @@ -4538,7 +3948,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -4556,16 +3968,14 @@ it seemed a good option, now is an edge case [`IText`](/api/classes/itext/).[`drawSelectionBackground`](/api/classes/itext/#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 @@ -4576,21 +3986,21 @@ Enlarge space boxes and shift the others [`IText`](/api/classes/itext/).[`enlargeSpaces`](/api/classes/itext/#enlargespaces) -#### Defined in - -[src/shapes/Text/Text.ts:491](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L491) - *** ### enterEditing() -> **enterEditing**(`e`?): `void` +> **enterEditing**(`e?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:391](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L391) Enters editing state #### Parameters -• **e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e? + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) #### Returns @@ -4600,17 +4010,15 @@ Enters editing state [`IText`](/api/classes/itext/).[`enterEditing`](/api/classes/itext/#enterediting) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L386) - *** ### enterEditingImpl() > **enterEditingImpl**(): `void` -runs the actual logic that enter from editing state, see [enterEditing](../../../../api/classes/textbox/#enterediting) +Defined in: [src/shapes/IText/ITextBehavior.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L410) + +runs the actual logic that enter from editing state, see [enterEditing](/api/classes/textbox/#enterediting) #### Returns @@ -4620,37 +4028,33 @@ runs the actual logic that enter from editing state, see [enterEditing](../../.. [`IText`](/api/classes/itext/).[`enterEditingImpl`](/api/classes/itext/#entereditingimpl) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:405](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L405) - *** ### exitEditing() -> **exitEditing**(): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +> **exitEditing**(): `Textbox`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/IText/ITextBehavior.ts:710](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L710) Exits from editing state and fires relevant events #### Returns -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +`Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from [`IText`](/api/classes/itext/).[`exitEditing`](/api/classes/itext/#exitediting) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:715](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L715) - *** ### exitEditingImpl() > **exitEditingImpl**(): `void` -runs the actual logic that exits from editing state, see [exitEditing](../../../../api/classes/textbox/#exitediting) +Defined in: [src/shapes/IText/ITextBehavior.ts:686](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L686) + +runs the actual logic that exits from editing state, see [exitEditing](/api/classes/textbox/#exitediting) But it does not fire events #### Returns @@ -4661,9 +4065,27 @@ But it does not fire events [`IText`](/api/classes/itext/).[`exitEditingImpl`](/api/classes/itext/#exiteditingimpl) -#### Defined in +*** + +### findAncestorsWithClipPath() + +> **findAncestorsWithClipPath**(): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] + +Defined in: [src/shapes/IText/IText.ts:441](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L441) -[src/shapes/IText/ITextBehavior.ts:702](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L702) +Finds and returns an array of clip paths that are applied to the parent +group(s) of the current FabricObject instance. The object's hierarchy is +traversed upwards (from the current object towards the root of the canvas), +checking each parent object for the presence of a `clipPath` that is not +absolutely positioned. + +#### Returns + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] + +#### Inherited from + +[`IText`](/api/classes/itext/).[`findAncestorsWithClipPath`](/api/classes/itext/#findancestorswithclippath) *** @@ -4671,15 +4093,21 @@ But it does not fire events > **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* [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -4691,21 +4119,21 @@ an object that represent the ancestry situation. [`IText`](/api/classes/itext/).[`findCommonAncestors`](/api/classes/itext/#findcommonancestors) -#### Defined in - -[src/shapes/Object/Object.ts:1675](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1675) - *** ### findLineBoundaryLeft() > **findLineBoundaryLeft**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L295) + Find new selection index representing start of current line according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4719,21 +4147,21 @@ New selection index [`IText`](/api/classes/itext/).[`findLineBoundaryLeft`](/api/classes/itext/#findlineboundaryleft) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L288) - *** ### findLineBoundaryRight() > **findLineBoundaryRight**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:312](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L312) + Find new selection index representing end of current line according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4747,21 +4175,21 @@ New selection index [`IText`](/api/classes/itext/).[`findLineBoundaryRight`](/api/classes/itext/#findlineboundaryright) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:305](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L305) - *** ### findWordBoundaryLeft() > **findWordBoundaryLeft**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:247](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L247) + Find new selection index representing start of current word according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4775,21 +4203,21 @@ New selection index [`IText`](/api/classes/itext/).[`findWordBoundaryLeft`](/api/classes/itext/#findwordboundaryleft) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L240) - *** ### findWordBoundaryRight() > **findWordBoundaryRight**(`startFrom`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:271](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L271) + Find new selection index representing end of current word according to current selection index #### Parameters -• **startFrom**: `number` +##### startFrom + +`number` Current selection index @@ -4803,29 +4231,33 @@ New selection index [`IText`](/api/classes/itext/).[`findWordBoundaryRight`](/api/classes/itext/#findwordboundaryright) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L264) - *** ### 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 @@ -4837,22 +4269,22 @@ Options object [`IText`](/api/classes/itext/).[`fire`](/api/classes/itext/#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 @@ -4864,25 +4296,29 @@ function to iterate over the controls over [`IText`](/api/classes/itext/).[`forEachControl`](/api/classes/itext/#foreachcontrol) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:353](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L353) - *** ### fromGraphemeToStringSelection() > **fromGraphemeToStringSelection**(`start`, `end`, `graphemes`): `object` +Defined in: [src/shapes/IText/ITextBehavior.ts:503](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L503) + convert from fabric to textarea values #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### graphemes -• **graphemes**: `string`[] +`string`[] #### Returns @@ -4900,25 +4336,29 @@ convert from fabric to textarea values [`IText`](/api/classes/itext/).[`fromGraphemeToStringSelection`](/api/classes/itext/#fromgraphemetostringselection) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:498](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L498) - *** ### fromStringToGraphemeSelection() > **fromStringToGraphemeSelection**(`start`, `end`, `text`): `object` +Defined in: [src/shapes/IText/ITextBehavior.ts:486](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L486) + convert from textarea to grapheme indexes #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### text -• **text**: `string` +`string` #### Returns @@ -4936,21 +4376,21 @@ convert from textarea to grapheme indexes [`IText`](/api/classes/itext/).[`fromStringToGraphemeSelection`](/api/classes/itext/#fromstringtographemeselection) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:481](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L481) - *** ### 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 @@ -4964,25 +4404,27 @@ value of a property [`IText`](/api/classes/itext/).[`get`](/api/classes/itext/#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/IText/IText.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L340) Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) #### Parameters -• **selectionStart?**: `number` = `...` +##### selectionStart? + +`number` = `...` Optional index. When not given, current selectionStart is used. -• **skipWrapping?**: `boolean` +##### skipWrapping? + +`boolean` consider the location for unwrapped lines. useful to manage styles. @@ -5002,34 +4444,30 @@ consider the location for unwrapped lines. useful to manage styles. [`IText`](/api/classes/itext/).[`get2DCursorLocation`](/api/classes/itext/#get2dcursorlocation) -#### Defined in - -[src/shapes/IText/IText.ts:348](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L348) - *** ### 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 [`IText`](/api/classes/itext/).[`getActiveControl`](/api/classes/itext/#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` @@ -5040,16 +4478,14 @@ ancestors (excluding `ActiveSelection`) from bottom to top [`IText`](/api/classes/itext/).[`getAncestors`](/api/classes/itext/#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. @@ -5063,16 +4499,14 @@ Object with left, top, width, height properties [`IText`](/api/classes/itext/).[`getBoundingRect`](/api/classes/itext/#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` @@ -5081,16 +4515,14 @@ Object with left, top, width, height properties [`IText`](/api/classes/itext/).[`getCanvasRetinaScaling`](/api/classes/itext/#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 @@ -5101,26 +4533,28 @@ Returns the center coordinates of the object relative to canvas [`IText`](/api/classes/itext/).[`getCenterPoint`](/api/classes/itext/#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 @@ -5134,16 +4568,14 @@ style object [`IText`](/api/classes/itext/).[`getCompleteStyleDeclaration`](/api/classes/itext/#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/)[] @@ -5154,16 +4586,14 @@ style object [`IText`](/api/classes/itext/).[`getCoords`](/api/classes/itext/#getcoords) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L204) - *** ### getCurrentCharColor() > **getCurrentCharColor**(): `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/IText/IText.ts:760](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L760) + High level function to know the color of the cursor. the currentChar is the one that precedes the cursor Returns color (fill) of char at the current cursor @@ -5180,16 +4610,14 @@ Character color (fill) [`IText`](/api/classes/itext/).[`getCurrentCharColor`](/api/classes/itext/#getcurrentcharcolor) -#### Defined in - -[src/shapes/IText/IText.ts:706](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L706) - *** ### getCurrentCharFontSize() > **getCurrentCharFontSize**(): `number` +Defined in: [src/shapes/IText/IText.ts:747](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L747) + High level function to know the height of the cursor. the currentChar is the one that precedes the cursor Returns fontSize of char at the current cursor @@ -5205,16 +4633,14 @@ Character font size [`IText`](/api/classes/itext/).[`getCurrentCharFontSize`](/api/classes/itext/#getcurrentcharfontsize) -#### Defined in - -[src/shapes/IText/IText.ts:693](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L693) - *** ### getCursorRenderingData() > **getCursorRenderingData**(`selectionStart`, `boundaries`): [`CursorRenderingData`](/api/type-aliases/cursorrenderingdata/) +Defined in: [src/shapes/IText/IText.ts:570](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L570) + Return the data needed to render the cursor for given selection start The left,top are relative to the object, while width and height are prescaled to look think with canvas zoom and object scaling, @@ -5222,9 +4648,13 @@ so they depend on canvas and object scaling #### Parameters -• **selectionStart**: `number` = `...` +##### selectionStart + +`number` = `...` -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) = `...` +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) = `...` #### Returns @@ -5234,25 +4664,27 @@ so they depend on canvas and object scaling [`IText`](/api/classes/itext/).[`getCursorRenderingData`](/api/classes/itext/#getcursorrenderingdata) -#### Defined in - -[src/shapes/IText/IText.ts:516](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L516) - *** ### getDownCursorOffset() > **getDownCursorOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:351](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L351) + Gets start offset of a selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -5262,23 +4694,23 @@ Event object [`IText`](/api/classes/itext/).[`getDownCursorOffset`](/api/classes/itext/#getdowncursoroffset) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:345](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L345) - *** ### getGraphemeDataForRender() > **getGraphemeDataForRender**(`lines`): [`GraphemeData`](/api/type-aliases/graphemedata/) +Defined in: [src/shapes/Textbox.ts:340](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L340) + For each line of text terminated by an hard line stop, measure each word width and extract the largest word from all. The returned words here are the one that at the end will be rendered. #### Parameters -• **lines**: `string`[] +##### lines + +`string`[] the lines we need to measure @@ -5286,25 +4718,27 @@ the lines we need to measure [`GraphemeData`](/api/type-aliases/graphemedata/) -#### Defined in - -[src/shapes/Textbox.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L343) - *** ### 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 @@ -5318,21 +4752,21 @@ fontSize of the character [`IText`](/api/classes/itext/).[`getHeightOfChar`](/api/classes/itext/#getheightofchar) -#### 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 @@ -5344,30 +4778,26 @@ index of line to calculate [`IText`](/api/classes/itext/).[`getHeightOfLine`](/api/classes/itext/#getheightofline) -#### Defined in - -[src/shapes/Text/Text.ts:1025](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1025) - *** ### getMinWidth() > **getMinWidth**(): `number` +Defined in: [src/shapes/Textbox.ts:542](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L542) + #### Returns `number` -#### Defined in - -[src/shapes/Textbox.ts:545](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L545) - *** ### 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 @@ -5378,16 +4808,14 @@ Return the object opacity counting also the group property [`IText`](/api/classes/itext/).[`getObjectOpacity`](/api/classes/itext/#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 @@ -5398,16 +4826,14 @@ Return the object scale factor counting also the group scaling [`IText`](/api/classes/itext/).[`getObjectScaling`](/api/classes/itext/#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 @@ -5417,11 +4843,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' @@ -5433,16 +4863,14 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`getPointByOrigin`](/api/classes/itext/#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 @@ -5453,78 +4881,70 @@ Returns the center coordinates of the object relative to it's parent [`IText`](/api/classes/itext/).[`getRelativeCenterPoint`](/api/classes/itext/#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/textbox/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/textbox/#getx) #### Inherited from [`IText`](/api/classes/itext/).[`getRelativeX`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`getRelativeXY`](/api/classes/itext/#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/textbox/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/textbox/#gety) #### Inherited from [`IText`](/api/classes/itext/).[`getRelativeY`](/api/classes/itext/#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 @@ -5541,16 +4961,14 @@ shouldn't this account for group transform and return the actual size in canvas [`IText`](/api/classes/itext/).[`getScaledHeight`](/api/classes/itext/#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 @@ -5567,16 +4985,14 @@ shouldn't this account for group transform and return the actual size in canvas [`IText`](/api/classes/itext/).[`getScaledWidth`](/api/classes/itext/#getscaledwidth) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L352) - *** ### getSelectedText() > **getSelectedText**(): `string` +Defined in: [src/shapes/IText/ITextBehavior.ts:238](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L238) + Returns selected text #### Returns @@ -5587,21 +5003,21 @@ Returns selected text [`IText`](/api/classes/itext/).[`getSelectedText`](/api/classes/itext/#getselectedtext) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L231) - *** ### getSelectionStartFromPointer() > **getSelectionStartFromPointer**(`e`): `number` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L193) + Returns index of a character corresponding to where an object was clicked #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) Event object @@ -5615,30 +5031,34 @@ Index of a character [`IText`](/api/classes/itext/).[`getSelectionStartFromPointer`](/api/classes/itext/#getselectionstartfrompointer) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:246](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L246) - *** ### 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/IText/IText.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L313) Gets style of a current selection/cursor (at the start position) if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used. #### Parameters -• **startIndex**: `number` = `...` +##### startIndex + +`number` = `...` Start index to get styles at -• **endIndex**: `number` = `...` +##### endIndex + +`number` = `...` End index to get styles at, if not specified selectionEnd or startIndex + 1 -• **complete?**: `boolean` +##### complete? + +`boolean` get full style or not @@ -5652,21 +5072,21 @@ styles an array with one, zero or more Style objects [`IText`](/api/classes/itext/).[`getSelectionStyles`](/api/classes/itext/#getselectionstyles) -#### Defined in - -[src/shapes/IText/IText.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L321) - *** ### 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 @@ -5676,21 +5096,21 @@ Returns id attribute for svg output [`IText`](/api/classes/itext/).[`getSvgCommons`](/api/classes/itext/#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 @@ -5700,23 +5120,25 @@ Returns filter for svg shadow [`IText`](/api/classes/itext/).[`getSvgFilter`](/api/classes/itext/#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/)\> + +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -5728,25 +5150,29 @@ a boolean to skip shadow filter output [`IText`](/api/classes/itext/).[`getSvgStyles`](/api/classes/itext/#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? -• **full?**: `boolean` +`boolean` + +##### additionalTransform? -• **additionalTransform?**: `string` = `''` +`string` = `''` #### Returns @@ -5756,16 +5182,14 @@ Returns transform-string for svg-export [`IText`](/api/classes/itext/).[`getSvgTransform`](/api/classes/itext/#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 @@ -5776,16 +5200,14 @@ Returns the object angle relative to canvas counting also the group property [`IText`](/api/classes/itext/).[`getTotalAngle`](/api/classes/itext/#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 @@ -5798,23 +5220,25 @@ object with scaleX and scaleY properties [`IText`](/api/classes/itext/).[`getTotalObjectScaling`](/api/classes/itext/#gettotalobjectscaling) -#### Defined in - -[src/shapes/Object/Object.ts:593](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L593) - *** ### getUpCursorOffset() > **getUpCursorOffset**(`e`, `isRight`): `number` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:396](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L396) + #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object -• **isRight**: `boolean` +##### isRight + +`boolean` #### Returns @@ -5824,39 +5248,45 @@ Event object [`IText`](/api/classes/itext/).[`getUpCursorOffset`](/api/classes/itext/#getupcursoroffset) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:390](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L390) - *** ### getValueOfPropertyAt() -> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\] +> **getValueOfPropertyAt**\<`T`\>(`lineIndex`, `charIndex`, `property`): `Textbox`\<`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 -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>\[`T`\] +`Textbox`\<`Props`, `SProps`, `EventSpec`\>\[`T`\] the value of 'property' @@ -5864,16 +5294,14 @@ the value of 'property' [`IText`](/api/classes/itext/).[`getValueOfPropertyAt`](/api/classes/itext/#getvalueofpropertyat) -#### 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 @@ -5884,81 +5312,75 @@ Retrieves viewportTransform from Object's canvas if available [`IText`](/api/classes/itext/).[`getViewportTransform`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`getX`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`getXY`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`getY`](/api/classes/itext/#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 @@ -5976,27 +5398,33 @@ in the middle of the prototype chain [`IText`](/api/classes/itext/).[`graphemeSplit`](/api/classes/itext/#graphemesplit) -#### 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 @@ -6014,23 +5442,25 @@ in the middle of the prototype chain [`IText`](/api/classes/itext/).[`handleFiller`](/api/classes/itext/#handlefiller) -#### 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* [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -6040,15 +5470,13 @@ in the middle of the prototype chain [`IText`](/api/classes/itext/).[`hasCommonAncestors`](/api/classes/itext/#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 @@ -6059,7 +5487,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -6071,15 +5499,13 @@ Boolean [`IText`](/api/classes/itext/).[`hasFill`](/api/classes/itext/#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 @@ -6090,7 +5516,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -6102,16 +5528,14 @@ Boolean [`IText`](/api/classes/itext/).[`hasStroke`](/api/classes/itext/#hasstroke) -#### Defined in - -[src/shapes/Object/Object.ts:771](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L771) - *** ### initBehavior() > **initBehavior**(): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L26) + Initializes all the interactive behavior of IText #### Returns @@ -6122,21 +5546,21 @@ Initializes all the interactive behavior of IText [`IText`](/api/classes/itext/).[`initBehavior`](/api/classes/itext/#initbehavior) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L30) - *** ### initDelayedCursor() -> **initDelayedCursor**(`restart`?): `void` +> **initDelayedCursor**(`restart?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L174) Initializes delayed cursor #### Parameters -• **restart?**: `boolean` +##### restart? + +`boolean` #### Returns @@ -6146,16 +5570,14 @@ Initializes delayed cursor [`IText`](/api/classes/itext/).[`initDelayedCursor`](/api/classes/itext/#initdelayedcursor) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:175](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L175) - *** ### initHiddenTextarea() > **initHiddenTextarea**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L62) + Initializes hidden textarea (needed to bring up keyboard in iOS) #### Returns @@ -6166,54 +5588,14 @@ Initializes hidden textarea (needed to bring up keyboard in iOS) [`IText`](/api/classes/itext/).[`initHiddenTextarea`](/api/classes/itext/#inithiddentextarea) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L63) - -*** - -### insertCharStyleObject() - -> **insertCharStyleObject**(`lineIndex`, `charIndex`, `quantity`, `copiedStyle`?): `void` - -Inserts style object for a given line/char index - -#### Parameters - -• **lineIndex**: `number` - -Index of a line - -• **charIndex**: `number` - -Index of a char - -• **quantity**: `number` - -number Style object to insert, if given - -• **copiedStyle?**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] - -array of style objects - -#### Returns - -`void` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`insertCharStyleObject`](/api/classes/itext/#insertcharstyleobject) - -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:901](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L901) - *** ### insertChars() > **insertChars**(`text`, `style`, `start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1046](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1046) + insert characters at start position, before start position. start equal 1 it means the text get inserted between actual grapheme 0 and 1 if style array is provided, it must be as the same length of text in graphemes @@ -6222,17 +5604,25 @@ start/end ar per grapheme position in _text array. #### Parameters -• **text**: `string` +##### text + +`string` text to insert -• **style**: `undefined` \| `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] +##### style array of style objects -• **start**: `number` +`undefined` | `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +##### start + +`number` + +##### end -• **end**: `number` = `start` +`number` = `start` default to start + 1 @@ -6244,31 +5634,41 @@ default to start + 1 [`IText`](/api/classes/itext/).[`insertChars`](/api/classes/itext/#insertchars) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1051](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1051) - *** -### insertNewStyleBlock() +### insertCharStyleObject() -> **insertNewStyleBlock**(`insertedText`, `start`, `copiedStyle`?): `void` +> **insertCharStyleObject**(`lineIndex`, `charIndex`, `quantity`, `copiedStyle?`): `void` -Inserts style object(s) +Defined in: [src/shapes/IText/ITextBehavior.ts:896](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L896) + +Inserts style object for a given line/char index #### Parameters -• **insertedText**: `string`[] +##### lineIndex -Characters at the location where style is inserted +`number` -• **start**: `number` +Index of a line -cursor index for inserting style +##### charIndex -• **copiedStyle?**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] +`number` -array of style objects to insert. +Index of a char + +##### quantity + +`number` + +number Style object to insert, if given + +##### copiedStyle? + +`Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +array of style objects #### Returns @@ -6276,17 +5676,15 @@ array of style objects to insert. #### Inherited from -[`IText`](/api/classes/itext/).[`insertNewStyleBlock`](/api/classes/itext/#insertnewstyleblock) - -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:959](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L959) +[`IText`](/api/classes/itext/).[`insertCharStyleObject`](/api/classes/itext/#insertcharstyleobject) *** ### insertNewlineStyleObject() -> **insertNewlineStyleObject**(`lineIndex`, `charIndex`, `qty`, `copiedStyle`?): `void` +> **insertNewlineStyleObject**(`lineIndex`, `charIndex`, `qty`, `copiedStyle?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:827](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L827) Handle insertion of more consecutive style lines for when one or more newlines gets added to the text. Since current style needs to be shifted @@ -6295,19 +5693,25 @@ new lines from the last to the first. #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` Index of a line -• **charIndex**: `number` +##### charIndex + +`number` Index of a char -• **qty**: `number` +##### qty + +`number` number of lines to add -• **copiedStyle?** +##### copiedStyle? Array of objects styles @@ -6319,9 +5723,43 @@ Array of objects styles [`IText`](/api/classes/itext/).[`insertNewlineStyleObject`](/api/classes/itext/#insertnewlinestyleobject) -#### Defined in +*** + +### insertNewStyleBlock() + +> **insertNewStyleBlock**(`insertedText`, `start`, `copiedStyle?`): `void` + +Defined in: [src/shapes/IText/ITextBehavior.ts:954](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L954) + +Inserts style object(s) + +#### Parameters + +##### insertedText + +`string`[] + +Characters at the location where style is inserted -[src/shapes/IText/ITextBehavior.ts:832](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L832) +##### start + +`number` + +cursor index for inserting style + +##### copiedStyle? + +`Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\>[] + +array of style objects to insert. + +#### Returns + +`void` + +#### Inherited from + +[`IText`](/api/classes/itext/).[`insertNewStyleBlock`](/api/classes/itext/#insertnewstyleblock) *** @@ -6329,11 +5767,15 @@ Array of objects styles > **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 @@ -6347,23 +5789,25 @@ true if object intersects with another object [`IText`](/api/classes/itext/).[`intersectsWithObject`](/api/classes/itext/#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**: [`Point`](/api/classes/point/) +##### br + +[`Point`](/api/classes/point/) #### Returns @@ -6373,21 +5817,24 @@ Checks if object intersects with the scene rect formed by tl and br [`IText`](/api/classes/itext/).[`intersectsWithRect`](/api/classes/itext/#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. @@ -6400,21 +5847,21 @@ on parent canvas. [`IText`](/api/classes/itext/).[`isCacheDirty`](/api/classes/itext/#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 @@ -6428,23 +5875,25 @@ true if object is fully contained within area of another object [`IText`](/api/classes/itext/).[`isContainedWithinObject`](/api/classes/itext/#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 @@ -6454,21 +5903,21 @@ Checks if object is fully contained within the scene rect formed by tl and br [`IText`](/api/classes/itext/).[`isContainedWithinRect`](/api/classes/itext/#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. @@ -6483,22 +5932,22 @@ true if the specified control is visible, false otherwise [`IText`](/api/classes/itext/).[`isControlVisible`](/api/classes/itext/#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 @@ -6508,21 +5957,21 @@ Should be used instead of [Group.contains](../../../../api/classes/group/#contai [`IText`](/api/classes/itext/).[`isDescendantOf`](/api/classes/itext/#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` +Defined in: [src/shapes/Textbox.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L206) + Returns true if object has no styling or no styling in a line #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` , lineIndex is on wrapped lines. @@ -6534,22 +5983,22 @@ Returns true if object has no styling or no styling in a line [`IText`](/api/classes/itext/).[`isEmptyStyles`](/api/classes/itext/#isemptystyles) -#### Defined in - -[src/shapes/Textbox.ts:208](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L208) - *** ### isEndOfWrapping() > **isEndOfWrapping**(`lineIndex`): `boolean` +Defined in: [src/shapes/Textbox.ts:497](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L497) + 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` text to split @@ -6561,23 +6010,25 @@ text to split [`IText`](/api/classes/itext/).[`isEndOfWrapping`](/api/classes/itext/#isendofwrapping) -#### Defined in - -[src/shapes/Textbox.ts:500](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L500) - *** ### 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* [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -6591,16 +6042,16 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`IText`](/api/classes/itext/).[`isInFrontOf`](/api/classes/itext/#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` @@ -6609,16 +6060,14 @@ if objects do not share a common ancestor or they are strictly equal it is impos [`IText`](/api/classes/itext/).[`isNotVisible`](/api/classes/itext/#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 @@ -6632,23 +6081,25 @@ true if object is fully or partially contained within canvas [`IText`](/api/classes/itext/).[`isOnScreen`](/api/classes/itext/#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 @@ -6658,16 +6109,14 @@ true if object is fully or partially contained within canvas [`IText`](/api/classes/itext/).[`isOverlapping`](/api/classes/itext/#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 @@ -6680,67 +6129,57 @@ true if object is partially contained within canvas [`IText`](/api/classes/itext/).[`isPartiallyOnScreen`](/api/classes/itext/#ispartiallyonscreen) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L321) - *** -### isTripleClick() - -> **isTripleClick**(`newPointer`): `boolean` - -#### Parameters - -• **newPointer**: [`XY`](/api/interfaces/xy/) - -#### Returns - -`boolean` - -#### Inherited from +### isType() -[`IText`](/api/classes/itext/).[`isTripleClick`](/api/classes/itext/#istripleclick) +> **isType**(...`types`): `boolean` -#### Defined in +Defined in: [src/shapes/Object/Object.ts:1415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L1415) -[src/shapes/IText/ITextClickBehavior.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L99) +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. -### isType() +This compares both the static class `type` and the instance's own `type` property +against the provided list of types. -> **isType**(...`types`): `boolean` +#### Parameters -Returns true if any of the specified types is identical to the type of an instance +##### types -#### Parameters +...`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 [`IText`](/api/classes/itext/).[`isType`](/api/classes/itext/#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 @@ -6760,15 +6199,13 @@ line number [`IText`](/api/classes/itext/).[`measureLine`](/api/classes/itext/#measureline) -#### 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/Textbox.ts:516](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L516) Detect if a line has a linebreak and so we need to account for it when moving and counting style. @@ -6777,9 +6214,13 @@ If we are not wrapping the offset is always 1 #### Parameters -• **lineIndex**: `number` +##### lineIndex -• **skipWrapping?**: `boolean` +`number` + +##### skipWrapping? + +`boolean` #### Returns @@ -6791,21 +6232,21 @@ Number [`IText`](/api/classes/itext/).[`missingNewlineOffset`](/api/classes/itext/#missingnewlineoffset) -#### Defined in - -[src/shapes/Textbox.ts:519](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L519) - *** ### moveCursorDown() > **moveCursorDown**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:457](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L457) + Moves cursor down #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6817,21 +6258,21 @@ Event object [`IText`](/api/classes/itext/).[`moveCursorDown`](/api/classes/itext/#movecursordown) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:451](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L451) - *** ### moveCursorLeft() > **moveCursorLeft**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:542](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L542) + Moves cursor left #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6843,57 +6284,53 @@ Event object [`IText`](/api/classes/itext/).[`moveCursorLeft`](/api/classes/itext/#movecursorleft) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:536](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L536) - *** -### moveCursorLeftWithShift() +### moveCursorLeftWithoutShift() -> **moveCursorLeftWithShift**(`e`): `undefined` \| `boolean` +> **moveCursorLeftWithoutShift**(`e`): `boolean` -Moves cursor left while keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:594](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L594) + +Moves cursor left without keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` #### Returns -`undefined` \| `boolean` +`boolean` #### Inherited from -[`IText`](/api/classes/itext/).[`moveCursorLeftWithShift`](/api/classes/itext/#movecursorleftwithshift) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:608](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L608) +[`IText`](/api/classes/itext/).[`moveCursorLeftWithoutShift`](/api/classes/itext/#movecursorleftwithoutshift) *** -### moveCursorLeftWithoutShift() +### moveCursorLeftWithShift() -> **moveCursorLeftWithoutShift**(`e`): `boolean` +> **moveCursorLeftWithShift**(`e`): `undefined` \| `boolean` -Moves cursor left without keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:614](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L614) + +Moves cursor left while keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` #### Returns -`boolean` +`undefined` \| `boolean` #### Inherited from -[`IText`](/api/classes/itext/).[`moveCursorLeftWithoutShift`](/api/classes/itext/#movecursorleftwithoutshift) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:588](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L588) +[`IText`](/api/classes/itext/).[`moveCursorLeftWithShift`](/api/classes/itext/#movecursorleftwithshift) *** @@ -6901,11 +6338,15 @@ Moves cursor left without keeping selection > **moveCursorRight**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:630](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L630) + Moves cursor right #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6917,59 +6358,55 @@ Event object [`IText`](/api/classes/itext/).[`moveCursorRight`](/api/classes/itext/#movecursorright) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:624](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L624) - *** -### moveCursorRightWithShift() +### moveCursorRightWithoutShift() -> **moveCursorRightWithShift**(`e`): `undefined` \| `boolean` +> **moveCursorRightWithoutShift**(`e`): `boolean` -Moves cursor right while keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:680](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L680) + +Moves cursor right without keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e -#### Returns +`KeyboardEvent` -`undefined` \| `boolean` +Event object -#### Inherited from +#### Returns -[`IText`](/api/classes/itext/).[`moveCursorRightWithShift`](/api/classes/itext/#movecursorrightwithshift) +`boolean` -#### Defined in +#### Inherited from -[src/shapes/IText/ITextKeyBehavior.ts:658](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L658) +[`IText`](/api/classes/itext/).[`moveCursorRightWithoutShift`](/api/classes/itext/#movecursorrightwithoutshift) *** -### moveCursorRightWithoutShift() +### moveCursorRightWithShift() -> **moveCursorRightWithoutShift**(`e`): `boolean` +> **moveCursorRightWithShift**(`e`): `undefined` \| `boolean` -Moves cursor right without keeping selection +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:664](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L664) + +Moves cursor right while keeping selection #### Parameters -• **e**: `KeyboardEvent` +##### e -Event object +`KeyboardEvent` #### Returns -`boolean` +`undefined` \| `boolean` #### Inherited from -[`IText`](/api/classes/itext/).[`moveCursorRightWithoutShift`](/api/classes/itext/#movecursorrightwithoutshift) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:674](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L674) +[`IText`](/api/classes/itext/).[`moveCursorRightWithShift`](/api/classes/itext/#movecursorrightwithshift) *** @@ -6977,11 +6414,15 @@ Event object > **moveCursorUp**(`e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:471](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L471) + Moves cursor up #### Parameters -• **e**: `KeyboardEvent` +##### e + +`KeyboardEvent` Event object @@ -6993,21 +6434,21 @@ Event object [`IText`](/api/classes/itext/).[`moveCursorUp`](/api/classes/itext/#movecursorup) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:465](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L465) - *** -### moveCursorWithShift() +### moveCursorWithoutShift() -> **moveCursorWithShift**(`offset`): `boolean` +> **moveCursorWithoutShift**(`offset`): `boolean` -Moves cursor with shift +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:527](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L527) + +Moves cursor up without shift #### Parameters -• **offset**: `number` +##### offset + +`number` #### Returns @@ -7015,23 +6456,23 @@ Moves cursor with shift #### Inherited from -[`IText`](/api/classes/itext/).[`moveCursorWithShift`](/api/classes/itext/#movecursorwithshift) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:504](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L504) +[`IText`](/api/classes/itext/).[`moveCursorWithoutShift`](/api/classes/itext/#movecursorwithoutshift) *** -### moveCursorWithoutShift() +### moveCursorWithShift() -> **moveCursorWithoutShift**(`offset`): `boolean` +> **moveCursorWithShift**(`offset`): `boolean` -Moves cursor up without shift +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:510](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L510) + +Moves cursor with shift #### Parameters -• **offset**: `number` +##### offset + +`number` #### Returns @@ -7039,11 +6480,7 @@ Moves cursor up without shift #### Inherited from -[`IText`](/api/classes/itext/).[`moveCursorWithoutShift`](/api/classes/itext/#movecursorwithoutshift) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:521](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L521) +[`IText`](/api/classes/itext/).[`moveCursorWithShift`](/api/classes/itext/#movecursorwithshift) *** @@ -7051,7 +6488,9 @@ Moves cursor up without shift > **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 @@ -7067,18 +6506,16 @@ Boolean [`IText`](/api/classes/itext/).[`needsItsOwnCache`](/api/classes/itext/#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 @@ -7089,11 +6526,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') @@ -7105,27 +6546,31 @@ event name (eg. 'after:render') [`IText`](/api/classes/itext/).[`off`](/api/classes/itext/#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 @@ -7137,19 +6582,19 @@ event listener to unsubscribe [`IText`](/api/classes/itext/).[`off`](/api/classes/itext/#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}) @@ -7161,14 +6606,12 @@ handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': han [`IText`](/api/classes/itext/).[`off`](/api/classes/itext/#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 @@ -7179,33 +6622,39 @@ unsubscribe all event listeners [`IText`](/api/classes/itext/).[`off`](/api/classes/itext/#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 @@ -7223,29 +6672,115 @@ on [`IText`](/api/classes/itext/).[`on`](/api/classes/itext/#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 [`IText`](/api/classes/itext/).[`on`](/api/classes/itext/#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** -[src/Observable.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L27) +##### 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 + +[`IText`](/api/classes/itext/).[`once`](/api/classes/itext/#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 + +`EventRegistryObject`\<`EventSpec`\> + +key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) + +##### Returns + +`VoidFunction` + +disposer + +##### Alias + +once + +##### Inherited from + +[`IText`](/api/classes/itext/).[`once`](/api/classes/itext/#once) *** @@ -7253,6 +6788,8 @@ on > **onCompositionEnd**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:287](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L287) + Composition end #### Returns @@ -7263,16 +6800,14 @@ Composition end [`IText`](/api/classes/itext/).[`onCompositionEnd`](/api/classes/itext/#oncompositionend) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:281](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L281) - *** ### onCompositionStart() > **onCompositionStart**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:280](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L280) + Composition start #### Returns @@ -7283,19 +6818,19 @@ Composition start [`IText`](/api/classes/itext/).[`onCompositionStart`](/api/classes/itext/#oncompositionstart) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L274) - *** ### onCompositionUpdate() > **onCompositionUpdate**(`__namedParameters`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:291](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L291) + #### Parameters -• **\_\_namedParameters**: `CompositionEvent` +##### \_\_namedParameters + +`CompositionEvent` #### Returns @@ -7305,28 +6840,30 @@ Composition start [`IText`](/api/classes/itext/).[`onCompositionUpdate`](/api/classes/itext/#oncompositionupdate) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:285](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L285) - *** ### onDeselect() -> **onDeselect**(`options`?): `boolean` +> **onDeselect**(`options?`): `boolean` + +Defined in: [src/shapes/IText/ITextBehavior.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L110) 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.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +###### e? + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) event if the process is generated by an event -• **options.object?**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +###### object? + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> next object we are setting as active, and reason why this is being deselected @@ -7339,21 +6876,21 @@ this is being deselected [`IText`](/api/classes/itext/).[`onDeselect`](/api/classes/itext/#ondeselect) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L111) - *** ### onDragStart() > **onDragStart**(`e`): `boolean` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L57) + override this method to control whether instance should/shouldn't become a drag source, #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -7370,23 +6907,25 @@ To prevent drag and drop between objects both shouldStartDragging and onDragStar [`IText`](/api/classes/itext/).[`onDragStart`](/api/classes/itext/#ondragstart) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L68) - *** ### onInput() > **onInput**(`this`, `e`): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L174) + Handles onInput event #### Parameters -• **this**: [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> & `object` +##### this -• **e**: `Event` +`Textbox`\<`Props`, `SProps`, `EventSpec`\> & `object` + +##### e + +`Event` Event object @@ -7398,159 +6937,91 @@ Event object [`IText`](/api/classes/itext/).[`onInput`](/api/classes/itext/#oninput) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L167) - *** ### onKeyDown() > **onKeyDown**(`e`): `void` -Handles keydown event -only used for arrows and combination of modifier keys. - -#### Parameters - -• **e**: `KeyboardEvent` - -Event object - -#### Returns - -`void` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`onKeyDown`](/api/classes/itext/#onkeydown) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L115) - -*** - -### onKeyUp() - -> **onKeyUp**(`e`): `void` - -Handles keyup event -We handle KeyUp because ie11 and edge have difficulties copy/pasting -if a copy/cut event fired, keyup is dismissed - -#### Parameters - -• **e**: `KeyboardEvent` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L115) -Event object - -#### Returns - -`void` - -#### Inherited from - -[`IText`](/api/classes/itext/).[`onKeyUp`](/api/classes/itext/#onkeyup) - -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:147](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L147) - -*** - -### onSelect() - -> **onSelect**(`_options`?): `boolean` - -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 +Handles keydown event +only used for arrows and combination of modifier keys. #### Parameters -• **\_options?** - -options sent from the upper functions +##### e -• **\_options.e?**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +`KeyboardEvent` -event if the process is generated by an event +Event object #### Returns -`boolean` +`void` #### Inherited from -[`IText`](/api/classes/itext/).[`onSelect`](/api/classes/itext/#onselect) - -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:672](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L672) +[`IText`](/api/classes/itext/).[`onKeyDown`](/api/classes/itext/#onkeydown) *** -### once() - -#### once(eventName, handler) - -> **once**\<`K`, `E`\>(`eventName`, `handler`): `VoidFunction` - -Observes specified event **once** - -##### Type Parameters +### onKeyUp() -• **K** *extends* `string` \| `number` \| `symbol` +> **onKeyUp**(`e`): `void` -• **E** +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L151) -##### Parameters +Handles keyup event +We handle KeyUp because ie11 and edge have difficulties copy/pasting +if a copy/cut event fired, keyup is dismissed -• **eventName**: `K` +#### Parameters -Event name (eg. 'after:render') +##### e -• **handler**: `TEventCallback`\<`E`\> +`KeyboardEvent` -Function that receives a notification when an event of the specified type occurs +Event object -##### Returns +#### Returns -`VoidFunction` +`void` -disposer +#### Inherited from -##### Alias +[`IText`](/api/classes/itext/).[`onKeyUp`](/api/classes/itext/#onkeyup) -once +*** -##### Inherited from +### onSelect() -[`IText`](/api/classes/itext/).[`once`](/api/classes/itext/#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 -[`IText`](/api/classes/itext/).[`once`](/api/classes/itext/#once) +`boolean` -##### Defined in +#### Inherited from -[src/Observable.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Observable.ts#L66) +[`IText`](/api/classes/itext/).[`onSelect`](/api/classes/itext/#onselect) *** @@ -7558,6 +7029,8 @@ once > **paste**(): `void` +Defined in: [src/shapes/IText/ITextKeyBehavior.ts:323](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextKeyBehavior.ts#L323) + Pastes text #### Returns @@ -7568,24 +7041,26 @@ Pastes text [`IText`](/api/classes/itext/).[`paste`](/api/classes/itext/#paste) -#### Defined in - -[src/shapes/IText/ITextKeyBehavior.ts:317](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextKeyBehavior.ts#L317) - *** ### removeChars() > **removeChars**(`start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1024](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1024) + Removes characters from start/end start/end ar per grapheme position in _text array. #### Parameters -• **start**: `number` +##### start + +`number` + +##### end -• **end**: `number` = `...` +`number` = `...` default to start + 1 @@ -7597,23 +7072,23 @@ default to start + 1 [`IText`](/api/classes/itext/).[`removeChars`](/api/classes/itext/#removechars) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1029](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1029) - *** ### removeStyle() > **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 @@ -7623,25 +7098,27 @@ props. Deletes a line style object if it contains no other character styles. [`IText`](/api/classes/itext/).[`removeStyle`](/api/classes/itext/#removestyle) -#### Defined in - -[src/shapes/Text/StyledText.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L165) - *** ### removeStyleFromTo() > **removeStyleFromTo**(`start`, `end`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:742](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L742) + remove and reflow a style block from start to end. #### Parameters -• **start**: `number` +##### start + +`number` linear start position for removal (included in removal) -• **end**: `number` +##### end + +`number` linear end position for removal ( excluded from removal ) @@ -7653,21 +7130,23 @@ linear end position for removal ( excluded from removal ) [`IText`](/api/classes/itext/).[`removeStyleFromTo`](/api/classes/itext/#removestylefromto) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:747](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L747) - *** ### 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 @@ -7677,25 +7156,27 @@ linear end position for removal ( excluded from removal ) [`IText`](/api/classes/itext/).[`renderCache`](/api/classes/itext/#rendercache) -#### Defined in - -[src/shapes/Object/Object.ts:732](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L732) - *** ### renderCursor() > **renderCursor**(`ctx`, `boundaries`): `void` +Defined in: [src/shapes/IText/IText.ts:560](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L560) + Renders cursor #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` transformed context to draw on -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) #### Returns @@ -7705,23 +7186,23 @@ transformed context to draw on [`IText`](/api/classes/itext/).[`renderCursor`](/api/classes/itext/#rendercursor) -#### Defined in - -[src/shapes/IText/IText.ts:506](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L506) - *** ### renderCursorAt() > **renderCursorAt**(`selectionStart`): `void` +Defined in: [src/shapes/IText/IText.ts:547](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L547) + Renders cursor on context Top, outside the animation cycle, on request Used for the drag/drop effect. If contextTop is not available, do nothing. #### Parameters -• **selectionStart**: `number` +##### selectionStart + +`number` #### Returns @@ -7731,16 +7212,14 @@ If contextTop is not available, do nothing. [`IText`](/api/classes/itext/).[`renderCursorAt`](/api/classes/itext/#rendercursorat) -#### Defined in - -[src/shapes/IText/IText.ts:493](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L493) - *** ### renderCursorOrSelection() > **renderCursorOrSelection**(): `void` +Defined in: [src/shapes/IText/IText.ts:375](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L375) + Renders cursor or selection (depending on what exists) it does on the contextTop. If contextTop is not available, do nothing. @@ -7752,16 +7231,14 @@ it does on the contextTop. If contextTop is not available, do nothing. [`IText`](/api/classes/itext/).[`renderCursorOrSelection`](/api/classes/itext/#rendercursororselection) -#### Defined in - -[src/shapes/IText/IText.ts:383](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L383) - *** ### renderDragSourceEffect() > **renderDragSourceEffect**(): `void` +Defined in: [src/shapes/IText/IText.ts:636](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L636) + Renders drag start text selection #### Returns @@ -7772,16 +7249,14 @@ Renders drag start text selection [`IText`](/api/classes/itext/).[`renderDragSourceEffect`](/api/classes/itext/#renderdragsourceeffect) -#### Defined in - -[src/shapes/IText/IText.ts:582](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L582) - *** ### renderDropTargetEffect() > **renderDropTargetEffect**(`e`): `void` +Defined in: [src/shapes/IText/IText.ts:646](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L646) + 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 @@ -7789,7 +7264,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **e**: `DragEvent` +##### e + +`DragEvent` #### Returns @@ -7799,25 +7276,27 @@ object will change when dropping. example: show the cursor where the text is abo [`IText`](/api/classes/itext/).[`renderDropTargetEffect`](/api/classes/itext/#renderdroptargeteffect) -#### Defined in - -[src/shapes/IText/IText.ts:592](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L592) - *** ### renderSelection() > **renderSelection**(`ctx`, `boundaries`): `void` +Defined in: [src/shapes/IText/IText.ts:621](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L621) + Renders text selection #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` transformed context to draw on -• **boundaries**: [`CursorBoundaries`](/api/type-aliases/cursorboundaries/) +##### boundaries + +[`CursorBoundaries`](/api/type-aliases/cursorboundaries/) Object with left/top/leftOffset/topOffset @@ -7829,16 +7308,14 @@ Object with left/top/leftOffset/topOffset [`IText`](/api/classes/itext/).[`renderSelection`](/api/classes/itext/#renderselection) -#### Defined in - -[src/shapes/IText/IText.ts:567](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L567) - *** ### restartCursorIfNeeded() > **restartCursorIfNeeded**(): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L205) + Restart tue cursor animation if either is in complete state ( between animations ) or if it never started before @@ -7850,21 +7327,21 @@ or if it never started before [`IText`](/api/classes/itext/).[`restartCursorIfNeeded`](/api/classes/itext/#restartcursorifneeded) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:206](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L206) - *** ### 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) @@ -7876,21 +7353,21 @@ Angle value (in degrees) [`IText`](/api/classes/itext/).[`rotate`](/api/classes/itext/#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 @@ -7902,21 +7379,21 @@ Scale factor [`IText`](/api/classes/itext/).[`scale`](/api/classes/itext/#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 @@ -7928,21 +7405,21 @@ New height value [`IText`](/api/classes/itext/).[`scaleToHeight`](/api/classes/itext/#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 @@ -7954,28 +7431,30 @@ New width value [`IText`](/api/classes/itext/).[`scaleToWidth`](/api/classes/itext/#scaletowidth) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:381](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L381) - *** ### searchWordBoundary() > **searchWordBoundary**(`selectionStart`, `direction`): `number` +Defined in: [src/shapes/IText/ITextBehavior.ts:330](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L330) + Finds index corresponding to beginning or end of a word #### Parameters -• **selectionStart**: `number` +##### selectionStart + +`number` Index of a character -• **direction**: `-1` \| `1` +##### direction 1 or -1 +`-1` | `1` + #### Returns `number` @@ -7986,69 +7465,65 @@ Index of the beginning or end of a word [`IText`](/api/classes/itext/).[`searchWordBoundary`](/api/classes/itext/#searchwordboundary) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:323](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L323) - *** ### selectAll() -> **selectAll**(): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +> **selectAll**(): `Textbox`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/IText/ITextBehavior.ts:218](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L218) Selects entire text #### Returns -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +`Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from [`IText`](/api/classes/itext/).[`selectAll`](/api/classes/itext/#selectall) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L219) - *** ### selectLine() -> **selectLine**(`selectionStart`?): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +> **selectLine**(`selectionStart?`): `void` -TODO fix: selectionStart set as 0 will be ignored? -Selects a line based on the index +Defined in: [src/shapes/IText/ITextBehavior.ts:377](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L377) + +Selects the line that contains selectionStart #### Parameters -• **selectionStart?**: `number` +##### selectionStart? + +`number` Index of a character #### Returns -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +`void` #### Inherited from [`IText`](/api/classes/itext/).[`selectLine`](/api/classes/itext/#selectline) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:371](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L371) - *** ### selectWord() -> **selectWord**(`selectionStart`?): `void` +> **selectWord**(`selectionStart?`): `void` -TODO fix: selectionStart set as 0 will be ignored? -Selects a word based on the index +Defined in: [src/shapes/IText/ITextBehavior.ts:355](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L355) + +Selects the word that contains the char at index selectionStart #### Parameters -• **selectionStart?**: `number` +##### selectionStart? + +`number` Index of a character @@ -8060,102 +7535,102 @@ Index of a character [`IText`](/api/classes/itext/).[`selectWord`](/api/classes/itext/#selectword) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:349](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L349) - *** ### set() -> **set**(`key`, `value`?): [`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Textbox`\<`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 -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +`Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from [`IText`](/api/classes/itext/).[`set`](/api/classes/itext/#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 +[`IText`](/api/classes/itext/).[`setControlsVisibility`](/api/classes/itext/#setcontrolsvisibility) -#### Inherited from +*** -[`IText`](/api/classes/itext/).[`setControlVisible`](/api/classes/itext/#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 -[`IText`](/api/classes/itext/).[`setControlsVisibility`](/api/classes/itext/#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) +[`IText`](/api/classes/itext/).[`setControlVisible`](/api/classes/itext/#setcontrolvisible) *** @@ -8163,8 +7638,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 @@ -8174,21 +7651,21 @@ See [https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords](https:// [`IText`](/api/classes/itext/).[`setCoords`](/api/classes/itext/#setcoords) -#### Defined in - -[src/shapes/Object/InteractiveObject.ts:343](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/InteractiveObject.ts#L343) - *** ### setCursorByClick() > **setCursorByClick**(`e`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:172](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L172) + Changes cursor location in a text depending on passed pointer (x/y) object #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) Event object @@ -8200,16 +7677,14 @@ Event object [`IText`](/api/classes/itext/).[`setCursorByClick`](/api/classes/itext/#setcursorbyclick) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L225) - *** ### 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 @@ -8223,16 +7698,14 @@ Travis build error about unused variables. [`IText`](/api/classes/itext/).[`setOnGroup`](/api/classes/itext/#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 @@ -8244,29 +7717,33 @@ for path and text calculations [`IText`](/api/classes/itext/).[`setPathInfo`](/api/classes/itext/#setpathinfo) -#### 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' @@ -8278,22 +7755,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`setPositionByOrigin`](/api/classes/itext/#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/textbox/#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/textbox/#setx) #### Returns @@ -8303,29 +7780,33 @@ if parent is canvas then this method is identical to [setX](../../../../api/clas [`IText`](/api/classes/itext/).[`setRelativeX`](/api/classes/itext/#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/textbox/#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/textbox/#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' @@ -8337,22 +7818,22 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`setRelativeXY`](/api/classes/itext/#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/textbox/#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/textbox/#sety) #### Returns @@ -8362,21 +7843,21 @@ if parent is canvas then this property is identical to [setY](../../../../api/cl [`IText`](/api/classes/itext/).[`setRelativeY`](/api/classes/itext/#setrelativey) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L139) - *** ### setSelectionEnd() > **setSelectionEnd**(`index`): `void` +Defined in: [src/shapes/IText/IText.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L263) + Sets selection end (right boundary of a selection) #### Parameters -• **index**: `number` +##### index + +`number` Index to set selection end to @@ -8388,21 +7869,21 @@ Index to set selection end to [`IText`](/api/classes/itext/).[`setSelectionEnd`](/api/classes/itext/#setselectionend) -#### Defined in - -[src/shapes/IText/IText.ts:271](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L271) - *** ### setSelectionStart() > **setSelectionStart**(`index`): `void` +Defined in: [src/shapes/IText/IText.ts:254](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L254) + Sets selection start (left boundary of a selection) #### Parameters -• **index**: `number` +##### index + +`number` Index to set selection start to @@ -8414,26 +7895,30 @@ Index to set selection start to [`IText`](/api/classes/itext/).[`setSelectionStart`](/api/classes/itext/#setselectionstart) -#### Defined in - -[src/shapes/IText/IText.ts:262](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L262) - *** ### setSelectionStartEndWithShift() > **setSelectionStartEndWithShift**(`start`, `end`, `newSelection`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:1073](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L1073) + Set the selectionStart and selectionEnd according to the new position of cursor mimic the key - mouse navigation when shift is pressed. #### Parameters -• **start**: `number` +##### start + +`number` + +##### end + +`number` -• **end**: `number` +##### newSelection -• **newSelection**: `number` +`number` #### Returns @@ -8443,29 +7928,33 @@ mimic the key - mouse navigation when shift is pressed. [`IText`](/api/classes/itext/).[`setSelectionStartEndWithShift`](/api/classes/itext/#setselectionstartendwithshift) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:1078](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L1078) - *** ### setSelectionStyles() -> **setSelectionStyles**(`styles`?, `startIndex`?, `endIndex`?): `void` +> **setSelectionStyles**(`styles?`, `startIndex?`, `endIndex?`): `void` + +Defined in: [src/shapes/IText/IText.ts:327](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L327) 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 selectionEnd or startIndex + 1 @@ -8477,25 +7966,27 @@ End index to get styles at, if not specified selectionEnd or startIndex + 1 [`IText`](/api/classes/itext/).[`setSelectionStyles`](/api/classes/itext/#setselectionstyles) -#### Defined in - -[src/shapes/IText/IText.ts:335](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L335) - *** ### 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 @@ -8507,25 +7998,27 @@ selection end [`IText`](/api/classes/itext/).[`setSubscript`](/api/classes/itext/#setsubscript) -#### 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 @@ -8537,21 +8030,21 @@ selection end [`IText`](/api/classes/itext/).[`setSuperscript`](/api/classes/itext/#setsuperscript) -#### 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 + +`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 @@ -8561,15 +8054,13 @@ x position according to object's [originX](../../../../api/classes/fabricobject/ [`IText`](/api/classes/itext/).[`setX`](/api/classes/itext/#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, @@ -8577,15 +8068,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' @@ -8603,21 +8100,21 @@ object.setXY(new Point(5, 5), 'left', 'bottom'). [`IText`](/api/classes/itext/).[`setXY`](/api/classes/itext/#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 @@ -8627,25 +8124,27 @@ y position according to object's [originY](../../../../api/classes/fabricobject/ [`IText`](/api/classes/itext/).[`setY`](/api/classes/itext/#sety) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L107) - *** ### shiftLineStyles() > **shiftLineStyles**(`lineIndex`, `offset`): `void` +Defined in: [src/shapes/IText/ITextBehavior.ts:804](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L804) + Shifts line styles up or down #### Parameters -• **lineIndex**: `number` +##### lineIndex + +`number` Index of a line -• **offset**: `number` +##### offset + +`number` Can any number? @@ -8657,20 +8156,18 @@ Can any number? [`IText`](/api/classes/itext/).[`shiftLineStyles`](/api/classes/itext/#shiftlinestyles) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:809](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L809) - *** ### 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. @@ -8682,16 +8179,14 @@ Read as: cache if is needed, or if the feature is enabled but we are not already [`IText`](/api/classes/itext/).[`shouldCache`](/api/classes/itext/#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**(): `boolean` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L47) + If this method returns true a mouse move operation over a text selection will not prevent the native mouse event allowing the browser to start a drag operation. shouldStartDragging can be read 'do not prevent default for mouse move event' @@ -8705,25 +8200,27 @@ To prevent drag and drop between objects both shouldStartDragging and onDragStar [`IText`](/api/classes/itext/).[`shouldStartDragging`](/api/classes/itext/#shouldstartdragging) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L58) - *** ### 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 @@ -8735,23 +8232,25 @@ the control box size used [`IText`](/api/classes/itext/).[`strokeBorders`](/api/classes/itext/#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` +Defined in: [src/shapes/Textbox.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L191) + Returns true if object has a style property or has it on a specified line #### Parameters -• **property**: `StylePropertiesType` +##### property + +`StylePropertiesType` + +##### lineIndex -• **lineIndex**: `number` +`number` #### Returns @@ -8761,21 +8260,43 @@ Returns true if object has a style property or has it on a specified line [`IText`](/api/classes/itext/).[`styleHas`](/api/classes/itext/#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 + +`toDataURLOptions` = `{}` + +#### Returns + +`Promise`\<`null` \| `Blob`\> + +#### Inherited from -[src/shapes/Textbox.ts:193](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L193) +[`IText`](/api/classes/itext/).[`toBlob`](/api/classes/itext/#toblob) *** ### toCanvasElement() -> **toCanvasElement**(`options`?): `HTMLCanvasElement` +> **toCanvasElement**(`options?`): `HTMLCanvasElement` + +Defined in: [src/shapes/IText/IText.ts:363](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L363) block cursor/selection logic while rendering the exported canvas #### Parameters -• **options?**: `ObjectToCanvasElementOptions` +##### options? + +`ObjectToCanvasElementOptions` #### Returns @@ -8789,23 +8310,25 @@ this workaround should be replaced with a more robust solution [`IText`](/api/classes/itext/).[`toCanvasElement`](/api/classes/itext/#tocanvaselement) -#### Defined in - -[src/shapes/IText/IText.ts:371](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L371) - *** ### 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. @@ -8819,9 +8342,33 @@ svg representation of an instance [`IText`](/api/classes/itext/).[`toClipPathSVG`](/api/classes/itext/#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 + +[`IText`](/api/classes/itext/).[`toDatalessObject`](/api/classes/itext/#todatalessobject) *** @@ -8829,11 +8376,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 @@ -8847,37 +8398,31 @@ Returns a data: URL containing a representation of the object in the format spec [`IText`](/api/classes/itext/).[`toDataURL`](/api/classes/itext/#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`): `Textbox`\<`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 +`Textbox`\<`Props`, `SProps`, `EventSpec`\> #### Inherited from -[`IText`](/api/classes/itext/).[`toDatalessObject`](/api/classes/itext/#todatalessobject) - -#### Defined in - -[src/shapes/Object/Object.ts:1884](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L1884) +[`IText`](/api/classes/itext/).[`toggle`](/api/classes/itext/#toggle) *** @@ -8885,6 +8430,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 @@ -8897,27 +8444,31 @@ JSON [`IText`](/api/classes/itext/).[`toJSON`](/api/classes/itext/#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/Textbox.ts:567](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L567) Returns object representation of an instance #### Type Parameters -• **T** *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\>\>, keyof `SProps`\> +##### T -• **K** *extends* `string` \| `number` \| `symbol` = `never` +`T` *extends* `Omit`\<`Props` & [`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Textbox`\<`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 @@ -8927,54 +8478,18 @@ Any properties that you might want to additionally include in the output object representation of an instance -#### Method - -toObject - #### Overrides [`IText`](/api/classes/itext/).[`toObject`](/api/classes/itext/#toobject) -#### Defined in - -[src/shapes/Textbox.ts:571](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L571) - -*** - -### 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 - -[`IText`](/api/classes/itext/).[`toSVG`](/api/classes/itext/#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 @@ -8987,35 +8502,37 @@ String representation of text object [`IText`](/api/classes/itext/).[`toString`](/api/classes/itext/#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`): [`Textbox`](/api/classes/textbox/)\<`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? -[`Textbox`](/api/classes/textbox/)\<`Props`, `SProps`, `EventSpec`\> +[`TSVGReviver`](/api/type-aliases/tsvgreviver/) -#### Inherited from +Method for further parsing of svg representation. -[`IText`](/api/classes/itext/).[`toggle`](/api/classes/itext/#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) +[`IText`](/api/classes/itext/).[`toSVG`](/api/classes/itext/#tosvg) *** @@ -9023,11 +8540,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 @@ -9039,19 +8560,19 @@ Context [`IText`](/api/classes/itext/).[`transform`](/api/classes/itext/#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 @@ -9061,29 +8582,33 @@ Context [`IText`](/api/classes/itext/).[`transformMatrixKey`](/api/classes/itext/#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' @@ -9095,37 +8620,45 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`translateToCenterPoint`](/api/classes/itext/#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' @@ -9137,29 +8670,33 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`translateToGivenOrigin`](/api/classes/itext/#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' @@ -9171,21 +8708,21 @@ Vertical origin: 'top', 'center' or 'bottom' [`IText`](/api/classes/itext/).[`translateToOriginPoint`](/api/classes/itext/#translatetooriginpoint) -#### Defined in - -[src/shapes/Object/ObjectGeometry.ts:710](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/ObjectGeometry.ts#L710) - *** ### tripleClickHandler() > **tripleClickHandler**(`options`): `void` +Defined in: [src/shapes/IText/ITextClickBehavior.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextClickBehavior.ts#L82) + Default handler for triple click, select a line #### Parameters -• **options**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +##### options + +[`TPointerEventInfo`](/api/interfaces/tpointereventinfo/) #### Returns @@ -9195,21 +8732,21 @@ Default handler for triple click, select a line [`IText`](/api/classes/itext/).[`tripleClickHandler`](/api/classes/itext/#tripleclickhandler) -#### Defined in - -[src/shapes/IText/ITextClickBehavior.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextClickBehavior.ts#L121) - *** ### updateSelectionOnMouseMove() > **updateSelectionOnMouseMove**(`e`): `void` -called by [Canvas#textEditingManager](../../../../api/classes/canvas/#texteditingmanager) +Defined in: [src/shapes/IText/ITextBehavior.ts:432](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L432) + +called by [Canvas#textEditingManager](/api/classes/canvas/#texteditingmanager) #### Parameters -• **e**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +##### e + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) #### Returns @@ -9219,16 +8756,14 @@ called by [Canvas#textEditingManager](../../../../api/classes/canvas/#texteditin [`IText`](/api/classes/itext/).[`updateSelectionOnMouseMove`](/api/classes/itext/#updateselectiononmousemove) -#### Defined in - -[src/shapes/IText/ITextBehavior.ts:427](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L427) - *** ### ~~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 @@ -9244,22 +8779,22 @@ This API is no longer supported and may be removed in a future release. [`IText`](/api/classes/itext/).[`willDrawShadow`](/api/classes/itext/#willdrawshadow) -#### Defined in - -[src/shapes/Object/Object.ts:836](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/Object.ts#L836) - *** ### wordSplit() > **wordSplit**(`value`): `string`[] +Defined in: [src/shapes/Textbox.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L410) + Override this method to customize word splitting -Use with [Textbox#_measureWord](../../../../api/classes/textbox/#_measureword) +Use with [Textbox#\_measureWord](/api/classes/textbox/#_measureword) #### Parameters -• **value**: `string` +##### value + +`string` #### Returns @@ -9267,25 +8802,29 @@ Use with [Textbox#_measureWord](../../../../api/classes/textbox/#_measureword) array of words -#### Defined in - -[src/shapes/Textbox.ts:413](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L413) - *** ### \_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 @@ -9295,16 +8834,14 @@ array of words [`IText`](/api/classes/itext/).[`_fromObject`](/api/classes/itext/#_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/Textbox.ts:117](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L117) + 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 object @@ -9321,65 +8858,67 @@ make this function return an empty object and add controls to the ownDefaults ob [`IText`](/api/classes/itext/).[`createControls`](/api/classes/itext/#createcontrols) -#### Defined in - -[src/shapes/Textbox.ts:119](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L119) - *** ### 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`](/api/classes/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/) +`HTMLElement` | `SVGElement` -Options object +##### options? -• **cssRules?**: `CSSRules` +[`Abortable`](/api/type-aliases/abortable/) -#### Returns +Options object -`Promise`\<[`FabricText`](/api/classes/fabrictext/)\<`object`, [`SerializedTextProps`](/api/interfaces/serializedtextprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> +##### cssRules? -#### Static +`CSSRules` -#### Member Of +#### Returns -Text +`Promise`\<[`FabricText`](/api/classes/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/)\>\> #### Inherited from [`IText`](/api/classes/itext/).[`fromElement`](/api/classes/itext/#fromelement) -#### Defined in - -[src/shapes/Text/Text.ts:1847](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L1847) - *** ### fromObject() > `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`](/api/classes/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 @@ -9391,16 +8930,14 @@ plain js Object to create an instance from [`IText`](/api/classes/itext/).[`fromObject`](/api/classes/itext/#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/Textbox.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L96) + #### Returns `Record`\<`string`, `any`\> @@ -9408,7 +8945,3 @@ plain js Object to create an instance from #### Overrides [`IText`](/api/classes/itext/).[`getDefaults`](/api/classes/itext/#getdefaults) - -#### Defined in - -[src/shapes/Textbox.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L98) diff --git a/src/content/docs/api/classes/Triangle.md b/src/content/docs/api/classes/Triangle.md index fd892d6a9..0c9c757ff 100644 --- a/src/content/docs/api/classes/Triangle.md +++ b/src/content/docs/api/classes/Triangle.md @@ -5,87 +5,9 @@ prev: false title: "Triangle" --- -Root object class from which all 2d shape classes inherit from +Defined in: [src/shapes/Triangle.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.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 @@ -93,11 +15,17 @@ drop ## Type Parameters -• **Props** *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> +### Props + +`Props` *extends* [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> = `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/) ## Implements @@ -105,29 +33,29 @@ drop ## Constructors -### new Triangle() +### Constructor -> **new Triangle**\<`Props`, `SProps`, `EventSpec`\>(`options`?): [`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +> **new Triangle**\<`Props`, `SProps`, `EventSpec`\>(`options?`): `Triangle`\<`Props`, `SProps`, `EventSpec`\> + +Defined in: [src/shapes/Triangle.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.ts#L32) Constructor #### Parameters -• **options?**: `Props` +##### options? + +`Props` Options object #### Returns -[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +`Triangle`\<`Props`, `SProps`, `EventSpec`\> #### Overrides -[`FabricObject`](/api/classes/fabricobject/).[`constructor`](/api/classes/fabricobject/#constructors) - -#### Defined in - -[src/shapes/Triangle.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Triangle.ts#L32) +[`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/triangle/#setcoords). -You can calculate them without updating with [()](../../../../api/classes/triangle/#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/triangle/#setcoords). +You can calculate them without updating with [()](/api/classes/triangle/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#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,16 +1321,14 @@ 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) - *** ### 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 @@ -1646,16 +1345,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 @@ -1672,25 +1369,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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) @@ -1699,25 +1388,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. ::: @@ -1730,16 +1411,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 @@ -1756,16 +1435,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 @@ -1782,16 +1459,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 @@ -1808,16 +1483,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 @@ -1828,16 +1501,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. @@ -1849,16 +1520,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/ @@ -1876,16 +1545,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 @@ -1902,16 +1569,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 @@ -1928,16 +1593,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 @@ -1954,23 +1617,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 @@ -1980,16 +1635,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 @@ -2006,16 +1659,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 @@ -2045,16 +1696,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 @@ -2071,19 +1720,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 @@ -2099,16 +1746,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 @@ -2125,16 +1770,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 @@ -2151,23 +1794,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 @@ -2177,23 +1812,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 @@ -2203,16 +1830,14 @@ 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) - *** ### 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 @@ -2222,32 +1847,28 @@ and refreshed at the next render [`FabricObject`](/api/classes/fabricobject/).[`cacheProperties`](/api/classes/fabricobject/#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 [`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 @@ -2255,30 +1876,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/)\<[`Triangle`](/api/classes/triangle/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `triangleDefaultValues` +> `static` **ownDefaults**: `Partial`\<[`TClassProperties`](/api/type-aliases/tclassproperties/)\<`Triangle`\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\>\> = `triangleDefaultValues` + +Defined in: [src/shapes/Triangle.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.ts#L22) #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`ownDefaults`](/api/classes/fabricobject/#owndefaults) -#### Defined in - -[src/shapes/Triangle.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Triangle.ts#L22) - *** ### 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 @@ -2287,16 +1904,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` = `'Triangle'` +Defined in: [src/shapes/Triangle.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.ts#L20) + The class type. This is used for serialization and deserialization purposes and internally it can be used to identify classes. @@ -2310,22 +1925,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/Triangle.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Triangle.ts#L20) - ## 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 @@ -2333,23 +1948,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 @@ -2357,15 +1978,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 @@ -2375,51 +2004,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 @@ -2430,26 +2052,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 @@ -2465,19 +2089,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 @@ -2487,21 +2111,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`\<[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\>, `"fill"`\> +##### \_\_namedParameters + +`Pick`\<`this`, `"fill"`\> #### Returns @@ -2511,21 +2137,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`\<[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\>, `"stroke"` \| `"strokeDashOffset"` \| `"strokeLineCap"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"` \| `"strokeWidth"`\> +`Pick`\<`this`, `"stroke"` \| `"strokeWidth"` \| `"strokeLineCap"` \| `"strokeDashOffset"` \| `"strokeLineJoin"` \| `"strokeMiterLimit"`\> #### Returns @@ -2535,22 +2163,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 @@ -2562,16 +2190,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/Triangle.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.ts#L60) + Returns svg representation of an instance #### Returns @@ -2585,19 +2211,19 @@ of the instance [`FabricObject`](/api/classes/fabricobject/).[`_toSVG`](/api/classes/fabricobject/#_tosvg) -#### Defined in - -[src/shapes/Triangle.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Triangle.ts#L60) - *** ### 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 @@ -2607,33 +2233,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 @@ -2642,24 +2272,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. @@ -2671,16 +2299,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 @@ -2694,16 +2320,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 @@ -2717,22 +2341,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. @@ -2747,21 +2371,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 @@ -2773,15 +2397,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. @@ -2790,7 +2412,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. @@ -2809,41 +2433,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`\<[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\>\> +> **clone**(`propertiesToInclude?`): `Promise`\<`Triangle`\<`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`\<[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\>\> +`Promise`\<`Triangle`\<`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. @@ -2854,13 +2476,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. @@ -2872,16 +2496,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 @@ -2894,21 +2516,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 @@ -2922,16 +2544,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` @@ -2943,15 +2563,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 @@ -2959,15 +2577,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 @@ -2979,23 +2603,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 @@ -3007,27 +2633,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 @@ -3037,16 +2667,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 @@ -3056,11 +2684,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 @@ -3072,27 +2704,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 @@ -3104,29 +2738,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 @@ -3138,16 +2776,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 @@ -3155,7 +2791,9 @@ has checks to be skipped when the object is on a staticCanvas #### Parameters -• **ctx**: `CanvasRenderingContext2D` +##### ctx + +`CanvasRenderingContext2D` Context to draw on @@ -3173,25 +2811,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* [`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Triangle`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3203,29 +2843,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 @@ -3237,22 +2881,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 @@ -3264,21 +2908,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 @@ -3292,34 +2936,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` @@ -3330,16 +2970,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. @@ -3353,16 +2991,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` @@ -3371,16 +3007,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 @@ -3391,16 +3025,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/)[] @@ -3411,16 +3043,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 @@ -3431,16 +3061,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 @@ -3451,16 +3079,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 @@ -3470,11 +3096,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' @@ -3486,16 +3116,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 @@ -3506,78 +3134,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/triangle/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/triangle/#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/triangle/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/triangle/#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 @@ -3594,16 +3214,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 @@ -3620,21 +3238,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 @@ -3644,21 +3262,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 @@ -3668,23 +3286,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 -• **skipShadow?**: `boolean` +`FabricObjectSVGExportMixin` & [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> + +##### skipShadow? + +`boolean` a boolean to skip shadow filter output @@ -3696,25 +3316,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? -• **full?**: `boolean` +`boolean` + +##### additionalTransform? -• **additionalTransform?**: `string` = `''` +`string` = `''` #### Returns @@ -3724,16 +3348,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 @@ -3744,16 +3366,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 @@ -3766,16 +3386,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 @@ -3786,83 +3404,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* [`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Triangle`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` #### Returns @@ -3872,15 +3486,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 @@ -3891,7 +3503,7 @@ some use case where the fill is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3903,15 +3515,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 @@ -3922,7 +3532,7 @@ some use case where the stroke is invisible. #### Returns -`null` \| `boolean` \| `""` +`boolean` Boolean @@ -3934,21 +3544,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 @@ -3962,23 +3572,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 @@ -3988,21 +3600,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. @@ -4015,21 +3630,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 @@ -4043,23 +3658,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 @@ -4069,21 +3686,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. @@ -4098,22 +3715,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 @@ -4123,23 +3740,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* [`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +##### T + +`T` *extends* `Triangle`\<`Props`, `SProps`, `EventSpec`\> #### Parameters -• **other**: `T` +##### other + +`T` object to compare against @@ -4153,16 +3772,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` @@ -4171,16 +3790,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 @@ -4194,23 +3811,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 @@ -4220,16 +3839,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 @@ -4242,41 +3859,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 @@ -4292,18 +3919,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 @@ -4314,11 +3939,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') @@ -4330,27 +3959,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 @@ -4362,19 +3995,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}) @@ -4386,14 +4019,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 @@ -4404,33 +4035,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 @@ -4448,106 +4085,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`\> + +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) +[`FabricObject`](/api/classes/fabricobject/).[`once`](/api/classes/fabricobject/#once) *** -### onSelect() +### onDeselect() + +> **onDeselect**(`_options?`): `boolean` -> **onSelect**(`_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 @@ -4555,75 +4226,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) *** @@ -4631,11 +4292,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 @@ -4647,21 +4312,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 @@ -4671,23 +4338,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 @@ -4697,16 +4364,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 @@ -4714,7 +4379,9 @@ object will change when dropping. example: show the cursor where the text is abo #### Parameters -• **\_e**: `DragEvent` +##### \_e + +`DragEvent` #### Returns @@ -4724,21 +4391,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) @@ -4750,21 +4417,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 @@ -4776,21 +4443,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 @@ -4802,21 +4469,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 @@ -4828,102 +4495,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`?): [`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +> **set**(`key`, `value?`): `Triangle`\<`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 -[`Triangle`](/api/classes/triangle/)\<`Props`, `SProps`, `EventSpec`\> +`Triangle`\<`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. +`Record`\<`string`, `boolean`\> = `{}` -• **visible**: `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) *** @@ -4931,8 +4598,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 @@ -4942,16 +4611,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 @@ -4965,29 +4632,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' @@ -4999,22 +4670,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/triangle/#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/triangle/#setx) #### Returns @@ -5024,29 +4695,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/triangle/#setxy), but in current parent's coordinate plane (the current group if any or the canvas) +As [setXY](/api/classes/triangle/#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' @@ -5058,22 +4733,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/triangle/#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/triangle/#sety) #### Returns @@ -5083,21 +4758,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 @@ -5107,15 +4782,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, @@ -5123,15 +4796,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' @@ -5149,21 +4828,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 @@ -5173,20 +4852,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. @@ -5198,22 +4875,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 @@ -5225,25 +4902,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 @@ -5255,9 +4934,27 @@ the control box size used [`FabricObject`](/api/classes/fabricobject/).[`strokeBorders`](/api/classes/fabricobject/#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 + +[`FabricObject`](/api/classes/fabricobject/).[`toBlob`](/api/classes/fabricobject/#toblob) *** @@ -5265,11 +4962,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 @@ -5283,23 +4984,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. @@ -5313,9 +5016,33 @@ svg representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toClipPathSVG`](/api/classes/fabricobject/#toclippathsvg) -#### Defined in +*** + +### toDatalessObject() + +> **toDatalessObject**(`propertiesToInclude?`): `any` -[src/shapes/Object/FabricObjectSVGExportMixin.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/FabricObjectSVGExportMixin.ts#L143) +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 + +[`FabricObject`](/api/classes/fabricobject/).[`toDatalessObject`](/api/classes/fabricobject/#todatalessobject) *** @@ -5323,11 +5050,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 @@ -5341,37 +5072,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`): `Triangle`\<`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 +`Triangle`\<`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) *** @@ -5379,6 +5104,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 @@ -5391,21 +5118,21 @@ 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**(`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 @@ -5419,46 +5146,14 @@ Object representation of an instance [`FabricObject`](/api/classes/fabricobject/).[`toObject`](/api/classes/fabricobject/#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 - -[`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 @@ -5469,35 +5164,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`): [`Triangle`](/api/classes/triangle/)\<`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? -[`Triangle`](/api/classes/triangle/)\<`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) *** @@ -5505,11 +5202,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 @@ -5521,19 +5222,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 @@ -5543,29 +5244,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' @@ -5577,37 +5282,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' @@ -5619,29 +5332,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' @@ -5653,16 +5370,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 @@ -5678,25 +5393,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 -• **\_\_namedParameters**: [`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` +[`Abortable`](/api/type-aliases/abortable/) & `object` = `{}` #### Returns @@ -5706,16 +5425,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 @@ -5732,25 +5449,29 @@ 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) - *** ### 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 @@ -5760,16 +5481,14 @@ make this function return an empty object and add controls to the ownDefaults [`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/Triangle.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Triangle.ts#L24) + #### Returns `Record`\<`string`, `any`\> @@ -5777,7 +5496,3 @@ make this function return an empty object and add controls to the ownDefaults #### Overrides [`FabricObject`](/api/classes/fabricobject/).[`getDefaults`](/api/classes/fabricobject/#getdefaults) - -#### Defined in - -[src/shapes/Triangle.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Triangle.ts#L24) diff --git a/src/content/docs/api/classes/WebGLFilterBackend.md b/src/content/docs/api/classes/WebGLFilterBackend.md index 77c3c218c..837be31bc 100644 --- a/src/content/docs/api/classes/WebGLFilterBackend.md +++ b/src/content/docs/api/classes/WebGLFilterBackend.md @@ -5,25 +5,27 @@ prev: false title: "WebGLFilterBackend" --- +Defined in: [src/filters/WebGLFilterBackend.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L11) + ## Constructors -### new WebGLFilterBackend() +### Constructor -> **new WebGLFilterBackend**(`__namedParameters`): [`WebGLFilterBackend`](/api/classes/webglfilterbackend/) +> **new WebGLFilterBackend**(`__namedParameters`): `WebGLFilterBackend` -#### Parameters +Defined in: [src/filters/WebGLFilterBackend.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L56) -• **\_\_namedParameters** = `{}` +#### Parameters -• **\_\_namedParameters.tileSize**: `undefined` \| `number` = `config.textureSize` +##### \_\_namedParameters -#### Returns +###### tileSize? -[`WebGLFilterBackend`](/api/classes/webglfilterbackend/) +`number` = `config.textureSize` -#### Defined in +#### Returns -[src/filters/WebGLFilterBackend.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L56) +`WebGLFilterBackend` ## Properties @@ -31,11 +33,9 @@ title: "WebGLFilterBackend" > **aPosition**: `Float32Array` -Define ... +Defined in: [src/filters/WebGLFilterBackend.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L17) -#### Defined in - -[src/filters/WebGLFilterBackend.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L17) +Define ... *** @@ -43,9 +43,7 @@ Define ... > **canvas**: `HTMLCanvasElement` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L25) +Defined in: [src/filters/WebGLFilterBackend.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L25) *** @@ -53,11 +51,9 @@ Define ... > **gl**: `WebGLRenderingContext` -The Webgl context that will execute the operations for filtering - -#### Defined in +Defined in: [src/filters/WebGLFilterBackend.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L30) -[src/filters/WebGLFilterBackend.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L30) +The Webgl context that will execute the operations for filtering *** @@ -65,11 +61,9 @@ The Webgl context that will execute the operations for filtering > **gpuInfo**: `any` -Contains GPU info for debug - -#### Defined in +Defined in: [src/filters/WebGLFilterBackend.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L45) -[src/filters/WebGLFilterBackend.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L45) +Contains GPU info for debug *** @@ -77,24 +71,20 @@ Contains GPU info for debug > `optional` **imageBuffer**: `ArrayBuffer` +Defined in: [src/filters/WebGLFilterBackend.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L23) + If GLPut data is the fastest operation, or if forced, this buffer will be used to transfer the data back in the 2d logic -#### Defined in - -[src/filters/WebGLFilterBackend.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L23) - *** ### programCache > **programCache**: `any` -Keyed map for shader cache - -#### Defined in +Defined in: [src/filters/WebGLFilterBackend.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L35) -[src/filters/WebGLFilterBackend.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L35) +Keyed map for shader cache *** @@ -102,27 +92,23 @@ Keyed map for shader cache > **resources**: [`TPipelineResources`](/api/type-aliases/tpipelineresources/) = `{}` +Defined in: [src/filters/WebGLFilterBackend.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L54) + 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/WebGLFilterBackend.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L54) - *** ### textureCache > **textureCache**: [`TTextureCache`](/api/type-aliases/ttexturecache/) -Keyed map for texture cache - -#### Defined in +Defined in: [src/filters/WebGLFilterBackend.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L40) -[src/filters/WebGLFilterBackend.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L40) +Keyed map for texture cache *** @@ -130,42 +116,54 @@ Keyed map for texture cache > **tileSize**: `number` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L12) +Defined in: [src/filters/WebGLFilterBackend.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L12) ## Methods ### applyFilters() -> **applyFilters**(`filters`, `source`, `width`, `height`, `targetCanvas`, `cacheKey`?): `undefined` \| [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) +> **applyFilters**(`filters`, `source`, `width`, `height`, `targetCanvas`, `cacheKey?`): `undefined` \| [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +Defined in: [src/filters/WebGLFilterBackend.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L106) Attempts to apply the requested filters to the source provided, drawing the filtered output to the provided target 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 filters to apply. -• **source**: `TexImageSource` +##### source + +`TexImageSource` The source to be filtered. -• **width**: `number` +##### width + +`number` The width of the source input. -• **height**: `number` +##### height + +`number` The height of the source input. -• **targetCanvas**: `HTMLCanvasElement` +##### targetCanvas + +`HTMLCanvasElement` The destination for filtered output to be drawn. -• **cacheKey?**: `string` +##### cacheKey? + +`string` A key used to cache resources related to the source. If omitted, caching will be skipped. @@ -174,16 +172,14 @@ omitted, caching will be skipped. `undefined` \| [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) -#### Defined in - -[src/filters/WebGLFilterBackend.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L106) - *** ### captureGPUInfo() > **captureGPUInfo**(): `any` +Defined in: [src/filters/WebGLFilterBackend.ts:380](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L380) + Attempt to extract GPU information strings from a WebGL context. Useful information when debugging or blacklisting specific GPUs. @@ -194,32 +190,28 @@ Useful information when debugging or blacklisting specific GPUs. A GPU info object with renderer and vendor strings. -#### Defined in - -[src/filters/WebGLFilterBackend.ts:380](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L380) - *** ### clearWebGLCaches() > **clearWebGLCaches**(): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L193) + Wipe out WebGL-related caches. #### Returns `void` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L195) - *** ### copyGLTo2D() > **copyGLTo2D**(`gl`, `pipelineState`): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:320](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L320) + Copy an input WebGL canvas on to an output 2D canvas. The WebGL canvas is assumed to be upside down, with the top-left pixel of the @@ -227,9 +219,13 @@ desired output image appearing in the bottom-left corner of the WebGL canvas. #### Parameters -• **gl**: `WebGLRenderingContext` +##### gl + +`WebGLRenderingContext` + +##### pipelineState -• **pipelineState**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) The 2D target canvas to copy on to. @@ -237,26 +233,30 @@ The 2D target canvas to copy on to. `void` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:320](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L320) - *** ### copyGLTo2DPutImageData() > **copyGLTo2DPutImageData**(`this`, `gl`, `pipelineState`): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:352](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L352) + Copy an input WebGL canvas on to an output 2D canvas using 2d canvas' putImageData API. Measurably faster than using ctx.drawImage in Firefox (version 54 on OSX Sierra). #### Parameters -• **this**: `Required`\<[`WebGLFilterBackend`](/api/classes/webglfilterbackend/)\> +##### this -• **gl**: `WebGLRenderingContext` +`Required`\<`WebGLFilterBackend`\> -• **pipelineState**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) +##### gl + +`WebGLRenderingContext` + +##### pipelineState + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) The 2D target canvas to copy on to. @@ -264,15 +264,13 @@ The 2D target canvas to copy on to. `void` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L352) - *** ### createTexture() -> **createTexture**(`gl`, `width`, `height`, `textureImageSource`?, `filter`?): `null` \| `WebGLTexture` +> **createTexture**(`gl`, `width`, `height`, `textureImageSource?`, `filter?`): `WebGLTexture` + +Defined in: [src/filters/WebGLFilterBackend.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L211) Create a WebGL texture object. @@ -280,34 +278,40 @@ Accepts specific dimensions to initialize the texture to or a source image. #### Parameters -• **gl**: `WebGLRenderingContext` +##### gl + +`WebGLRenderingContext` The GL context to use for creating the texture. -• **width**: `number` +##### width + +`number` The width to initialize the texture at. -• **height**: `number` +##### height + +`number` The height to initialize the texture. -• **textureImageSource?**: `TexImageSource` +##### textureImageSource? + +`TexImageSource` A source for the texture data. -• **filter?**: `9728` \| `9729` +##### filter? gl.NEAREST default or gl.LINEAR filters for the texture. This filter is very useful for LUTs filters. If you need interpolation use gl.LINEAR -#### Returns +`9728` | `9729` -`null` \| `WebGLTexture` - -#### Defined in +#### Returns -[src/filters/WebGLFilterBackend.ts:213](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L213) +`WebGLTexture` *** @@ -315,22 +319,24 @@ This filter is very useful for LUTs filters. If you need interpolation use gl.LI > **createWebGLCanvas**(`width`, `height`): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L74) + Create a canvas element and associated WebGL context and attaches them as class properties to the GLFilterBackend class. #### Parameters -• **width**: `number` +##### width -• **height**: `number` +`number` -#### Returns +##### height -`void` +`number` -#### Defined in +#### Returns -[src/filters/WebGLFilterBackend.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L74) +`void` *** @@ -338,28 +344,30 @@ class properties to the GLFilterBackend class. > **dispose**(): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L178) + Detach event listeners, remove references, and clean up caches. #### Returns `void` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:180](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L180) - *** ### evictCachesForKey() > **evictCachesForKey**(`cacheKey`): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:304](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L304) + Clear out cached resources related to a source image that has been filtered previously. #### Parameters -• **cacheKey**: `string` +##### cacheKey + +`string` The cache key provided when the source image was filtered. @@ -367,15 +375,13 @@ The cache key provided when the source image was filtered. `void` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:304](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L304) - *** ### getCachedTexture() -> **getCachedTexture**(`uniqueId`, `textureImageSource`, `filter`?): `null` \| `WebGLTexture` +> **getCachedTexture**(`uniqueId`, `textureImageSource`, `filter?`): `null` \| `WebGLTexture` + +Defined in: [src/filters/WebGLFilterBackend.ts:273](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L273) Can be optionally used to get a texture from the cache array @@ -383,43 +389,47 @@ If an existing texture is not found, a new texture is created and cached. #### Parameters -• **uniqueId**: `string` +##### uniqueId + +`string` A cache key to use to find an existing texture. -• **textureImageSource**: `TexImageSource` +##### textureImageSource + +`TexImageSource` A source to use to create the texture cache entry if one does not already exist. -• **filter?**: `9728` \| `9729` +##### filter? + +`9728` | `9729` #### Returns `null` \| `WebGLTexture` -#### Defined in - -[src/filters/WebGLFilterBackend.ts:273](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L273) - *** ### setupGLContext() > **setupGLContext**(`width`, `height`): `void` +Defined in: [src/filters/WebGLFilterBackend.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/WebGLFilterBackend.ts#L65) + Setup a WebGL context suitable for filtering, and bind any needed event handlers. #### Parameters -• **width**: `number` +##### width -• **height**: `number` +`number` -#### Returns +##### height -`void` +`number` -#### Defined in +#### Returns -[src/filters/WebGLFilterBackend.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/WebGLFilterBackend.ts#L65) +`void` diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createObjectDefaultControls.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createObjectDefaultControls.md similarity index 78% rename from src/content/docs/api/namespaces/controlsUtils/functions/createObjectDefaultControls.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/createObjectDefaultControls.md index 2da8248c7..68be4daf2 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createObjectDefaultControls.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createObjectDefaultControls.md @@ -7,6 +7,8 @@ title: "createObjectDefaultControls" > **createObjectDefaultControls**(): `object` +Defined in: [src/controls/commonControls.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/commonControls.ts#L14) + ## Returns `object` @@ -46,7 +48,3 @@ title: "createObjectDefaultControls" ### tr > **tr**: [`Control`](/api/classes/control/) - -## Defined in - -[src/controls/commonControls.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/commonControls.ts#L14) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPathControls.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPathControls.md new file mode 100644 index 000000000..c5a353fd2 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPathControls.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "createPathControls" +--- + +> **createPathControls**(`path`, `options`): `Record`\<`string`, [`Control`](/api/classes/control/)\> + +Defined in: [src/controls/pathControl.ts:240](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/pathControl.ts#L240) + +## Parameters + +### path + +[`Path`](/api/classes/path/) + +### options + +`Partial`\<[`Control`](/api/classes/control/)\> & `object` = `{}` + +## Returns + +`Record`\<`string`, [`Control`](/api/classes/control/)\> diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyActionHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyActionHandler.md similarity index 66% rename from src/content/docs/api/namespaces/controlsUtils/functions/createPolyActionHandler.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyActionHandler.md index c098c99db..72345bb77 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyActionHandler.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyActionHandler.md @@ -7,14 +7,14 @@ title: "createPolyActionHandler" > **createPolyActionHandler**(`pointIndex`): [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<[`Transform`](/api/type-aliases/transform/)\> +Defined in: [src/controls/polyControl.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L99) + ## Parameters -• **pointIndex**: `number` +### pointIndex + +`number` ## Returns [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<[`Transform`](/api/type-aliases/transform/)\> - -## Defined in - -[src/controls/polyControl.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L99) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyControls.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyControls.md new file mode 100644 index 000000000..d4b98e05f --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyControls.md @@ -0,0 +1,46 @@ +--- +editUrl: false +next: false +prev: false +title: "createPolyControls" +--- + +## Call Signature + +> **createPolyControls**(`poly`, `options?`): `Record`\<`string`, [`Control`](/api/classes/control/)\> + +Defined in: [src/controls/polyControl.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L105) + +### Parameters + +#### poly + +[`Polyline`](/api/classes/polyline/) + +#### options? + +`Partial`\<[`Control`](/api/classes/control/)\> + +### Returns + +`Record`\<`string`, [`Control`](/api/classes/control/)\> + +## Call Signature + +> **createPolyControls**(`numOfControls`, `options?`): `Record`\<`string`, [`Control`](/api/classes/control/)\> + +Defined in: [src/controls/polyControl.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L109) + +### Parameters + +#### numOfControls + +`number` + +#### options? + +`Partial`\<[`Control`](/api/classes/control/)\> + +### Returns + +`Record`\<`string`, [`Control`](/api/classes/control/)\> diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyPositionHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyPositionHandler.md new file mode 100644 index 000000000..f3b5a4517 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createPolyPositionHandler.md @@ -0,0 +1,41 @@ +--- +editUrl: false +next: false +prev: false +title: "createPolyPositionHandler" +--- + +> **createPolyPositionHandler**(`pointIndex`): (`dim`, `finalMatrix`, `polyObject`) => [`Point`](/api/classes/point/) + +Defined in: [src/controls/polyControl.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L24) + +This function locates the controls. +It'll be used both for drawing and for interaction. + +## Parameters + +### pointIndex + +`number` + +## Returns + +> (`dim`, `finalMatrix`, `polyObject`): [`Point`](/api/classes/point/) + +### Parameters + +#### dim + +[`Point`](/api/classes/point/) + +#### finalMatrix + +[`TMat2D`](/api/type-aliases/tmat2d/) + +#### polyObject + +[`Polyline`](/api/classes/polyline/) + +### Returns + +[`Point`](/api/classes/point/) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createResizeControls.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createResizeControls.md similarity index 59% rename from src/content/docs/api/namespaces/controlsUtils/functions/createResizeControls.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/createResizeControls.md index dc9cd33ac..11e724d86 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createResizeControls.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createResizeControls.md @@ -7,6 +7,8 @@ title: "createResizeControls" > **createResizeControls**(): `object` +Defined in: [src/controls/commonControls.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/commonControls.ts#L86) + ## Returns `object` @@ -18,7 +20,3 @@ title: "createResizeControls" ### mr > **mr**: [`Control`](/api/classes/control/) - -## Defined in - -[src/controls/commonControls.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/commonControls.ts#L86) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createTextboxDefaultControls.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createTextboxDefaultControls.md similarity index 78% rename from src/content/docs/api/namespaces/controlsUtils/functions/createTextboxDefaultControls.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/createTextboxDefaultControls.md index de0f82943..a6676af23 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createTextboxDefaultControls.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/createTextboxDefaultControls.md @@ -7,6 +7,8 @@ title: "createTextboxDefaultControls" > **createTextboxDefaultControls**(): `object` +Defined in: [src/controls/commonControls.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/commonControls.ts#L103) + ## Returns `object` @@ -46,7 +48,3 @@ title: "createTextboxDefaultControls" ### tr > **tr**: [`Control`](/api/classes/control/) - -## Defined in - -[src/controls/commonControls.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/commonControls.ts#L103) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/factoryPolyActionHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/factoryPolyActionHandler.md new file mode 100644 index 000000000..a3e15afd3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/factoryPolyActionHandler.md @@ -0,0 +1,48 @@ +--- +editUrl: false +next: false +prev: false +title: "factoryPolyActionHandler" +--- + +> **factoryPolyActionHandler**(`pointIndex`, `fn`): (`eventData`, `transform`, `x`, `y`) => `boolean` + +Defined in: [src/controls/polyControl.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L68) + +Keep the polygon in the same position when we change its `width`/`height`/`top`/`left`. + +## Parameters + +### pointIndex + +`number` + +### fn + +[`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`TTransformAnchor`\> + +## Returns + +> (`eventData`, `transform`, `x`, `y`): `boolean` + +### Parameters + +#### eventData + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) + +#### transform + +[`Transform`](/api/type-aliases/transform/) + +#### x + +`number` + +#### y + +`number` + +### Returns + +`boolean` diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/getLocalPoint.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/getLocalPoint.md new file mode 100644 index 000000000..dbf813880 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/getLocalPoint.md @@ -0,0 +1,40 @@ +--- +editUrl: false +next: false +prev: false +title: "getLocalPoint" +--- + +> **getLocalPoint**(`transform`, `originX`, `originY`, `x`, `y`): [`Point`](/api/classes/point/) + +Defined in: [src/controls/util.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/util.ts#L136) + +Transforms a point to the offset from the given origin + +## Parameters + +### transform + +[`Transform`](/api/type-aliases/transform/) + +### originX + +[`TOriginX`](/api/type-aliases/toriginx/) + +### originY + +[`TOriginY`](/api/type-aliases/toriginy/) + +### x + +`number` + +### y + +`number` + +## Returns + +[`Point`](/api/classes/point/) + +the normalized point diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/polyActionHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/polyActionHandler.md similarity index 62% rename from src/content/docs/api/namespaces/controlsUtils/functions/polyActionHandler.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/polyActionHandler.md index fc9eb8e76..6ff296f0c 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/polyActionHandler.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/polyActionHandler.md @@ -7,6 +7,8 @@ title: "polyActionHandler" > **polyActionHandler**(`eventData`, `transform`, `x`, `y`): `boolean` +Defined in: [src/controls/polyControl.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/polyControl.ts#L45) + This function defines what the control does. It'll be called on every mouse move after a control has been clicked and is being dragged. The function receives as argument the mouse event, the current transform object @@ -15,18 +17,22 @@ current object being transformed. ## Parameters -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### eventData -• **transform**: `TTransformAnchor` +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -• **x**: `number` +### transform -• **y**: `number` +`TTransformAnchor` -## Returns +### x -`boolean` +`number` + +### y -## Defined in +`number` -[src/controls/polyControl.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L45) +## Returns + +`boolean` diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderCircleControl.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderCircleControl.md new file mode 100644 index 000000000..191a0c4f0 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderCircleControl.md @@ -0,0 +1,55 @@ +--- +editUrl: false +next: false +prev: false +title: "renderCircleControl" +--- + +> **renderCircleControl**(`this`, `ctx`, `left`, `top`, `styleOverride`, `fabricObject`): `void` + +Defined in: [src/controls/controlRendering.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/controlRendering.ts#L39) + +Render a round control, as per fabric features. +This function is written to respect object properties like transparentCorners, cornerSize +cornerColor, cornerStrokeColor +plus the addition of offsetY and offsetX. + +## Parameters + +### this + +[`Control`](/api/classes/control/) + +### ctx + +`CanvasRenderingContext2D` + +context to render on + +### left + +`number` + +x coordinate where the control center should be + +### top + +`number` + +y coordinate where the control center should be + +### styleOverride + +`ControlRenderingStyleOverride` + +override for FabricObject controls style + +### fabricObject + +[`InteractiveFabricObject`](/api/classes/interactivefabricobject/) + +the fabric object for which we are rendering controls + +## Returns + +`void` diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderSquareControl.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderSquareControl.md new file mode 100644 index 000000000..c83b72382 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/renderSquareControl.md @@ -0,0 +1,55 @@ +--- +editUrl: false +next: false +prev: false +title: "renderSquareControl" +--- + +> **renderSquareControl**(`this`, `ctx`, `left`, `top`, `styleOverride`, `fabricObject`): `void` + +Defined in: [src/controls/controlRendering.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/controlRendering.ts#L98) + +Render a square control, as per fabric features. +This function is written to respect object properties like transparentCorners, cornerSize +cornerColor, cornerStrokeColor +plus the addition of offsetY and offsetX. + +## Parameters + +### this + +[`Control`](/api/classes/control/) + +### ctx + +`CanvasRenderingContext2D` + +context to render on + +### left + +`number` + +x coordinate where the control center should be + +### top + +`number` + +y coordinate where the control center should be + +### styleOverride + +`ControlRenderingStyleOverride` + +override for FabricObject controls style + +### fabricObject + +[`InteractiveFabricObject`](/api/classes/interactivefabricobject/) + +the fabric object for which we are rendering controls + +## Returns + +`void` diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFireEvent.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFireEvent.md new file mode 100644 index 000000000..cdf623959 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFireEvent.md @@ -0,0 +1,48 @@ +--- +editUrl: false +next: false +prev: false +title: "wrapWithFireEvent" +--- + +> **wrapWithFireEvent**\<`T`, `P`\>(`eventName`, `actionHandler`, `extraEventInfo?`): [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> + +Defined in: [src/controls/wrapWithFireEvent.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/wrapWithFireEvent.ts#L16) + +Wrap an action handler with firing an event if the action is performed + +## Type Parameters + +### T + +`T` *extends* [`Transform`](/api/type-aliases/transform/) + +### P + +`P` *extends* `object` = `Record`\<`string`, `never`\> + +## Parameters + +### eventName + +[`TModificationEvents`](/api/type-aliases/tmodificationevents/) + +the event we want to fire + +### actionHandler + +[`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> + +the function to wrap + +### extraEventInfo? + +`P` + +extra information to pas to the event handler + +## Returns + +[`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> + +a function with an action handler signature diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md similarity index 62% rename from src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md rename to src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md index dcd8b788c..8a4bbf57b 100644 --- a/src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/functions/wrapWithFixedAnchor.md @@ -7,16 +7,22 @@ title: "wrapWithFixedAnchor" > **wrapWithFixedAnchor**\<`T`\>(`actionHandler`): [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> +Defined in: [src/controls/wrapWithFixedAnchor.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/wrapWithFixedAnchor.ts#L9) + Wrap an action handler with saving/restoring object position on the transform. this is the code that permits to objects to keep their position while transforming. ## Type Parameters -• **T** *extends* [`Transform`](/api/type-aliases/transform/) +### T + +`T` *extends* [`Transform`](/api/type-aliases/transform/) ## Parameters -• **actionHandler**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> +### actionHandler + +[`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> the function to wrap @@ -25,7 +31,3 @@ the function to wrap [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> a function with an action handler signature - -## Defined in - -[src/controls/wrapWithFixedAnchor.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/wrapWithFixedAnchor.ts#L9) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/index.md b/src/content/docs/api/fabric/namespaces/controlsUtils/index.md new file mode 100644 index 000000000..3f7d3ed7e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/index.md @@ -0,0 +1,44 @@ +--- +editUrl: false +next: false +prev: false +title: "controlsUtils" +--- + +## Type Aliases + +- [PathPointControlStyle](/api/fabric/namespaces/controlsutils/type-aliases/pathpointcontrolstyle/) + +## Variables + +- [changeWidth](/api/fabric/namespaces/controlsutils/variables/changewidth/) +- [rotationStyleHandler](/api/fabric/namespaces/controlsutils/variables/rotationstylehandler/) +- [rotationWithSnapping](/api/fabric/namespaces/controlsutils/variables/rotationwithsnapping/) +- [scaleCursorStyleHandler](/api/fabric/namespaces/controlsutils/variables/scalecursorstylehandler/) +- [scaleOrSkewActionName](/api/fabric/namespaces/controlsutils/variables/scaleorskewactionname/) +- [scaleSkewCursorStyleHandler](/api/fabric/namespaces/controlsutils/variables/scaleskewcursorstylehandler/) +- [scalingEqually](/api/fabric/namespaces/controlsutils/variables/scalingequally/) +- [scalingX](/api/fabric/namespaces/controlsutils/variables/scalingx/) +- [scalingXOrSkewingY](/api/fabric/namespaces/controlsutils/variables/scalingxorskewingy/) +- [scalingY](/api/fabric/namespaces/controlsutils/variables/scalingy/) +- [scalingYOrSkewingX](/api/fabric/namespaces/controlsutils/variables/scalingyorskewingx/) +- [skewCursorStyleHandler](/api/fabric/namespaces/controlsutils/variables/skewcursorstylehandler/) +- [skewHandlerX](/api/fabric/namespaces/controlsutils/variables/skewhandlerx/) +- [skewHandlerY](/api/fabric/namespaces/controlsutils/variables/skewhandlery/) + +## Functions + +- [createObjectDefaultControls](/api/fabric/namespaces/controlsutils/functions/createobjectdefaultcontrols/) +- [createPathControls](/api/fabric/namespaces/controlsutils/functions/createpathcontrols/) +- [createPolyActionHandler](/api/fabric/namespaces/controlsutils/functions/createpolyactionhandler/) +- [createPolyControls](/api/fabric/namespaces/controlsutils/functions/createpolycontrols/) +- [createPolyPositionHandler](/api/fabric/namespaces/controlsutils/functions/createpolypositionhandler/) +- [createResizeControls](/api/fabric/namespaces/controlsutils/functions/createresizecontrols/) +- [createTextboxDefaultControls](/api/fabric/namespaces/controlsutils/functions/createtextboxdefaultcontrols/) +- [factoryPolyActionHandler](/api/fabric/namespaces/controlsutils/functions/factorypolyactionhandler/) +- [getLocalPoint](/api/fabric/namespaces/controlsutils/functions/getlocalpoint/) +- [polyActionHandler](/api/fabric/namespaces/controlsutils/functions/polyactionhandler/) +- [renderCircleControl](/api/fabric/namespaces/controlsutils/functions/rendercirclecontrol/) +- [renderSquareControl](/api/fabric/namespaces/controlsutils/functions/rendersquarecontrol/) +- [wrapWithFireEvent](/api/fabric/namespaces/controlsutils/functions/wrapwithfireevent/) +- [wrapWithFixedAnchor](/api/fabric/namespaces/controlsutils/functions/wrapwithfixedanchor/) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md b/src/content/docs/api/fabric/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md new file mode 100644 index 000000000..dfa3d07b3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "PathPointControlStyle" +--- + +> **PathPointControlStyle** = `object` + +Defined in: [src/controls/pathControl.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/pathControl.ts#L21) + +## Properties + +### connectionDashArray? + +> `optional` **connectionDashArray**: `number`[] + +Defined in: [src/controls/pathControl.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/pathControl.ts#L24) + +*** + +### controlFill? + +> `optional` **controlFill**: `string` + +Defined in: [src/controls/pathControl.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/pathControl.ts#L22) + +*** + +### controlStroke? + +> `optional` **controlStroke**: `string` + +Defined in: [src/controls/pathControl.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/pathControl.ts#L23) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/changeWidth.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/changeWidth.md new file mode 100644 index 000000000..4d3bbe212 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/changeWidth.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "changeWidth" +--- + +> `const` **changeWidth**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<[`Transform`](/api/type-aliases/transform/)\> + +Defined in: [src/controls/changeWidth.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/changeWidth.ts#L52) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationStyleHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationStyleHandler.md new file mode 100644 index 000000000..c76345fdf --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationStyleHandler.md @@ -0,0 +1,29 @@ +--- +editUrl: false +next: false +prev: false +title: "rotationStyleHandler" +--- + +> `const` **rotationStyleHandler**: [`ControlCursorCallback`](/api/type-aliases/controlcursorcallback/) + +Defined in: [src/controls/rotate.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/rotate.ts#L19) + +Find the correct style for the control that is used for rotation. +this function is very simple and it just take care of not-allowed or standard cursor + +## Param + +the javascript event that is causing the scale + +## Param + +the control that is interested in the action + +## Param + +the fabric object that is interested in the action + +## Returns + +a valid css string for the cursor diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationWithSnapping.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationWithSnapping.md new file mode 100644 index 000000000..402f95942 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/rotationWithSnapping.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "rotationWithSnapping" +--- + +> `const` **rotationWithSnapping**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<[`Transform`](/api/type-aliases/transform/)\> + +Defined in: [src/controls/rotate.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/rotate.ts#L85) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleCursorStyleHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleCursorStyleHandler.md new file mode 100644 index 000000000..16877f81d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleCursorStyleHandler.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "scaleCursorStyleHandler" +--- + +> `const` **scaleCursorStyleHandler**: [`ControlCursorCallback`](/api/type-aliases/controlcursorcallback/) + +Defined in: [src/controls/scale.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scale.ts#L95) + +return the correct cursor style for the scale action + +## Param + +the javascript event that is causing the scale + +## Param + +the control that is interested in the action + +## Param + +the fabric object that is interested in the action + +## Returns + +a valid css string for the cursor diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleOrSkewActionName.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleOrSkewActionName.md new file mode 100644 index 000000000..0deb6d868 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleOrSkewActionName.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "scaleOrSkewActionName" +--- + +> `const` **scaleOrSkewActionName**: [`ControlCallback`](/api/type-aliases/controlcallback/)\<[`TAxisKey`](/api/type-aliases/taxiskey/)\<`"skew"` \| `"scale"`\> \| `""`\> + +Defined in: [src/controls/scaleSkew.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scaleSkew.ts#L24) + +Inspect event, control and fabricObject to return the correct action name + +## Param + +the javascript event that is causing the scale + +## Param + +the control that is interested in the action + +## Param + +the fabric object that is interested in the action + +## Returns + +an action name diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleSkewCursorStyleHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleSkewCursorStyleHandler.md new file mode 100644 index 000000000..763c65a2c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scaleSkewCursorStyleHandler.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "scaleSkewCursorStyleHandler" +--- + +> `const` **scaleSkewCursorStyleHandler**: [`ControlCursorCallback`](/api/type-aliases/controlcursorcallback/) + +Defined in: [src/controls/scaleSkew.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scaleSkew.ts#L46) + +Combine skew and scale style handlers to cover fabric standard use case + +## Param + +the javascript event that is causing the scale + +## Param + +the control that is interested in the action + +## Param + +the fabric object that is interested in the action + +## Returns + +a valid css string for the cursor diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingEqually.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingEqually.md new file mode 100644 index 000000000..b357c4985 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingEqually.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "scalingEqually" +--- + +> `const` **scalingEqually**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`ScaleTransform`\> + +Defined in: [src/controls/scale.ts:275](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scale.ts#L275) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingX.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingX.md new file mode 100644 index 000000000..d6ae65c63 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingX.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "scalingX" +--- + +> `const` **scalingX**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`ScaleTransform`\> + +Defined in: [src/controls/scale.ts:280](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scale.ts#L280) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingXOrSkewingY.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingXOrSkewingY.md new file mode 100644 index 000000000..64b6ebee6 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingXOrSkewingY.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "scalingXOrSkewingY" +--- + +> `const` **scalingXOrSkewingY**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/) + +Defined in: [src/controls/scaleSkew.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scaleSkew.ts#L65) + +Composed action handler to either scale X or skew Y +Needs to be wrapped with `wrapWithFixedAnchor` to be effective + +## Param + +javascript event that is doing the transform + +## Param + +javascript object containing a series of information around the current transform + +## Param + +current mouse x position, canvas normalized + +## Param + +current mouse y position, canvas normalized + +## Returns + +true if some change happened diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingY.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingY.md new file mode 100644 index 000000000..53401ed5a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingY.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "scalingY" +--- + +> `const` **scalingY**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`ScaleTransform`\> + +Defined in: [src/controls/scale.ts:285](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scale.ts#L285) diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingYOrSkewingX.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingYOrSkewingX.md new file mode 100644 index 000000000..646d3fd95 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/scalingYOrSkewingX.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "scalingYOrSkewingX" +--- + +> `const` **scalingYOrSkewingX**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/) + +Defined in: [src/controls/scaleSkew.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/scaleSkew.ts#L85) + +Composed action handler to either scale Y or skew X +Needs to be wrapped with `wrapWithFixedAnchor` to be effective + +## Param + +javascript event that is doing the transform + +## Param + +javascript object containing a series of information around the current transform + +## Param + +current mouse x position, canvas normalized + +## Param + +current mouse y position, canvas normalized + +## Returns + +true if some change happened diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewCursorStyleHandler.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewCursorStyleHandler.md new file mode 100644 index 000000000..8490135f0 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewCursorStyleHandler.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "skewCursorStyleHandler" +--- + +> `const` **skewCursorStyleHandler**: [`ControlCursorCallback`](/api/type-aliases/controlcursorcallback/) + +Defined in: [src/controls/skew.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/skew.ts#L71) + +return the correct cursor style for the skew action + +## Param + +the javascript event that is causing the scale + +## Param + +the control that is interested in the action + +## Param + +the fabric object that is interested in the action + +## Returns + +a valid css string for the cursor diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerX.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerX.md new file mode 100644 index 000000000..7f0dd982f --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerX.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "skewHandlerX" +--- + +> `const` **skewHandlerX**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/) + +Defined in: [src/controls/skew.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/skew.ts#L226) + +Wrapped Action handler for skewing on the X axis, takes care of the +skew direction and determines the correct transform origin for the anchor point + +## Param + +javascript event that is doing the transform + +## Param + +javascript object containing a series of information around the current transform + +## Param + +current mouse x position, canvas normalized + +## Param + +current mouse y position, canvas normalized + +## Returns + +true if some change happened diff --git a/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerY.md b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerY.md new file mode 100644 index 000000000..409cf95c6 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/controlsUtils/variables/skewHandlerY.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "skewHandlerY" +--- + +> `const` **skewHandlerY**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/) + +Defined in: [src/controls/skew.ts:244](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/controls/skew.ts#L244) + +Wrapped Action handler for skewing on the Y axis, takes care of the +skew direction and determines the correct transform origin for the anchor point + +## Param + +javascript event that is doing the transform + +## Param + +javascript object containing a series of information around the current transform + +## Param + +current mouse x position, canvas normalized + +## Param + +current mouse y position, canvas normalized + +## Returns + +true if some change happened diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/BaseFilter.md b/src/content/docs/api/fabric/namespaces/filters/classes/BaseFilter.md new file mode 100644 index 000000000..4f80ae0a3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/BaseFilter.md @@ -0,0 +1,575 @@ +--- +editUrl: false +next: false +prev: false +title: "BaseFilter" +--- + +Defined in: [src/filters/BaseFilter.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L21) + +## Extended by + +- [`BlendColor`](/api/fabric/namespaces/filters/classes/blendcolor/) +- [`BlendImage`](/api/fabric/namespaces/filters/classes/blendimage/) +- [`Blur`](/api/fabric/namespaces/filters/classes/blur/) +- [`Brightness`](/api/fabric/namespaces/filters/classes/brightness/) +- [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) +- [`Composed`](/api/fabric/namespaces/filters/classes/composed/) +- [`Contrast`](/api/fabric/namespaces/filters/classes/contrast/) +- [`Convolute`](/api/fabric/namespaces/filters/classes/convolute/) +- [`Gamma`](/api/fabric/namespaces/filters/classes/gamma/) +- [`Grayscale`](/api/fabric/namespaces/filters/classes/grayscale/) +- [`Invert`](/api/fabric/namespaces/filters/classes/invert/) +- [`Noise`](/api/fabric/namespaces/filters/classes/noise/) +- [`Pixelate`](/api/fabric/namespaces/filters/classes/pixelate/) +- [`RemoveColor`](/api/fabric/namespaces/filters/classes/removecolor/) +- [`Resize`](/api/fabric/namespaces/filters/classes/resize/) +- [`Saturation`](/api/fabric/namespaces/filters/classes/saturation/) +- [`Vibrance`](/api/fabric/namespaces/filters/classes/vibrance/) + +## Type Parameters + +### Name + +`Name` *extends* `string` + +### OwnProps + +`OwnProps` *extends* `Record`\<`string`, `any`\> = `object` + +### SerializedProps + +`SerializedProps` *extends* `Record`\<`string`, `any`\> = `OwnProps` + +## Constructors + +### Constructor + +> **new BaseFilter**\<`Name`, `OwnProps`, `SerializedProps`\>(`options?`): `BaseFilter`\<`Name`, `OwnProps`, `SerializedProps`\> + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`OwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`BaseFilter`\<`Name`, `OwnProps`, `SerializedProps`\> + +## Properties + +### defaults + +> `static` **defaults**: `Record`\<`string`, `unknown`\> + +Defined in: [src/filters/BaseFilter.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L49) + +*** + +### type + +> `static` **type**: `string` = `'BaseFilter'` + +Defined in: [src/filters/BaseFilter.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L40) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] = `[]` + +Defined in: [src/filters/BaseFilter.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L47) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +*** + +### applyTo2d() + +> **applyTo2d**(`_options`): `void` + +Defined in: [src/filters/BaseFilter.ts:273](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L273) + +#### Parameters + +##### \_options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +*** + +### sendUniformData() + +> **sendUniformData**(`_gl`, `_uniformLocations`): `void` + +Defined in: [src/filters/BaseFilter.ts:357](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L357) + +Send uniform data from this filter to its shader program on the GPU. + +Intended to be overridden by subclasses. + +#### Parameters + +##### \_gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### \_uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of shader uniform names to their locations. + +#### Returns + +`void` + +*** + +### toJSON() + +> **toJSON**(): `object` & `SerializedProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `SerializedProps` + +JSON + +*** + +### toObject() + +> **toObject**(): `object` & `SerializedProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `SerializedProps` + +Object representation of an instance + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<`BaseFilter`\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<`BaseFilter`\<`string`, `object`, `object`\>\> diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/BlendColor.md b/src/content/docs/api/fabric/namespaces/filters/classes/BlendColor.md new file mode 100644 index 000000000..3e8a949a2 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/BlendColor.md @@ -0,0 +1,696 @@ +--- +editUrl: false +next: false +prev: false +title: "BlendColor" +--- + +Defined in: [src/filters/BlendColor.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L47) + +Color Blend filter class + +## Example + +```ts +const filter = new BlendColor({ + color: '#000', + mode: 'multiply' +}); + +const filter = new BlendImage({ + image: fabricImageObject, + mode: 'multiply' +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"BlendColor"`, `BlendColorOwnProps`\> + +## Constructors + +### Constructor + +> **new BlendColor**(`options?`): `BlendColor` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`BlendColorOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`BlendColor` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### alpha + +> **alpha**: `number` + +Defined in: [src/filters/BlendColor.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L65) + +alpha value. represent the strength of the blend color operation. + +*** + +### color + +> **color**: `string` + +Defined in: [src/filters/BlendColor.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L53) + +Color to make the blend operation with. default to a reddish color since black or white +gives always strong result. + +*** + +### mode + +> **mode**: [`TBlendMode`](/api/fabric/namespaces/filters/type-aliases/tblendmode/) + +Defined in: [src/filters/BlendColor.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L60) + +Blend mode for the filter: one of multiply, add, difference, screen, subtract, +darken, lighten, overlay, exclusion, tint. + +*** + +### defaults + +> `static` **defaults**: `BlendColorOwnProps` = `blendColorDefaultValues` + +Defined in: [src/filters/BlendColor.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L67) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'BlendColor'` + +Defined in: [src/filters/BlendColor.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L69) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/BlendColor.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L71) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/BlendColor.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L99) + +Apply the Blend operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BlendColor.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L73) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/BlendColor.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L184) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `BlendColorOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `BlendColorOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `BlendColorOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `BlendColorOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/BlendImage.md b/src/content/docs/api/fabric/namespaces/filters/classes/BlendImage.md new file mode 100644 index 000000000..9645ca4ce --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/BlendImage.md @@ -0,0 +1,759 @@ +--- +editUrl: false +next: false +prev: false +title: "BlendImage" +--- + +Defined in: [src/filters/BlendImage.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L41) + +Image Blend filter class + +## Example + +```ts +const filter = new filters.BlendColor({ + color: '#000', + mode: 'multiply' +}); + +const filter = new BlendImage({ + image: fabricImageObject, + mode: 'multiply' +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`\> + +## Constructors + +### Constructor + +> **new BlendImage**(`options?`): `BlendImage` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`BlendImageOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`BlendImage` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### alpha + +> **alpha**: `number` + +Defined in: [src/filters/BlendImage.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L61) + +alpha value. represent the strength of the blend image operation. +not implemented. + +*** + +### image + +> **image**: [`FabricImage`](/api/classes/fabricimage/) + +Defined in: [src/filters/BlendImage.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L45) + +Image to make the blend operation with. + +*** + +### mode + +> **mode**: `TBlendImageMode` + +Defined in: [src/filters/BlendImage.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L55) + +Blend mode for the filter: either 'multiply' or 'mask'. 'multiply' will +multiply the values of each channel (R, G, B, and A) of the filter image by +their corresponding values in the base image. 'mask' will only look at the +alpha channel of the filter image, and apply those values to the base +image's alpha channel. + +*** + +### defaults + +> `static` **defaults**: `BlendImageOwnProps` = `blendImageDefaultValues` + +Defined in: [src/filters/BlendImage.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L65) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'BlendImage'` + +Defined in: [src/filters/BlendImage.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L63) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/BlendImage.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L67) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/BlendImage.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L121) + +Apply the Blend operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BlendImage.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L81) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### calculateMatrix() + +> **calculateMatrix**(): `number`[] + +Defined in: [src/filters/BlendImage.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L99) + +Calculate a transformMatrix to adapt the image to blend over + +#### Returns + +`number`[] + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### createTexture() + +> **createTexture**(`backend`, `image`): `null` \| `WebGLTexture` + +Defined in: [src/filters/BlendImage.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L89) + +#### Parameters + +##### backend + +[`WebGLFilterBackend`](/api/classes/webglfilterbackend/) + +##### image + +[`FabricImage`](/api/classes/fabricimage/) + +#### Returns + +`null` \| `WebGLTexture` + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BlendImage.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L69) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/BlendImage.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L73) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BlendImage.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L77) + +#### Returns + +`string` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/BlendImage.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L178) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `BlendImageOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `BlendImageOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `BlendImageOwnProps` + +Defined in: [src/filters/BlendImage.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L193) + +Returns object representation of an instance +TODO: Handle the possibility of missing image better. +As of now a BlendImage filter without image can't be used with fromObject + +#### Returns + +`object` & `BlendImageOwnProps` + +Object representation of an instance + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`object`, `options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`, `BlendImageOwnProps`\>\> + +Defined in: [src/filters/BlendImage.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendImage.ts#L210) + +Create filter instance from an object representation + +#### Parameters + +##### object + +`Record`\<`string`, `any`\> + +Object to create an instance from + +##### options? + +###### signal + +`AbortSignal` + +handle aborting image loading, see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`, `BlendImageOwnProps`\>\> + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Blur.md b/src/content/docs/api/fabric/namespaces/filters/classes/Blur.md new file mode 100644 index 000000000..c0789b930 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Blur.md @@ -0,0 +1,722 @@ +--- +editUrl: false +next: false +prev: false +title: "Blur" +--- + +Defined in: [src/filters/Blur.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L29) + +Blur filter class + +## Example + +```ts +const filter = new Blur({ + blur: 0.5 +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Blur"`, `BlurOwnProps`\> + +## Constructors + +### Constructor + +> **new Blur**(`options?`): `Blur` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`BlurOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Blur` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### aspectRatio + +> **aspectRatio**: `number` + +Defined in: [src/filters/Blur.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L39) + +*** + +### blur + +> **blur**: `number` + +Defined in: [src/filters/Blur.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L36) + +blur value, in percentage of image dimensions. +specific to keep the image blur constant at different resolutions +range between 0 and 1. + +*** + +### horizontal + +> **horizontal**: `boolean` + +Defined in: [src/filters/Blur.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L38) + +*** + +### defaults + +> `static` **defaults**: `BlurOwnProps` = `blurDefaultValues` + +Defined in: [src/filters/Blur.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L43) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Blur'` + +Defined in: [src/filters/Blur.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L41) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Blur.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L45) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/Blur.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L51) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`__namedParameters`): `void` + +Defined in: [src/filters/Blur.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L69) + +#### Parameters + +##### \_\_namedParameters + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getBlurValue() + +> **getBlurValue**(): `number` + +Defined in: [src/filters/Blur.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L178) + +#### Returns + +`number` + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Blur.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L47) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### chooseRightDelta() + +> **chooseRightDelta**(): `number`[] + +Defined in: [src/filters/Blur.ts:199](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L199) + +choose right value of image percentage to blur with + +#### Returns + +`number`[] + +a numeric array with delta values + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Blur.ts:174](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L174) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Blur.ts:166](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Blur.ts#L166) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `BlurOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `BlurOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `BlurOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `BlurOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Brightness.md b/src/content/docs/api/fabric/namespaces/filters/classes/Brightness.md new file mode 100644 index 000000000..2e785757d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Brightness.md @@ -0,0 +1,681 @@ +--- +editUrl: false +next: false +prev: false +title: "Brightness" +--- + +Defined in: [src/filters/Brightness.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L23) + +Brightness filter class + +## Example + +```ts +const filter = new Brightness({ + brightness: 0.05 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Brightness"`, `BrightnessOwnProps`\> + +## Constructors + +### Constructor + +> **new Brightness**(`options?`): `Brightness` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`BrightnessOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Brightness` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### brightness + +> **brightness**: `number` + +Defined in: [src/filters/Brightness.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L30) + +Brightness value, from -1 to 1. +translated to -255 to 255 for 2d +0.0039215686 is the part of 1 that get translated to 1 in 2d + +#### Param + +*** + +### defaults + +> `static` **defaults**: `BrightnessOwnProps` = `brightnessDefaultValues` + +Defined in: [src/filters/Brightness.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L34) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Brightness'` + +Defined in: [src/filters/Brightness.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L32) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Brightness.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L36) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Brightness.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L48) + +Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Brightness.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L38) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Brightness.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L57) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Brightness.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Brightness.ts#L67) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `BrightnessOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `BrightnessOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `BrightnessOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `BrightnessOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/ColorMatrix.md b/src/content/docs/api/fabric/namespaces/filters/classes/ColorMatrix.md new file mode 100644 index 000000000..1a5e3865a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/ColorMatrix.md @@ -0,0 +1,735 @@ +--- +editUrl: false +next: false +prev: false +title: "ColorMatrix" +--- + +Defined in: [src/filters/ColorMatrix.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L36) + +Color Matrix filter class + +## See + + - [demo](http://fabric5.fabricjs.com/image-filters|ImageFilters) + - [demo](http://phoboslab.org/log/2013/11/fast-image-filters-with-webgl) + +## Example + +```ts +const filter = new ColorMatrix({ + matrix: [ + 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, + -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, + -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, + 0, 0, 0, 1, 0 + ] +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`Name`, `OwnProps`, `SerializedProps`\> + +## Extended by + +- [`HueRotation`](/api/fabric/namespaces/filters/classes/huerotation/) + +## Type Parameters + +### Name + +`Name` *extends* `string` = `"ColorMatrix"` + +### OwnProps + +`OwnProps` *extends* `object` = `ColorMatrixOwnProps` + +### SerializedProps + +`SerializedProps` *extends* `object` = `ColorMatrixOwnProps` + +## Constructors + +### Constructor + +> **new ColorMatrix**\<`Name`, `OwnProps`, `SerializedProps`\>(`options?`): `ColorMatrix`\<`Name`, `OwnProps`, `SerializedProps`\> + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`OwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`ColorMatrix`\<`Name`, `OwnProps`, `SerializedProps`\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### colorsOnly + +> **colorsOnly**: `boolean` + +Defined in: [src/filters/ColorMatrix.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L56) + +Lock the colormatrix on the color part, skipping alpha, mainly for non webgl scenario +to save some calculation + +#### Default + +```ts +true +``` + +*** + +### matrix + +> **matrix**: [`TMatColorMatrix`](/api/type-aliases/tmatcolormatrix/) + +Defined in: [src/filters/ColorMatrix.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L48) + +Colormatrix for pixels. +array of 20 floats. Numbers in positions 4, 9, 14, 19 loose meaning +outside the -1, 1 range. +0.0039215686 is the part of 1 that get translated to 1 in 2d + +#### Param + +array of 20 numbers. + +*** + +### defaults + +> `static` **defaults**: `ColorMatrixOwnProps` = `colorMatrixDefaultValues` + +Defined in: [src/filters/ColorMatrix.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L60) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'ColorMatrix'` + +Defined in: [src/filters/ColorMatrix.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L58) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/ColorMatrix.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L62) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/ColorMatrix.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L74) + +Apply the ColorMatrix operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/ColorMatrix.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L64) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/ColorMatrix.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L105) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `SerializedProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `SerializedProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `SerializedProps` + +Defined in: [src/filters/ColorMatrix.ts:133](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L133) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `SerializedProps` + +Object representation of an instance + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Composed.md b/src/content/docs/api/fabric/namespaces/filters/classes/Composed.md new file mode 100644 index 000000000..4e764fd37 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Composed.md @@ -0,0 +1,659 @@ +--- +editUrl: false +next: false +prev: false +title: "Composed" +--- + +Defined in: [src/filters/Composed.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L17) + +A container class that knows how to apply a sequence of filters to an input image. + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Composed"`, `ComposedOwnProps`, `ComposedSerializedProps`\> + +## Constructors + +### Constructor + +> **new Composed**(`options`): `Composed` + +Defined in: [src/filters/Composed.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L29) + +#### Parameters + +##### options + +`object` & `Record`\<`string`, `any`\> = `{}` + +#### Returns + +`Composed` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### subFilters + +> **subFilters**: [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>[] + +Defined in: [src/filters/Composed.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L25) + +A non sparse array of filters to apply + +*** + +### defaults + +> `static` **defaults**: `Record`\<`string`, `unknown`\> + +Defined in: [src/filters/BaseFilter.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L49) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Composed'` + +Defined in: [src/filters/Composed.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L27) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] = `[]` + +Defined in: [src/filters/BaseFilter.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L47) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/Composed.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L42) + +Apply this container's filters to the input image provided. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`_options`): `void` + +Defined in: [src/filters/BaseFilter.ts:273](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L273) + +#### Parameters + +##### \_options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Composed.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L62) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`_gl`, `_uniformLocations`): `void` + +Defined in: [src/filters/BaseFilter.ts:357](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L357) + +Send uniform data from this filter to its shader program on the GPU. + +Intended to be overridden by subclasses. + +#### Parameters + +##### \_gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### \_uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of shader uniform names to their locations. + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `ComposedSerializedProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `ComposedSerializedProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` + +Defined in: [src/filters/Composed.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L55) + +Serialize this filter into JSON. + +#### Returns + +`object` + +A JSON representation of this filter. + +##### subFilters + +> **subFilters**: `object` & `object`[] + +##### type + +> **type**: `"Composed"` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`object`, `options?`): `Promise`\<`Composed`\> + +Defined in: [src/filters/Composed.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Composed.ts#L73) + +Deserialize a JSON definition of a ComposedFilter into a concrete instance. + +#### Parameters + +##### object + +`Record`\<`string`, `any`\> + +Object to create an instance from + +##### options? + +###### signal + +`AbortSignal` + +handle aborting `BlendImage` filter loading, see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal + +#### Returns + +`Promise`\<`Composed`\> + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Contrast.md b/src/content/docs/api/fabric/namespaces/filters/classes/Contrast.md new file mode 100644 index 000000000..c3cc0aa59 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Contrast.md @@ -0,0 +1,685 @@ +--- +editUrl: false +next: false +prev: false +title: "Contrast" +--- + +Defined in: [src/filters/Contrast.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L23) + +Contrast filter class + +## Example + +```ts +const filter = new Contrast({ + contrast: 0.25 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Contrast"`, `ContrastOwnProps`\> + +## Constructors + +### Constructor + +> **new Contrast**(`options?`): `Contrast` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`ContrastOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Contrast` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### contrast + +> **contrast**: `number` + +Defined in: [src/filters/Contrast.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L29) + +contrast value, range from -1 to 1. + +#### Param + +#### Default + +```ts +0 +``` + +*** + +### defaults + +> `static` **defaults**: `ContrastOwnProps` = `contrastDefaultValues` + +Defined in: [src/filters/Contrast.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L33) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Contrast'` + +Defined in: [src/filters/Contrast.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L31) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Contrast.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L35) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Contrast.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L51) + +Apply the Contrast operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Contrast.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L37) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Contrast.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L41) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Contrast.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Contrast.ts#L68) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `ContrastOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `ContrastOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `ContrastOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `ContrastOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Convolute.md b/src/content/docs/api/fabric/namespaces/filters/classes/Convolute.md new file mode 100644 index 000000000..700495bf9 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Convolute.md @@ -0,0 +1,736 @@ +--- +editUrl: false +next: false +prev: false +title: "Convolute" +--- + +Defined in: [src/filters/Convolute.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L56) + +Adapted from html5rocks article + +## Examples + +```ts +const filter = new Convolute({ + matrix: [ 0, -1, 0, + -1, 5, -1, + 0, -1, 0 ] +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +```ts +const filter = new Convolute({ + matrix: [ 1/9, 1/9, 1/9, + 1/9, 1/9, 1/9, + 1/9, 1/9, 1/9 ] +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +```ts +const filter = new Convolute({ + matrix: [ 1, 1, 1, + 1, 0.7, -1, + -1, -1, -1 ] +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +```ts +const filter = new Convolute({ + opaque: true, + matrix: [ 1, 1, 1, + 1, 0.7, -1, + -1, -1, -1 ] +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Convolute"`, `ConvoluteOwnProps`\> + +## Constructors + +### Constructor + +> **new Convolute**(`options?`): `Convolute` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`ConvoluteOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Convolute` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### matrix + +> **matrix**: `number`[] + +Defined in: [src/filters/Convolute.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L65) + +*** + +### opaque + +> **opaque**: `boolean` + +Defined in: [src/filters/Convolute.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L60) + +*** + +### defaults + +> `static` **defaults**: `ConvoluteOwnProps` = `convoluteDefaultValues` + +Defined in: [src/filters/Convolute.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L69) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Convolute'` + +Defined in: [src/filters/Convolute.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L67) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Convolute.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L71) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Convolute.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L89) + +Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `"Convolute_3_1"` \| `"Convolute_3_0"` \| `"Convolute_5_1"` \| `"Convolute_5_0"` \| `"Convolute_7_1"` \| `"Convolute_7_0"` \| `"Convolute_9_1"` \| `"Convolute_9_0"` + +Defined in: [src/filters/Convolute.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L73) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`"Convolute_3_1"` \| `"Convolute_3_0"` \| `"Convolute_5_1"` \| `"Convolute_5_0"` \| `"Convolute_7_1"` \| `"Convolute_7_0"` \| `"Convolute_9_1"` \| `"Convolute_9_0"` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Convolute.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L79) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Convolute.ts:154](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L154) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `ConvoluteOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `ConvoluteOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` + +Defined in: [src/filters/Convolute.ts:165](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Convolute.ts#L165) + +Returns object representation of an instance + +#### Returns + +`object` + +Object representation of an instance + +##### matrix + +> **matrix**: `number`[] + +##### opaque + +> **opaque**: `boolean` + +##### type + +> **type**: `"Convolute"` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Gamma.md b/src/content/docs/api/fabric/namespaces/filters/classes/Gamma.md new file mode 100644 index 000000000..c794e6434 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Gamma.md @@ -0,0 +1,705 @@ +--- +editUrl: false +next: false +prev: false +title: "Gamma" +--- + +Defined in: [src/filters/Gamma.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L27) + +Gamma filter class + +## Example + +```ts +const filter = new Gamma({ + gamma: [1, 0.5, 2.1] +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<*typeof* `GAMMA`, `GammaOwnProps`\> + +## Constructors + +### Constructor + +> **new Gamma**(`options`): `Gamma` + +Defined in: [src/filters/Gamma.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L49) + +#### Parameters + +##### options + +###### gamma? + +`GammaInput` + +#### Returns + +`Gamma` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### gamma + +> **gamma**: `GammaInput` + +Defined in: [src/filters/Gamma.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L32) + +Gamma array value, from 0.01 to 2.2. + +#### Param + +*** + +### rgbValues? + +> `optional` **rgbValues**: `object` + +Defined in: [src/filters/Gamma.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L33) + +#### b + +> **b**: `Uint8Array` + +#### g + +> **g**: `Uint8Array` + +#### r + +> **r**: `Uint8Array` + +*** + +### defaults + +> `static` **defaults**: `GammaOwnProps` = `gammaDefaultValues` + +Defined in: [src/filters/Gamma.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L41) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `"Gamma"` = `GAMMA` + +Defined in: [src/filters/Gamma.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L39) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Gamma.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L43) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Gamma.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L64) + +Apply the Gamma operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Gamma.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L45) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Gamma.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L106) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Gamma.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L99) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `GammaOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `GammaOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` + +Defined in: [src/filters/Gamma.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Gamma.ts#L111) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` + +Object representation of an instance + +##### gamma + +> **gamma**: `GammaInput` + +##### type + +> **type**: `"Gamma"` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Grayscale.md b/src/content/docs/api/fabric/namespaces/filters/classes/Grayscale.md new file mode 100644 index 000000000..65e0b63a7 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Grayscale.md @@ -0,0 +1,672 @@ +--- +editUrl: false +next: false +prev: false +title: "Grayscale" +--- + +Defined in: [src/filters/Grayscale.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L23) + +Grayscale image filter class + +## Example + +```ts +const filter = new Grayscale(); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Grayscale"`, `GrayscaleOwnProps`\> + +## Constructors + +### Constructor + +> **new Grayscale**(`options?`): `Grayscale` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`GrayscaleOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Grayscale` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### mode + +> **mode**: `TGrayscaleMode` + +Defined in: [src/filters/Grayscale.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L24) + +*** + +### defaults + +> `static` **defaults**: `GrayscaleOwnProps` = `grayscaleDefaultValues` + +Defined in: [src/filters/Grayscale.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L28) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Grayscale'` + +Defined in: [src/filters/Grayscale.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L26) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Grayscale.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L30) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Grayscale.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L38) + +Apply the Grayscale operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/Grayscale.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L59) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Grayscale.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L63) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Grayscale.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L86) + +Grayscale filter isNeutralState implementation +The filter is never neutral +on the image + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Grayscale.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Grayscale.ts#L73) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `GrayscaleOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `GrayscaleOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `GrayscaleOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `GrayscaleOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/HueRotation.md b/src/content/docs/api/fabric/namespaces/filters/classes/HueRotation.md new file mode 100644 index 000000000..27147a418 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/HueRotation.md @@ -0,0 +1,739 @@ +--- +editUrl: false +next: false +prev: false +title: "HueRotation" +--- + +Defined in: [src/filters/HueRotation.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L33) + +HueRotation filter class + +## Example + +```ts +const filter = new HueRotation({ + rotation: -0.5 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/)\<`"HueRotation"`, `HueRotationOwnProps`, `HueRotationSerializedProps`\> + +## Constructors + +### Constructor + +> **new HueRotation**(`options?`): `HueRotation` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`HueRotationOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`HueRotation` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`constructor`](/api/fabric/namespaces/filters/classes/colormatrix/#constructor) + +## Properties + +### colorsOnly + +> **colorsOnly**: `boolean` + +Defined in: [src/filters/ColorMatrix.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L56) + +Lock the colormatrix on the color part, skipping alpha, mainly for non webgl scenario +to save some calculation + +#### Default + +```ts +true +``` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`colorsOnly`](/api/fabric/namespaces/filters/classes/colormatrix/#colorsonly) + +*** + +### matrix + +> **matrix**: [`TMatColorMatrix`](/api/type-aliases/tmatcolormatrix/) + +Defined in: [src/filters/ColorMatrix.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L48) + +Colormatrix for pixels. +array of 20 floats. Numbers in positions 4, 9, 14, 19 loose meaning +outside the -1, 1 range. +0.0039215686 is the part of 1 that get translated to 1 in 2d + +#### Param + +array of 20 numbers. + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`matrix`](/api/fabric/namespaces/filters/classes/colormatrix/#matrix) + +*** + +### rotation + +> **rotation**: `number` + +Defined in: [src/filters/HueRotation.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L41) + +HueRotation value, from -1 to 1. + +*** + +### defaults + +> `static` **defaults**: `HueRotationOwnProps` = `hueRotationDefaultValues` + +Defined in: [src/filters/HueRotation.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L45) + +#### Overrides + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`defaults`](/api/fabric/namespaces/filters/classes/colormatrix/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'HueRotation'` + +Defined in: [src/filters/HueRotation.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L43) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`type`](/api/fabric/namespaces/filters/classes/colormatrix/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/ColorMatrix.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L62) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/colormatrix/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`type`](/api/fabric/namespaces/filters/classes/colormatrix/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/colormatrix/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/colormatrix/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/HueRotation.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L82) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`applyTo`](/api/fabric/namespaces/filters/classes/colormatrix/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/ColorMatrix.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L74) + +Apply the ColorMatrix operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/colormatrix/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/colormatrix/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/colormatrix/#bindadditionaltexture) + +*** + +### calculateMatrix() + +> **calculateMatrix**(): `void` + +Defined in: [src/filters/HueRotation.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L47) + +#### Returns + +`void` + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/colormatrix/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`createProgram`](/api/fabric/namespaces/filters/classes/colormatrix/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/colormatrix/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/colormatrix/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/ColorMatrix.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L64) + +#### Returns + +`string` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`getFragmentSource`](/api/fabric/namespaces/filters/classes/colormatrix/#getfragmentsource) + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/colormatrix/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/colormatrix/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/HueRotation.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L78) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/colormatrix/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/colormatrix/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/colormatrix/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/ColorMatrix.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrix.ts#L105) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/colormatrix/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `HueRotationSerializedProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `HueRotationSerializedProps` + +JSON + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`toJSON`](/api/fabric/namespaces/filters/classes/colormatrix/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` + +Defined in: [src/filters/HueRotation.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/HueRotation.ts#L87) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` + +Object representation of an instance + +##### rotation + +> **rotation**: `number` + +##### type + +> **type**: `"HueRotation"` + +#### Overrides + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`toObject`](/api/fabric/namespaces/filters/classes/colormatrix/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/colormatrix/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/).[`fromObject`](/api/fabric/namespaces/filters/classes/colormatrix/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Invert.md b/src/content/docs/api/fabric/namespaces/filters/classes/Invert.md new file mode 100644 index 000000000..37fa6613f --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Invert.md @@ -0,0 +1,670 @@ +--- +editUrl: false +next: false +prev: false +title: "Invert" +--- + +Defined in: [src/filters/Invert.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L22) + +## Example + +```ts +const filter = new Invert(); +object.filters.push(filter); +object.applyFilters(canvas.renderAll.bind(canvas)); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Invert"`, `InvertOwnProps`\> + +## Constructors + +### Constructor + +> **new Invert**(`options?`): `Invert` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`InvertOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Invert` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### alpha + +> **alpha**: `boolean` + +Defined in: [src/filters/Invert.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L27) + +Invert also alpha. + +#### Param + +*** + +### invert + +> **invert**: `boolean` + +Defined in: [src/filters/Invert.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L33) + +Filter invert. if false, does nothing + +#### Param + +*** + +### defaults + +> `static` **defaults**: `InvertOwnProps` = `invertDefaultValues` + +Defined in: [src/filters/Invert.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L37) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Invert'` + +Defined in: [src/filters/Invert.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L35) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Invert.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L39) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Invert.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L47) + +Apply the Invert operation to a Uint8Array representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Invert.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L69) + +Invert filter isNeutralState implementation +Used only in image applyFilters to discard filters that will not have an effect +on the image + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Invert.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Invert.ts#L79) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `InvertOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `InvertOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `InvertOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `InvertOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Noise.md b/src/content/docs/api/fabric/namespaces/filters/classes/Noise.md new file mode 100644 index 000000000..df96ea749 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Noise.md @@ -0,0 +1,680 @@ +--- +editUrl: false +next: false +prev: false +title: "Noise" +--- + +Defined in: [src/filters/Noise.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L24) + +Noise filter class + +## Example + +```ts +const filter = new Noise({ + noise: 700 +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Noise"`, `NoiseOwnProps`\> + +## Constructors + +### Constructor + +> **new Noise**(`options?`): `Noise` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`NoiseOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Noise` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### noise + +> **noise**: `number` + +Defined in: [src/filters/Noise.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L29) + +Noise value, from + +#### Param + +*** + +### defaults + +> `static` **defaults**: `NoiseOwnProps` = `noiseDefaultValues` + +Defined in: [src/filters/Noise.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L33) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Noise'` + +Defined in: [src/filters/Noise.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L31) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Noise.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L35) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Noise.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L47) + +Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Noise.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L37) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Noise.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L71) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Noise.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Noise.ts#L63) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `NoiseOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `NoiseOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `NoiseOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `NoiseOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Pixelate.md b/src/content/docs/api/fabric/namespaces/filters/classes/Pixelate.md new file mode 100644 index 000000000..21a253b66 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Pixelate.md @@ -0,0 +1,656 @@ +--- +editUrl: false +next: false +prev: false +title: "Pixelate" +--- + +Defined in: [src/filters/Pixelate.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L23) + +Pixelate filter class + +## Example + +```ts +const filter = new Pixelate({ + blocksize: 8 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Pixelate"`, `PixelateOwnProps`\> + +## Constructors + +### Constructor + +> **new Pixelate**(`options?`): `Pixelate` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`PixelateOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Pixelate` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### blocksize + +> **blocksize**: `number` + +Defined in: [src/filters/Pixelate.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L24) + +*** + +### defaults + +> `static` **defaults**: `PixelateOwnProps` = `pixelateDefaultValues` + +Defined in: [src/filters/Pixelate.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L28) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Pixelate'` + +Defined in: [src/filters/Pixelate.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L26) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Pixelate.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L30) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Pixelate.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L38) + +Apply the Pixelate operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Pixelate.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L63) + +Indicate when the filter is not gonna apply changes to the image + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Pixelate.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Pixelate.ts#L77) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `PixelateOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `PixelateOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `PixelateOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `PixelateOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/RemoveColor.md b/src/content/docs/api/fabric/namespaces/filters/classes/RemoveColor.md new file mode 100644 index 000000000..14e039007 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/RemoveColor.md @@ -0,0 +1,708 @@ +--- +editUrl: false +next: false +prev: false +title: "RemoveColor" +--- + +Defined in: [src/filters/RemoveColor.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L29) + +Remove white filter class + +## Example + +```ts +const filter = new RemoveColor({ + threshold: 0.2, +}); +object.filters.push(filter); +object.applyFilters(); +canvas.renderAll(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"RemoveColor"`, `RemoveColorOwnProps`\> + +## Constructors + +### Constructor + +> **new RemoveColor**(`options?`): `RemoveColor` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`RemoveColorOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`RemoveColor` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### color + +> **color**: `string` + +Defined in: [src/filters/RemoveColor.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L36) + +Color to remove, in any format understood by [Color](/api/classes/color/). + +*** + +### distance + +> **distance**: `number` + +Defined in: [src/filters/RemoveColor.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L42) + +distance to actual color, as value up or down from each r,g,b +between 0 and 1 + +*** + +### useAlpha + +> **useAlpha**: `boolean` + +Defined in: [src/filters/RemoveColor.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L48) + +For color to remove inside distance, use alpha channel for a smoother deletion +NOT IMPLEMENTED YET + +*** + +### defaults + +> `static` **defaults**: `RemoveColorOwnProps` = `removeColorDefaultValues` + +Defined in: [src/filters/RemoveColor.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L52) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'RemoveColor'` + +Defined in: [src/filters/RemoveColor.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L50) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/RemoveColor.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L54) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`canvasEl`): `void` + +Defined in: [src/filters/RemoveColor.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L64) + +Applies filter to canvas element + +#### Parameters + +##### canvasEl + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +Canvas element to apply filter to + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/RemoveColor.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L56) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(`options?`): `boolean` + +Defined in: [src/filters/BaseFilter.ts:246](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L246) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Parameters + +##### options? + +`any` + +#### Returns + +`boolean` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/RemoveColor.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/RemoveColor.ts#L98) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `RemoveColorOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `RemoveColorOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `RemoveColorOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `RemoveColorOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Resize.md b/src/content/docs/api/fabric/namespaces/filters/classes/Resize.md new file mode 100644 index 000000000..042587c0c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Resize.md @@ -0,0 +1,1024 @@ +--- +editUrl: false +next: false +prev: false +title: "Resize" +--- + +Defined in: [src/filters/Resize.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L54) + +Resize image filter class + +## Example + +```ts +const filter = new Resize(); +object.filters.push(filter); +object.applyFilters(canvas.renderAll.bind(canvas)); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Resize"`, `ResizeOwnProps`\> + +## Constructors + +### Constructor + +> **new Resize**(`options?`): `Resize` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`ResizeOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Resize` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### lanczosLobes + +> **lanczosLobes**: `number` + +Defined in: [src/filters/Resize.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L78) + +LanczosLobes parameter for lanczos filter, valid for resizeType lanczos + +#### Param + +*** + +### resizeType + +> **resizeType**: [`TResizeType`](/api/fabric/namespaces/filters/type-aliases/tresizetype/) + +Defined in: [src/filters/Resize.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L60) + +Resize type +for webgl resizeType is just lanczos, for canvas2d can be: +bilinear, hermite, sliceHack, lanczos. + +*** + +### scaleX + +> **scaleX**: `number` + +Defined in: [src/filters/Resize.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L66) + +Scale factor for resizing, x axis + +#### Param + +*** + +### scaleY + +> **scaleY**: `number` + +Defined in: [src/filters/Resize.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L72) + +Scale factor for resizing, y axis + +#### Param + +*** + +### defaults + +> `static` **defaults**: `ResizeOwnProps` = `resizeDefaultValues` + +Defined in: [src/filters/Resize.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L82) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Resize'` + +Defined in: [src/filters/Resize.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L80) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Resize.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L84) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/Resize.ts:195](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L195) + +Apply the resize filter to the image +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`this`, `options`): `void` + +Defined in: [src/filters/Resize.ts:221](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L221) + +#### Parameters + +##### this + +`ResizeDuring2DResize` + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToForWebgl() + +> **applyToForWebgl**(`this`, `options`): `void` + +Defined in: [src/filters/Resize.ts:161](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L161) + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bilinearFiltering() + +> **bilinearFiltering**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` + +Defined in: [src/filters/Resize.ts:415](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L415) + +bilinearFiltering + +#### Parameters + +##### this + +`ResizeDuring2DResize` + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +##### oW + +`number` + +Original Width + +##### oH + +`number` + +Original Height + +##### dW + +`number` + +Destination Width + +##### dH + +`number` + +Destination Height + +#### Returns + +`ImageData` + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### generateShader() + +> **generateShader**(`filterWindow`): `string` + +Defined in: [src/filters/Resize.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L134) + +Generate vertex and shader sources from the necessary steps numbers + +#### Parameters + +##### filterWindow + +`number` + +#### Returns + +`string` + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(`this`): `string` + +Defined in: [src/filters/Resize.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L109) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +#### Returns + +`string` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFilterWindow() + +> **getFilterWindow**(`this`): `number` + +Defined in: [src/filters/Resize.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L104) + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +#### Returns + +`number` + +*** + +### getFragmentSource() + +> **getFragmentSource**(`this`): `string` + +Defined in: [src/filters/Resize.ts:114](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L114) + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getTaps() + +> **getTaps**(`this`): `any`[] + +Defined in: [src/filters/Resize.ts:119](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L119) + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +#### Returns + +`any`[] + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### hermiteFastResize() + +> **hermiteFastResize**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` + +Defined in: [src/filters/Resize.ts:478](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L478) + +hermiteFastResize + +#### Parameters + +##### this + +`ResizeDuring2DResize` + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +##### oW + +`number` + +Original Width + +##### oH + +`number` + +Original Height + +##### dW + +`number` + +Destination Width + +##### dH + +`number` + +Destination Height + +#### Returns + +`ImageData` + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Resize.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L203) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### lanczosCreate() + +> **lanczosCreate**(`lobes`): (`x`) => `number` + +Defined in: [src/filters/Resize.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L207) + +#### Parameters + +##### lobes + +`number` + +#### Returns + +> (`x`): `number` + +##### Parameters + +###### x + +`number` + +##### Returns + +`number` + +*** + +### lanczosResize() + +> **lanczosResize**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` + +Defined in: [src/filters/Resize.ts:324](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L324) + +Filter lanczosResize + +#### Parameters + +##### this + +`ResizeDuring2DResize` + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +##### oW + +`number` + +Original Width + +##### oH + +`number` + +Original Height + +##### dW + +`number` + +Destination Width + +##### dH + +`number` + +Destination Height + +#### Returns + +`ImageData` + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`this`, `gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Resize.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L92) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### this + +`ResizeDuringWEBGLResize` + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### sliceByTwo() + +> **sliceByTwo**(`options`, `oW`, `oH`, `dW`, `dH`): `ImageData` + +Defined in: [src/filters/Resize.ts:259](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L259) + +Filter sliceByTwo + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +##### oW + +`number` + +Original Width + +##### oH + +`number` + +Original Height + +##### dW + +`number` + +Destination Width + +##### dH + +`number` + +Destination Height + +#### Returns + +`ImageData` + +*** + +### toJSON() + +> **toJSON**(): `object` & `ResizeOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `ResizeOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `ResizeOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `ResizeOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Saturation.md b/src/content/docs/api/fabric/namespaces/filters/classes/Saturation.md new file mode 100644 index 000000000..5f0a035ab --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Saturation.md @@ -0,0 +1,681 @@ +--- +editUrl: false +next: false +prev: false +title: "Saturation" +--- + +Defined in: [src/filters/Saturation.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L23) + +Saturate filter class + +## Example + +```ts +const filter = new Saturation({ + saturation: 1 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Saturation"`, `SaturationOwnProps`\> + +## Constructors + +### Constructor + +> **new Saturation**(`options?`): `Saturation` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`SaturationOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Saturation` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### saturation + +> **saturation**: `number` + +Defined in: [src/filters/Saturation.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L31) + +Saturation value, from -1 to 1. +Increases/decreases the color saturation. +A value of 0 has no effect. + +#### Param + +*** + +### defaults + +> `static` **defaults**: `SaturationOwnProps` = `saturationDefaultValues` + +Defined in: [src/filters/Saturation.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L35) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Saturation'` + +Defined in: [src/filters/Saturation.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L33) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Saturation.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L37) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Saturation.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L49) + +Apply the Saturation operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Saturation.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L39) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Saturation.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L75) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Saturation.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Saturation.ts#L68) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `SaturationOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `SaturationOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `SaturationOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `SaturationOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/classes/Vibrance.md b/src/content/docs/api/fabric/namespaces/filters/classes/Vibrance.md new file mode 100644 index 000000000..b117a992b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/classes/Vibrance.md @@ -0,0 +1,681 @@ +--- +editUrl: false +next: false +prev: false +title: "Vibrance" +--- + +Defined in: [src/filters/Vibrance.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L23) + +Vibrance filter class + +## Example + +```ts +const filter = new Vibrance({ + vibrance: 1 +}); +object.filters.push(filter); +object.applyFilters(); +``` + +## Extends + +- [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`"Vibrance"`, `VibranceOwnProps`\> + +## Constructors + +### Constructor + +> **new Vibrance**(`options?`): `Vibrance` + +Defined in: [src/filters/BaseFilter.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L55) + +Constructor + +#### Parameters + +##### options? + +`object` & `Partial`\<`VibranceOwnProps`\> & `Record`\<`string`, `any`\> = `{}` + +Options object + +#### Returns + +`Vibrance` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`constructor`](/api/fabric/namespaces/filters/classes/basefilter/#constructor) + +## Properties + +### vibrance + +> **vibrance**: `number` + +Defined in: [src/filters/Vibrance.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L31) + +Vibrance value, from -1 to 1. +Increases/decreases the saturation of more muted colors with less effect on saturated colors. +A value of 0 has no effect. + +#### Param + +*** + +### defaults + +> `static` **defaults**: `VibranceOwnProps` = `vibranceDefaultValues` + +Defined in: [src/filters/Vibrance.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L35) + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`defaults`](/api/fabric/namespaces/filters/classes/basefilter/#defaults) + +*** + +### type + +> `static` **type**: `string` = `'Vibrance'` + +Defined in: [src/filters/Vibrance.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L33) + +The class type. Used to identify which class this is. +This is used for serialization purposes and internally it can be used +to identify classes. As a developer you could use `instance of Class` +but to avoid importing all the code and blocking tree shaking we try +to avoid doing that. + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type) + +*** + +### uniformLocations + +> `static` **uniformLocations**: `string`[] + +Defined in: [src/filters/Vibrance.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L37) + +Contains the uniform locations for the fragment shader. +uStepW and uStepH are handled by the BaseFilter, each filter class +needs to specify all the one that are needed + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#uniformlocations) + +## Accessors + +### type + +#### Get Signature + +> **get** **type**(): `Name` + +Defined in: [src/filters/BaseFilter.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L29) + +Filter type + +##### Returns + +`Name` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`type`](/api/fabric/namespaces/filters/classes/basefilter/#type-1) + +## Methods + +### \_setupFrameBuffer() + +> **\_setupFrameBuffer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L203) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/fabric/namespaces/filters/classes/basefilter/#_setupframebuffer) + +*** + +### \_swapTextures() + +> **\_swapTextures**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:230](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L230) + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/fabric/namespaces/filters/classes/basefilter/#_swaptextures) + +*** + +### applyTo() + +> **applyTo**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:263](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L263) + +Apply this filter to the input image data provided. + +Determines whether to use WebGL or Canvas2D based on the options.webgl flag. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo`](/api/fabric/namespaces/filters/classes/basefilter/#applyto) + +*** + +### applyTo2d() + +> **applyTo2d**(`options`): `void` + +Defined in: [src/filters/Vibrance.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L49) + +Apply the Vibrance operation to a Uint8ClampedArray representing the pixels of an image. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/fabric/namespaces/filters/classes/basefilter/#applyto2d) + +*** + +### applyToWebGL() + +> **applyToWebGL**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L313) + +Apply this filter using webgl. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/fabric/namespaces/filters/classes/basefilter/#applytowebgl) + +*** + +### bindAdditionalTexture() + +> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:332](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L332) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### texture + +`WebGLTexture` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#bindadditionaltexture) + +*** + +### createHelpLayer() + +> **createHelpLayer**(`options`): `void` + +Defined in: [src/filters/BaseFilter.ts:368](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L368) + +If needed by a 2d filter, this functions can create an helper canvas to be used +remember that options.targetCanvas is available for use till end of chain. + +#### Parameters + +##### options + +[`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/fabric/namespaces/filters/classes/basefilter/#createhelplayer) + +*** + +### createProgram() + +> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` + +Defined in: [src/filters/BaseFilter.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L81) + +Compile this filter's shader program. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context to use for shader compilation. + +##### fragmentSource + +`string` = `...` + +fragmentShader source for compilation + +##### vertexSource + +`string` = `...` + +vertexShader source for compilation + +#### Returns + +`object` + +##### attributeLocations + +> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +##### program + +> **program**: `WebGLProgram` + +##### uniformLocations + +> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`createProgram`](/api/fabric/namespaces/filters/classes/basefilter/#createprogram) + +*** + +### getAttributeLocations() + +> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +Defined in: [src/filters/BaseFilter.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L151) + +Return a map of attribute names to WebGLAttributeLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take attribute locations. + +#### Returns + +[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) + +A map of attribute names to attribute locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getattributelocations) + +*** + +### getCacheKey() + +> **getCacheKey**(): `string` + +Defined in: [src/filters/BaseFilter.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L282) + +Returns a string that represent the current selected shader code for the filter. +Used to force recompilation when parameters change or to retrieve the shader from cache + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/fabric/namespaces/filters/classes/basefilter/#getcachekey) + +*** + +### getFragmentSource() + +> **getFragmentSource**(): `string` + +Defined in: [src/filters/Vibrance.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L39) + +#### Returns + +`string` + +#### Overrides + +`BaseFilter.getFragmentSource` + +*** + +### getUniformLocations() + +> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +Defined in: [src/filters/BaseFilter.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L167) + +Return a map of uniform names to WebGLUniformLocation objects. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### program + +`WebGLProgram` + +The shader program from which to take uniform locations. + +#### Returns + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of uniform names to uniform locations. + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/fabric/namespaces/filters/classes/basefilter/#getuniformlocations) + +*** + +### getVertexSource() + +> **getVertexSource**(): `string` + +Defined in: [src/filters/BaseFilter.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L70) + +#### Returns + +`string` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/fabric/namespaces/filters/classes/basefilter/#getvertexsource) + +*** + +### isNeutralState() + +> **isNeutralState**(): `boolean` + +Defined in: [src/filters/Vibrance.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L77) + +Generic isNeutral implementation for one parameter based filters. +Used only in image applyFilters to discard filters that will not have an effect +on the image +Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) + +#### Returns + +`boolean` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/fabric/namespaces/filters/classes/basefilter/#isneutralstate) + +*** + +### retrieveShader() + +> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +Defined in: [src/filters/BaseFilter.ts:293](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L293) + +Retrieves the cached shader. + +#### Parameters + +##### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) + +#### Returns + +[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) + +the compiled program shader + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/fabric/namespaces/filters/classes/basefilter/#retrieveshader) + +*** + +### sendAttributeData() + +> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` + +Defined in: [src/filters/BaseFilter.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L190) + +Send attribute data from this filter to its shader program on the GPU. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The canvas context used to compile the shader program. + +##### attributeLocations + +`Record`\<`string`, `number`\> + +A map of shader attribute names to their locations. + +##### aPositionData + +`Float32Array` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/fabric/namespaces/filters/classes/basefilter/#sendattributedata) + +*** + +### sendUniformData() + +> **sendUniformData**(`gl`, `uniformLocations`): `void` + +Defined in: [src/filters/Vibrance.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Vibrance.ts#L70) + +Send data from this filter to its shader program's uniforms. + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +The GL canvas context used to compile this filter's shader. + +##### uniformLocations + +[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) + +A map of string uniform names to WebGLUniformLocation objects + +#### Returns + +`void` + +#### Overrides + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/fabric/namespaces/filters/classes/basefilter/#senduniformdata) + +*** + +### toJSON() + +> **toJSON**(): `object` & `VibranceOwnProps` + +Defined in: [src/filters/BaseFilter.ts:405](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L405) + +Returns a JSON representation of an instance + +#### Returns + +`object` & `VibranceOwnProps` + +JSON + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toJSON`](/api/fabric/namespaces/filters/classes/basefilter/#tojson) + +*** + +### toObject() + +> **toObject**(): `object` & `VibranceOwnProps` + +Defined in: [src/filters/BaseFilter.ts:385](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L385) + +Returns object representation of an instance +It will automatically export the default values of a filter, +stored in the static defaults property. + +#### Returns + +`object` & `VibranceOwnProps` + +Object representation of an instance + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`toObject`](/api/fabric/namespaces/filters/classes/basefilter/#toobject) + +*** + +### unbindAdditionalTexture() + +> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` + +Defined in: [src/filters/BaseFilter.ts:343](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L343) + +#### Parameters + +##### gl + +`WebGLRenderingContext` + +##### textureUnit + +`number` + +#### Returns + +`void` + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/fabric/namespaces/filters/classes/basefilter/#unbindadditionaltexture) + +*** + +### fromObject() + +> `static` **fromObject**(`__namedParameters`, `_options?`): `Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +Defined in: [src/filters/BaseFilter.ts:410](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BaseFilter.ts#L410) + +#### Parameters + +##### \_\_namedParameters + +`Record`\<`string`, `any`\> + +##### \_options? + +[`Abortable`](/api/type-aliases/abortable/) + +#### Returns + +`Promise`\<[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\>\> + +#### Inherited from + +[`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/).[`fromObject`](/api/fabric/namespaces/filters/classes/basefilter/#fromobject) diff --git a/src/content/docs/api/fabric/namespaces/filters/index.md b/src/content/docs/api/fabric/namespaces/filters/index.md new file mode 100644 index 000000000..15d8ee453 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/index.md @@ -0,0 +1,43 @@ +--- +editUrl: false +next: false +prev: false +title: "filters" +--- + +## Classes + +- [BaseFilter](/api/fabric/namespaces/filters/classes/basefilter/) +- [BlendColor](/api/fabric/namespaces/filters/classes/blendcolor/) +- [BlendImage](/api/fabric/namespaces/filters/classes/blendimage/) +- [Blur](/api/fabric/namespaces/filters/classes/blur/) +- [Brightness](/api/fabric/namespaces/filters/classes/brightness/) +- [ColorMatrix](/api/fabric/namespaces/filters/classes/colormatrix/) +- [Composed](/api/fabric/namespaces/filters/classes/composed/) +- [Contrast](/api/fabric/namespaces/filters/classes/contrast/) +- [Convolute](/api/fabric/namespaces/filters/classes/convolute/) +- [Gamma](/api/fabric/namespaces/filters/classes/gamma/) +- [Grayscale](/api/fabric/namespaces/filters/classes/grayscale/) +- [HueRotation](/api/fabric/namespaces/filters/classes/huerotation/) +- [Invert](/api/fabric/namespaces/filters/classes/invert/) +- [Noise](/api/fabric/namespaces/filters/classes/noise/) +- [Pixelate](/api/fabric/namespaces/filters/classes/pixelate/) +- [RemoveColor](/api/fabric/namespaces/filters/classes/removecolor/) +- [Resize](/api/fabric/namespaces/filters/classes/resize/) +- [Saturation](/api/fabric/namespaces/filters/classes/saturation/) +- [Vibrance](/api/fabric/namespaces/filters/classes/vibrance/) + +## Type Aliases + +- [TBlendMode](/api/fabric/namespaces/filters/type-aliases/tblendmode/) +- [TResizeType](/api/fabric/namespaces/filters/type-aliases/tresizetype/) + +## Variables + +- [BlackWhite](/api/fabric/namespaces/filters/variables/blackwhite/) +- [Brownie](/api/fabric/namespaces/filters/variables/brownie/) +- [Kodachrome](/api/fabric/namespaces/filters/variables/kodachrome/) +- [Polaroid](/api/fabric/namespaces/filters/variables/polaroid/) +- [Sepia](/api/fabric/namespaces/filters/variables/sepia/) +- [Technicolor](/api/fabric/namespaces/filters/variables/technicolor/) +- [Vintage](/api/fabric/namespaces/filters/variables/vintage/) diff --git a/src/content/docs/api/fabric/namespaces/filters/type-aliases/TBlendMode.md b/src/content/docs/api/fabric/namespaces/filters/type-aliases/TBlendMode.md new file mode 100644 index 000000000..66e5719d3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/type-aliases/TBlendMode.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TBlendMode" +--- + +> **TBlendMode** = `"multiply"` \| `"add"` \| `"difference"` \| `"screen"` \| `"subtract"` \| `"darken"` \| `"lighten"` \| `"overlay"` \| `"exclusion"` \| `"tint"` + +Defined in: [src/filters/BlendColor.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/BlendColor.ts#L7) diff --git a/src/content/docs/api/fabric/namespaces/filters/type-aliases/TResizeType.md b/src/content/docs/api/fabric/namespaces/filters/type-aliases/TResizeType.md new file mode 100644 index 000000000..e77b9ce26 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/type-aliases/TResizeType.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TResizeType" +--- + +> **TResizeType** = `"bilinear"` \| `"hermite"` \| `"sliceHack"` \| `"lanczos"` + +Defined in: [src/filters/Resize.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/Resize.ts#L12) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/BlackWhite.md b/src/content/docs/api/fabric/namespaces/filters/variables/BlackWhite.md new file mode 100644 index 000000000..52747e784 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/BlackWhite.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "BlackWhite" +--- + +> `const` **BlackWhite**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L78) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Brownie.md b/src/content/docs/api/fabric/namespaces/filters/variables/Brownie.md new file mode 100644 index 000000000..7b0f850b9 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Brownie.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Brownie" +--- + +> `const` **Brownie**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L30) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Kodachrome.md b/src/content/docs/api/fabric/namespaces/filters/variables/Kodachrome.md new file mode 100644 index 000000000..6a743fd77 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Kodachrome.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Kodachrome" +--- + +> `const` **Kodachrome**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L46) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Polaroid.md b/src/content/docs/api/fabric/namespaces/filters/variables/Polaroid.md new file mode 100644 index 000000000..81099a93e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Polaroid.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Polaroid" +--- + +> `const` **Polaroid**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L62) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Sepia.md b/src/content/docs/api/fabric/namespaces/filters/variables/Sepia.md new file mode 100644 index 000000000..96fd88ff7 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Sepia.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Sepia" +--- + +> `const` **Sepia**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L70) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Technicolor.md b/src/content/docs/api/fabric/namespaces/filters/variables/Technicolor.md new file mode 100644 index 000000000..01541cad5 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Technicolor.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Technicolor" +--- + +> `const` **Technicolor**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L54) diff --git a/src/content/docs/api/fabric/namespaces/filters/variables/Vintage.md b/src/content/docs/api/fabric/namespaces/filters/variables/Vintage.md new file mode 100644 index 000000000..6821041d1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/filters/variables/Vintage.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "Vintage" +--- + +> `const` **Vintage**: *typeof* [`ColorMatrix`](/api/fabric/namespaces/filters/classes/colormatrix/) + +Defined in: [src/filters/ColorMatrixFilters.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/ColorMatrixFilters.ts#L38) diff --git a/src/content/docs/api/namespaces/util/functions/addTransformToObject.md b/src/content/docs/api/fabric/namespaces/util/functions/addTransformToObject.md similarity index 53% rename from src/content/docs/api/namespaces/util/functions/addTransformToObject.md rename to src/content/docs/api/fabric/namespaces/util/functions/addTransformToObject.md index 22a049703..cd594d676 100644 --- a/src/content/docs/api/namespaces/util/functions/addTransformToObject.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/addTransformToObject.md @@ -7,6 +7,8 @@ title: "addTransformToObject" > **addTransformToObject**(`object`, `transform`): `void` +Defined in: [src/util/misc/objectTransforms.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L43) + given an object and a transform, apply the transform to the object. this is equivalent to change the space where the object is drawn. Adding to an object a transform that scale by 2 is like scaling it by 2. @@ -14,18 +16,18 @@ This is used when removing an object from an active selection for example. ## Parameters -• **object**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +### object + +[`BaseFabricObject`](/api/classes/basefabricobject/) the object you want to transform -• **transform**: [`TMat2D`](/api/type-aliases/tmat2d/) +### transform + +[`TMat2D`](/api/type-aliases/tmat2d/) the destination transform ## Returns `void` - -## Defined in - -[src/util/misc/objectTransforms.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L43) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/animate.md b/src/content/docs/api/fabric/namespaces/util/functions/animate.md new file mode 100644 index 000000000..c9f9df334 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/animate.md @@ -0,0 +1,147 @@ +--- +editUrl: false +next: false +prev: false +title: "animate" +--- + +## Call Signature + +> **animate**(`options`): `ArrayAnimation` + +Defined in: [src/util/animation/animate.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/animate.ts#L50) + +Changes value(s) from startValue to endValue within a certain period of time, +invoking callbacks as the value(s) change. + +### Parameters + +#### options + +[`ArrayAnimationOptions`](/api/fabric/namespaces/util/type-aliases/arrayanimationoptions/) + +### Returns + +`ArrayAnimation` + +### Examples + +```ts +animate({ + startValue: 1, + endValue: 0, + onChange: (v) => { + obj.set('opacity', v); + // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` + canvas.renderAll(); + } +}); +``` + +```ts +Using lists: +animate({ + startValue: [1, 2, 3], + endValue: [2, 4, 6], + onChange: ([x, y, zoom]) => { + canvas.zoomToPoint(new Point(x, y), zoom); + canvas.renderAll(); + } +}); +``` + +## Call Signature + +> **animate**(`options`): `ValueAnimation` + +Defined in: [src/util/animation/animate.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/animate.ts#L51) + +Changes value(s) from startValue to endValue within a certain period of time, +invoking callbacks as the value(s) change. + +### Parameters + +#### options + +[`ValueAnimationOptions`](/api/fabric/namespaces/util/type-aliases/valueanimationoptions/) + +### Returns + +`ValueAnimation` + +### Examples + +```ts +animate({ + startValue: 1, + endValue: 0, + onChange: (v) => { + obj.set('opacity', v); + // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` + canvas.renderAll(); + } +}); +``` + +```ts +Using lists: +animate({ + startValue: [1, 2, 3], + endValue: [2, 4, 6], + onChange: ([x, y, zoom]) => { + canvas.zoomToPoint(new Point(x, y), zoom); + canvas.renderAll(); + } +}); +``` + +## Call Signature + +> **animate**\<`T`\>(`options`): `T` *extends* `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`[]\> & `object`\> ? `ArrayAnimation` : `ValueAnimation` + +Defined in: [src/util/animation/animate.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/animate.ts#L52) + +Changes value(s) from startValue to endValue within a certain period of time, +invoking callbacks as the value(s) change. + +### Type Parameters + +#### T + +`T` *extends* `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`\> & `object`\> \| `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`[]\> & `object`\> + +### Parameters + +#### options + +`T` + +### Returns + +`T` *extends* `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`[]\> & `object`\> ? `ArrayAnimation` : `ValueAnimation` + +### Examples + +```ts +animate({ + startValue: 1, + endValue: 0, + onChange: (v) => { + obj.set('opacity', v); + // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` + canvas.renderAll(); + } +}); +``` + +```ts +Using lists: +animate({ + startValue: [1, 2, 3], + endValue: [2, 4, 6], + onChange: ([x, y, zoom]) => { + canvas.zoomToPoint(new Point(x, y), zoom); + canvas.renderAll(); + } +}); +``` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/animateColor.md b/src/content/docs/api/fabric/namespaces/util/functions/animateColor.md new file mode 100644 index 000000000..184c1f791 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/animateColor.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "animateColor" +--- + +> **animateColor**(`options`): `ColorAnimation` + +Defined in: [src/util/animation/animate.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/animate.ts#L70) + +## Parameters + +### options + +[`ColorAnimationOptions`](/api/fabric/namespaces/util/type-aliases/coloranimationoptions/) + +## Returns + +`ColorAnimation` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/applyTransformToObject.md b/src/content/docs/api/fabric/namespaces/util/functions/applyTransformToObject.md new file mode 100644 index 000000000..e6508e19e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/applyTransformToObject.md @@ -0,0 +1,30 @@ +--- +editUrl: false +next: false +prev: false +title: "applyTransformToObject" +--- + +> **applyTransformToObject**(`object`, `transform`): `void` + +Defined in: [src/util/misc/objectTransforms.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L54) + +discard an object transform state and apply the one from the matrix. + +## Parameters + +### object + +[`BaseFabricObject`](/api/classes/basefabricobject/) + +the object you want to transform + +### transform + +[`TMat2D`](/api/type-aliases/tmat2d/) + +the destination transform + +## Returns + +`void` diff --git a/src/content/docs/api/namespaces/util/functions/calcAngleBetweenVectors.md b/src/content/docs/api/fabric/namespaces/util/functions/calcAngleBetweenVectors.md similarity index 50% rename from src/content/docs/api/namespaces/util/functions/calcAngleBetweenVectors.md rename to src/content/docs/api/fabric/namespaces/util/functions/calcAngleBetweenVectors.md index 0b27b681c..783a29c50 100644 --- a/src/content/docs/api/namespaces/util/functions/calcAngleBetweenVectors.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/calcAngleBetweenVectors.md @@ -7,18 +7,22 @@ title: "calcAngleBetweenVectors" > **calcAngleBetweenVectors**(`a`, `b`): [`TRadian`](/api/type-aliases/tradian/) +Defined in: [src/util/misc/vectors.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L39) + +Calculates the angle between 2 vectors + ## Parameters -• **a**: [`Point`](/api/classes/point/) +### a + +[`Point`](/api/classes/point/) -• **b**: [`Point`](/api/classes/point/) +### b + +[`Point`](/api/classes/point/) ## Returns [`TRadian`](/api/type-aliases/tradian/) the angle in radians from `a` to `b` - -## Defined in - -[src/util/misc/vectors.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L39) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/calcDimensionsMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/calcDimensionsMatrix.md new file mode 100644 index 000000000..a23f497df --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/calcDimensionsMatrix.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "calcDimensionsMatrix" +--- + +> **calcDimensionsMatrix**(`options`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:274](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L274) + +Returns a transform matrix starting from an object of the same kind of +the one returned from qrDecompose, useful also if you want to calculate some +transformations from an object that is not enlived yet. +is called DimensionsTransformMatrix because those properties are the one that influence +the size of the resulting box of the object. + +## Parameters + +### options + +[`TScaleMatrixArgs`](/api/fabric/namespaces/util/type-aliases/tscalematrixargs/) + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +transform matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/calcPlaneChangeMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/calcPlaneChangeMatrix.md new file mode 100644 index 000000000..f8f5f8d5a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/calcPlaneChangeMatrix.md @@ -0,0 +1,27 @@ +--- +editUrl: false +next: false +prev: false +title: "calcPlaneChangeMatrix" +--- + +> **calcPlaneChangeMatrix**(`from?`, `to?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/planeChange.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/planeChange.ts#L15) + +We are actually looking for the transformation from the destination plane to the source plane (change of basis matrix)\ +The object will exist on the destination plane and we want it to seem unchanged by it so we invert the destination matrix (`to`) and then apply the source matrix (`from`) + +## Parameters + +### from? + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +### to? + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/calcVectorRotation.md b/src/content/docs/api/fabric/namespaces/util/functions/calcVectorRotation.md new file mode 100644 index 000000000..567759b2c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/calcVectorRotation.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "calcVectorRotation" +--- + +> **calcVectorRotation**(`v`): [`TRadian`](/api/type-aliases/tradian/) + +Defined in: [src/util/misc/vectors.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L47) + +Calculates the angle between the x axis and the vector + +## Parameters + +### v + +[`Point`](/api/classes/point/) + +## Returns + +[`TRadian`](/api/type-aliases/tradian/) + +the angle in radians of `v` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/cancelAnimFrame.md b/src/content/docs/api/fabric/namespaces/util/functions/cancelAnimFrame.md new file mode 100644 index 000000000..17b107ef5 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/cancelAnimFrame.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "cancelAnimFrame" +--- + +> **cancelAnimFrame**(`handle`): `void` + +Defined in: [src/util/animation/AnimationFrameProvider.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/AnimationFrameProvider.ts#L7) + +## Parameters + +### handle + +`number` + +## Returns + +`void` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/capValue.md b/src/content/docs/api/fabric/namespaces/util/functions/capValue.md new file mode 100644 index 000000000..5343b68be --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/capValue.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "capValue" +--- + +> **capValue**(`min`, `value`, `max`): `number` + +Defined in: [src/util/misc/capValue.ts:1](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/capValue.ts#L1) + +## Parameters + +### min + +`number` + +### value + +`number` + +### max + +`number` + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/composeMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/composeMatrix.md new file mode 100644 index 000000000..e8de842b3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/composeMatrix.md @@ -0,0 +1,27 @@ +--- +editUrl: false +next: false +prev: false +title: "composeMatrix" +--- + +> **composeMatrix**(`options`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:312](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L312) + +Returns a transform matrix starting from an object of the same kind of +the one returned from qrDecompose, useful also if you want to calculate some +transformations from an object that is not enlived yet +Before changing this function look at: src/benchmarks/calcTransformMatrix.mjs + +## Parameters + +### options + +[`TComposeMatrixArgs`](/api/fabric/namespaces/util/type-aliases/tcomposematrixargs/) + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +transform matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/copyCanvasElement.md b/src/content/docs/api/fabric/namespaces/util/functions/copyCanvasElement.md new file mode 100644 index 000000000..16705db88 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/copyCanvasElement.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "copyCanvasElement" +--- + +> **copyCanvasElement**(`canvas`): `HTMLCanvasElement` + +Defined in: [src/util/misc/dom.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/dom.ts#L28) + +Creates a canvas element that is a copy of another and is also painted + +## Parameters + +### canvas + +`HTMLCanvasElement` + +to copy size and content of + +## Returns + +`HTMLCanvasElement` + +initialized canvas element diff --git a/src/content/docs/api/fabric/namespaces/util/functions/cos.md b/src/content/docs/api/fabric/namespaces/util/functions/cos.md new file mode 100644 index 000000000..f013a7507 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/cos.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "cos" +--- + +> **cos**(`angle`): `number` + +Defined in: [src/util/misc/cos.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/cos.ts#L11) + +Calculate the cos of an angle, avoiding returning floats for known results +This function is here just to avoid getting 0.999999999999999 when dealing +with numbers that are really 1 or 0. + +## Parameters + +### angle + +[`TRadian`](/api/type-aliases/tradian/) + +the angle + +## Returns + +`number` + +the cosin value for angle. diff --git a/src/content/docs/api/namespaces/util/functions/createCanvasElement.md b/src/content/docs/api/fabric/namespaces/util/functions/createCanvasElement.md similarity index 52% rename from src/content/docs/api/namespaces/util/functions/createCanvasElement.md rename to src/content/docs/api/fabric/namespaces/util/functions/createCanvasElement.md index a95d8cbca..591d10a70 100644 --- a/src/content/docs/api/namespaces/util/functions/createCanvasElement.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/createCanvasElement.md @@ -7,12 +7,12 @@ title: "createCanvasElement" > **createCanvasElement**(): `HTMLCanvasElement` +Defined in: [src/util/misc/dom.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/dom.ts#L8) + +Creates canvas element + ## Returns `HTMLCanvasElement` initialized canvas element - -## Defined in - -[src/util/misc/dom.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/dom.ts#L8) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createImage.md b/src/content/docs/api/fabric/namespaces/util/functions/createImage.md new file mode 100644 index 000000000..427e8baec --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createImage.md @@ -0,0 +1,18 @@ +--- +editUrl: false +next: false +prev: false +title: "createImage" +--- + +> **createImage**(): `HTMLImageElement` + +Defined in: [src/util/misc/dom.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/dom.ts#L20) + +Creates image element (works on client and node) + +## Returns + +`HTMLImageElement` + +HTML image element diff --git a/src/content/docs/api/namespaces/util/functions/createRotateMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/createRotateMatrix.md similarity index 53% rename from src/content/docs/api/namespaces/util/functions/createRotateMatrix.md rename to src/content/docs/api/fabric/namespaces/util/functions/createRotateMatrix.md index 98633689e..8a4de4e8d 100644 --- a/src/content/docs/api/namespaces/util/functions/createRotateMatrix.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/createRotateMatrix.md @@ -5,7 +5,9 @@ prev: false title: "createRotateMatrix" --- -> **createRotateMatrix**(`angle`, `pivotPoint`?): [`TMat2D`](/api/type-aliases/tmat2d/) +> **createRotateMatrix**(`angle`, `pivotPoint?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L169) Generate a rotation matrix around around a point (x,y), defaulting to (0,0) @@ -16,11 +18,15 @@ A matrix in the form of ## Parameters -• **angle**: [`TRotateMatrixArgs`](/api/namespaces/util/type-aliases/trotatematrixargs/) = `{}` +### angle + +[`TRotateMatrixArgs`](/api/fabric/namespaces/util/type-aliases/trotatematrixargs/) = `{}` rotation in degrees -• **pivotPoint?**: `Partial`\<[`XY`](/api/interfaces/xy/)\> = `{}` +### pivotPoint? + +`Partial`\<[`XY`](/api/interfaces/xy/)\> = `{}` pivot point to rotate around @@ -29,7 +35,3 @@ pivot point to rotate around [`TMat2D`](/api/type-aliases/tmat2d/) matrix - -## Defined in - -[src/util/misc/matrix.ts:169](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L169) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createScaleMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/createScaleMatrix.md new file mode 100644 index 000000000..011088578 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createScaleMatrix.md @@ -0,0 +1,39 @@ +--- +editUrl: false +next: false +prev: false +title: "createScaleMatrix" +--- + +> **createScaleMatrix**(`x`, `y?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L200) + +Generate a scale matrix around the point (0,0) + +A matrix in the form of +[x 0 0] +[0 y 0] +[0 0 1] + +[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#scale](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#scale) + +## Parameters + +### x + +`number` + +scale on X axis + +### y? + +`number` = `x` + +scale on Y axis + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createSkewXMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/createSkewXMatrix.md new file mode 100644 index 000000000..02cad5777 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createSkewXMatrix.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "createSkewXMatrix" +--- + +> **createSkewXMatrix**(`skewValue`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:228](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L228) + +Generate a skew matrix for the X axis + +A matrix in the form of +[1 x 0] +[0 1 0] +[0 0 1] + +[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#skewx](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#skewx) + +## Parameters + +### skewValue + +[`TDegree`](/api/type-aliases/tdegree/) + +translation on X axis + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createSkewYMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/createSkewYMatrix.md new file mode 100644 index 000000000..4ef0964dc --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createSkewYMatrix.md @@ -0,0 +1,33 @@ +--- +editUrl: false +next: false +prev: false +title: "createSkewYMatrix" +--- + +> **createSkewYMatrix**(`skewValue`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:250](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L250) + +Generate a skew matrix for the Y axis + +A matrix in the form of +[1 0 0] +[y 1 0] +[0 0 1] + +[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#skewy](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#skewy) + +## Parameters + +### skewValue + +[`TDegree`](/api/type-aliases/tdegree/) + +translation on Y axis + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createTranslateMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/createTranslateMatrix.md new file mode 100644 index 000000000..722b82f96 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createTranslateMatrix.md @@ -0,0 +1,39 @@ +--- +editUrl: false +next: false +prev: false +title: "createTranslateMatrix" +--- + +> **createTranslateMatrix**(`x`, `y?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:147](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L147) + +Generate a translation matrix + +A translation matrix in the form of +[ 1 0 x ] +[ 0 1 y ] +[ 0 0 1 ] + +See [https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#translate](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#translate) for more details + +## Parameters + +### x + +`number` + +translation on X axis + +### y? + +`number` = `0` + +translation on Y axis + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +matrix diff --git a/src/content/docs/api/fabric/namespaces/util/functions/createVector.md b/src/content/docs/api/fabric/namespaces/util/functions/createVector.md new file mode 100644 index 000000000..1784f35dc --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/createVector.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "createVector" +--- + +> **createVector**(`from`, `to`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/vectors.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L24) + +Creates a vector from points represented as a point + +## Parameters + +### from + +[`XY`](/api/interfaces/xy/) + +### to + +[`XY`](/api/interfaces/xy/) + +## Returns + +[`Point`](/api/classes/point/) + +vector diff --git a/src/content/docs/api/fabric/namespaces/util/functions/crossProduct.md b/src/content/docs/api/fabric/namespaces/util/functions/crossProduct.md new file mode 100644 index 000000000..5765de753 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/crossProduct.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "crossProduct" +--- + +> **crossProduct**(`a`, `b`): `number` + +Defined in: [src/util/misc/vectors.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L74) + +Cross product of two vectors in 2D + +## Parameters + +### a + +[`Point`](/api/classes/point/) + +### b + +[`Point`](/api/classes/point/) + +## Returns + +`number` + +the magnitude of Z vector diff --git a/src/content/docs/api/fabric/namespaces/util/functions/degreesToRadians.md b/src/content/docs/api/fabric/namespaces/util/functions/degreesToRadians.md new file mode 100644 index 000000000..ec4c0bb11 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/degreesToRadians.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "degreesToRadians" +--- + +> **degreesToRadians**(`degrees`): [`TRadian`](/api/type-aliases/tradian/) + +Defined in: [src/util/misc/radiansDegreesConversion.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/radiansDegreesConversion.ts#L9) + +Transforms degrees to radians. + +## Parameters + +### degrees + +[`TDegree`](/api/type-aliases/tdegree/) + +value in degrees + +## Returns + +[`TRadian`](/api/type-aliases/tradian/) + +value in radians diff --git a/src/content/docs/api/fabric/namespaces/util/functions/dotProduct.md b/src/content/docs/api/fabric/namespaces/util/functions/dotProduct.md new file mode 100644 index 000000000..aa0d35220 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/dotProduct.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "dotProduct" +--- + +> **dotProduct**(`a`, `b`): `number` + +Defined in: [src/util/misc/vectors.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L83) + +Dot product of two vectors in 2D + +## Parameters + +### a + +[`Point`](/api/classes/point/) + +### b + +[`Point`](/api/classes/point/) + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjectEnlivables.md b/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjectEnlivables.md new file mode 100644 index 000000000..e3ae90a16 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjectEnlivables.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "enlivenObjectEnlivables" +--- + +> **enlivenObjectEnlivables**\<`R`\>(`serializedObject`, `options?`): `Promise`\<`R`\> + +Defined in: [src/util/misc/objectEnlive.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectEnlive.ts#L143) + +Creates corresponding fabric instances residing in an object, e.g. `clipPath` + +## Type Parameters + +### R + +`R` = `Record`\<`string`, `null` \| [`TFiller`](/api/type-aliases/tfiller/) \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>\> + +## Parameters + +### serializedObject + +`any` + +### options? + +[`Abortable`](/api/type-aliases/abortable/) = `{}` + +## Returns + +`Promise`\<`R`\> + +the input object with enlived values diff --git a/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjects.md b/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjects.md new file mode 100644 index 000000000..6f5be5a46 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/enlivenObjects.md @@ -0,0 +1,37 @@ +--- +editUrl: false +next: false +prev: false +title: "enlivenObjects" +--- + +> **enlivenObjects**\<`T`\>(`objects`, `options?`): `Promise`\<`T`[]\> + +Defined in: [src/util/misc/objectEnlive.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectEnlive.ts#L92) + +## Type Parameters + +### T + +`T` *extends* [`TFiller`](/api/type-aliases/tfiller/) \| [`Shadow`](/api/classes/shadow/) \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`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/)\> \| [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`, `object`, `object`\> + +## Parameters + +### objects + +`any`[] + +Objects to enliven + +### options? + +[`EnlivenObjectOptions`](/api/fabric/namespaces/util/type-aliases/enlivenobjectoptions/) = `{}` + +## Returns + +`Promise`\<`T`[]\> + +## TODO + +type this correctly. +Creates corresponding fabric instances from their object representations diff --git a/src/content/docs/api/fabric/namespaces/util/functions/findScaleToCover.md b/src/content/docs/api/fabric/namespaces/util/functions/findScaleToCover.md new file mode 100644 index 000000000..4e95dd013 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/findScaleToCover.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "findScaleToCover" +--- + +> **findScaleToCover**(`source`, `destination`): `number` + +Defined in: [src/util/misc/findScaleTo.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/findScaleTo.ts#L25) + +Finds the scale for the object source to cover entirely the object destination, +keeping aspect ratio intact. +respect the total allowed area for the cache. + +## Parameters + +### source + +[`TSize`](/api/type-aliases/tsize/) + +natural unscaled size of the object + +### destination + +[`TSize`](/api/type-aliases/tsize/) + +natural unscaled size of the object + +## Returns + +`number` + +scale factor to apply to source to cover destination diff --git a/src/content/docs/api/fabric/namespaces/util/functions/findScaleToFit.md b/src/content/docs/api/fabric/namespaces/util/functions/findScaleToFit.md new file mode 100644 index 000000000..389837f2a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/findScaleToFit.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "findScaleToFit" +--- + +> **findScaleToFit**(`source`, `destination`): `number` + +Defined in: [src/util/misc/findScaleTo.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/findScaleTo.ts#L11) + +Finds the scale for the object source to fit inside the object destination, +keeping aspect ratio intact. +respect the total allowed area for the cache. + +## Parameters + +### source + +[`TSize`](/api/type-aliases/tsize/) + +natural unscaled size of the object + +### destination + +[`TSize`](/api/type-aliases/tsize/) + +natural unscaled size of the object + +## Returns + +`number` + +scale factor to apply to source to fit into destination diff --git a/src/content/docs/api/namespaces/util/functions/getBoundsOfCurve.md b/src/content/docs/api/fabric/namespaces/util/functions/getBoundsOfCurve.md similarity index 63% rename from src/content/docs/api/namespaces/util/functions/getBoundsOfCurve.md rename to src/content/docs/api/fabric/namespaces/util/functions/getBoundsOfCurve.md index cf0e48489..1c238d9a7 100644 --- a/src/content/docs/api/namespaces/util/functions/getBoundsOfCurve.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/getBoundsOfCurve.md @@ -7,42 +7,56 @@ title: "getBoundsOfCurve" > **getBoundsOfCurve**(`begx`, `begy`, `cp1x`, `cp1y`, `cp2x`, `cp2y`, `endx`, `endy`): [`TRectBounds`](/api/type-aliases/trectbounds/) +Defined in: [src/util/path/index.ts:221](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L221) + Calculate bounding box of a cubic Bezier curve Taken from http://jsbin.com/ivomiq/56/edit (no credits available) TODO: can we normalize this with the starting points set at 0 and then translated the bbox? ## Parameters -• **begx**: `number` +### begx + +`number` starting point -• **begy**: `number` +### begy + +`number` -• **cp1x**: `number` +### cp1x + +`number` first control point -• **cp1y**: `number` +### cp1y + +`number` + +### cp2x -• **cp2x**: `number` +`number` second control point -• **cp2y**: `number` +### cp2y -• **endx**: `number` +`number` + +### endx + +`number` end of bezier -• **endy**: `number` +### endy + +`number` ## Returns [`TRectBounds`](/api/type-aliases/trectbounds/) the rectangular bounds - -## Defined in - -[src/util/path/index.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L221) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getOrthonormalVector.md b/src/content/docs/api/fabric/namespaces/util/functions/getOrthonormalVector.md new file mode 100644 index 000000000..53035f876 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getOrthonormalVector.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "getOrthonormalVector" +--- + +> **getOrthonormalVector**(`v`, `counterClockwise?`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/vectors.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L62) + +## Parameters + +### v + +[`Point`](/api/classes/point/) + +### counterClockwise? + +`boolean` = `true` + +the direction of the orthogonal vector, defaults to `true` + +## Returns + +[`Point`](/api/classes/point/) + +the unit orthogonal vector diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getPathSegmentsInfo.md b/src/content/docs/api/fabric/namespaces/util/functions/getPathSegmentsInfo.md new file mode 100644 index 000000000..4f3ef4d48 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getPathSegmentsInfo.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "getPathSegmentsInfo" +--- + +> **getPathSegmentsInfo**(`path`): [`TPathSegmentInfo`](/api/type-aliases/tpathsegmentinfo/)[] + +Defined in: [src/util/path/index.ts:682](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L682) + +Run over a parsed and simplified path and extract some information (length of each command and starting point) + +## Parameters + +### path + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +parsed path commands + +## Returns + +[`TPathSegmentInfo`](/api/type-aliases/tpathsegmentinfo/)[] + +path commands information diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getPointOnPath.md b/src/content/docs/api/fabric/namespaces/util/functions/getPointOnPath.md new file mode 100644 index 000000000..154aa4153 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getPointOnPath.md @@ -0,0 +1,30 @@ +--- +editUrl: false +next: false +prev: false +title: "getPointOnPath" +--- + +> **getPointOnPath**(`path`, `distance`, `infos`): `undefined` \| [`TPointAngle`](/api/type-aliases/tpointangle/) + +Defined in: [src/util/path/index.ts:790](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L790) + +Get the point on the path that is distance along the path + +## Parameters + +### path + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +### distance + +`number` + +### infos + +[`TPathSegmentInfo`](/api/type-aliases/tpathsegmentinfo/)[] = `...` + +## Returns + +`undefined` \| [`TPointAngle`](/api/type-aliases/tpointangle/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getPointer.md b/src/content/docs/api/fabric/namespaces/util/functions/getPointer.md new file mode 100644 index 000000000..79f06fd37 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getPointer.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "getPointer" +--- + +> **getPointer**(`event`): [`Point`](/api/classes/point/) + +Defined in: [src/util/dom\_event.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/dom_event.ts#L15) + +## Parameters + +### event + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) + +## Returns + +[`Point`](/api/classes/point/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getRandomInt.md b/src/content/docs/api/fabric/namespaces/util/functions/getRandomInt.md new file mode 100644 index 000000000..3e32ed1a1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getRandomInt.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "getRandomInt" +--- + +> **getRandomInt**(`min`, `max`): `number` + +Defined in: [src/util/internals/getRandomInt.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/internals/getRandomInt.ts#L7) + +Returns random number between 2 specified ones. + +## Parameters + +### min + +`number` + +lower limit + +### max + +`number` + +upper limit + +## Returns + +`number` + +random value (between min and max) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getRegularPolygonPath.md b/src/content/docs/api/fabric/namespaces/util/functions/getRegularPolygonPath.md new file mode 100644 index 000000000..9a73070d1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getRegularPolygonPath.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "getRegularPolygonPath" +--- + +> **getRegularPolygonPath**(`numVertexes`, `radius`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/util/path/index.ts:1005](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L1005) + +Returns an array of path commands to create a regular polygon + +## Parameters + +### numVertexes + +`number` + +### radius + +`number` + +## Returns + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +An array of SVG path commands diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getSmoothPathFromPoints.md b/src/content/docs/api/fabric/namespaces/util/functions/getSmoothPathFromPoints.md new file mode 100644 index 000000000..aef47def1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getSmoothPathFromPoints.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "getSmoothPathFromPoints" +--- + +> **getSmoothPathFromPoints**(`points`, `correction?`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/util/path/index.ts:910](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L910) + +Converts points to a smooth SVG path + +## Parameters + +### points + +[`Point`](/api/classes/point/)[] + +Array of points + +### correction? + +`number` = `0` + +Apply a correction to the path (usually we use `width / 1000`). If value is undefined 0 is used as the correction value. + +## Returns + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +An array of SVG path commands diff --git a/src/content/docs/api/fabric/namespaces/util/functions/getSvgAttributes.md b/src/content/docs/api/fabric/namespaces/util/functions/getSvgAttributes.md new file mode 100644 index 000000000..62eccd506 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/getSvgAttributes.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "getSvgAttributes" +--- + +> **getSvgAttributes**(`type`): `string`[] + +Defined in: [src/util/misc/svgParsing.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/svgParsing.ts#L12) + +Returns array of attributes for given svg that fabric parses + +## Parameters + +### type + +[`SVGElementName`](/api/type-aliases/svgelementname/) + +Type of svg element (eg. 'circle') + +## Returns + +`string`[] + +string names of supported attributes diff --git a/src/content/docs/api/namespaces/util/functions/getUnitVector.md b/src/content/docs/api/fabric/namespaces/util/functions/getUnitVector.md similarity index 56% rename from src/content/docs/api/namespaces/util/functions/getUnitVector.md rename to src/content/docs/api/fabric/namespaces/util/functions/getUnitVector.md index 035909cff..289a21b73 100644 --- a/src/content/docs/api/namespaces/util/functions/getUnitVector.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/getUnitVector.md @@ -7,16 +7,16 @@ title: "getUnitVector" > **getUnitVector**(`v`): [`Point`](/api/classes/point/) +Defined in: [src/util/misc/vectors.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L54) + ## Parameters -• **v**: [`Point`](/api/classes/point/) +### v + +[`Point`](/api/classes/point/) ## Returns [`Point`](/api/classes/point/) vector representing the unit vector pointing to the direction of `v` - -## Defined in - -[src/util/misc/vectors.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L54) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/groupSVGElements.md b/src/content/docs/api/fabric/namespaces/util/functions/groupSVGElements.md new file mode 100644 index 000000000..6ec3bb5e0 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/groupSVGElements.md @@ -0,0 +1,29 @@ +--- +editUrl: false +next: false +prev: false +title: "groupSVGElements" +--- + +> **groupSVGElements**(`elements`, `options?`): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> + +Defined in: [src/util/misc/groupSVGElements.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/groupSVGElements.ts#L11) + +TODO experiment with different layout manager and svg results ( fixed fit content ) +Groups SVG elements (usually those retrieved from SVG document) + +## Parameters + +### elements + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] + +FabricObject(s) parsed from svg, to group + +### options? + +`Partial`\<[`GroupProps`](/api/interfaces/groupprops/)\> + +## Returns + +[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> diff --git a/src/content/docs/api/fabric/namespaces/util/functions/hasStyleChanged.md b/src/content/docs/api/fabric/namespaces/util/functions/hasStyleChanged.md new file mode 100644 index 000000000..d71ce285c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/hasStyleChanged.md @@ -0,0 +1,36 @@ +--- +editUrl: false +next: false +prev: false +title: "hasStyleChanged" +--- + +> **hasStyleChanged**(`prevStyle`, `thisStyle`, `forTextSpans`): `boolean` + +Defined in: [src/util/misc/textStyles.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/textStyles.ts#L21) + +## Parameters + +### prevStyle + +[`TextStyleDeclaration`](/api/type-aliases/textstyledeclaration/) + +first style to compare + +### thisStyle + +[`TextStyleDeclaration`](/api/type-aliases/textstyledeclaration/) + +second style to compare + +### forTextSpans + +`boolean` = `false` + +whether to check overline, underline, and line-through properties + +## Returns + +`boolean` + +true if the style changed diff --git a/src/content/docs/api/namespaces/util/functions/invertTransform.md b/src/content/docs/api/fabric/namespaces/util/functions/invertTransform.md similarity index 52% rename from src/content/docs/api/namespaces/util/functions/invertTransform.md rename to src/content/docs/api/fabric/namespaces/util/functions/invertTransform.md index 6265748fe..048763968 100644 --- a/src/content/docs/api/namespaces/util/functions/invertTransform.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/invertTransform.md @@ -7,9 +7,15 @@ title: "invertTransform" > **invertTransform**(`t`): [`TMat2D`](/api/type-aliases/tmat2d/) +Defined in: [src/util/misc/matrix.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L57) + +Invert transformation t + ## Parameters -• **t**: [`TMat2D`](/api/type-aliases/tmat2d/) +### t + +[`TMat2D`](/api/type-aliases/tmat2d/) The transform @@ -18,7 +24,3 @@ The transform [`TMat2D`](/api/type-aliases/tmat2d/) The inverted transform - -## Defined in - -[src/util/misc/matrix.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L57) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/isBetweenVectors.md b/src/content/docs/api/fabric/namespaces/util/functions/isBetweenVectors.md new file mode 100644 index 000000000..bbcd72fd9 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/isBetweenVectors.md @@ -0,0 +1,40 @@ +--- +editUrl: false +next: false +prev: false +title: "isBetweenVectors" +--- + +> **isBetweenVectors**(`t`, `a`, `b`): `boolean` + +Defined in: [src/util/misc/vectors.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L94) + +Checks if the vector is between two others. It is considered +to be inside when the vector to be tested is between the +initial vector and the final vector (included) in a counterclockwise direction. + +## Parameters + +### t + +[`Point`](/api/classes/point/) + +vector to be tested + +### a + +[`Point`](/api/classes/point/) + +initial vector + +### b + +[`Point`](/api/classes/point/) + +final vector + +## Returns + +`boolean` + +true if the vector is among the others diff --git a/src/content/docs/api/fabric/namespaces/util/functions/isIdentityMatrix.md b/src/content/docs/api/fabric/namespaces/util/functions/isIdentityMatrix.md new file mode 100644 index 000000000..0cee8a96f --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/isIdentityMatrix.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "isIdentityMatrix" +--- + +> **isIdentityMatrix**(`mat`): `boolean` + +Defined in: [src/util/misc/matrix.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L35) + +## Parameters + +### mat + +[`TMat2D`](/api/type-aliases/tmat2d/) + +## Returns + +`boolean` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/isTouchEvent.md b/src/content/docs/api/fabric/namespaces/util/functions/isTouchEvent.md new file mode 100644 index 000000000..7cc662286 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/isTouchEvent.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "isTouchEvent" +--- + +> **isTouchEvent**(`event`): `boolean` + +Defined in: [src/util/dom\_event.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/dom_event.ts#L22) + +## Parameters + +### event + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) + +## Returns + +`boolean` diff --git a/src/content/docs/api/namespaces/util/functions/isTransparent.md b/src/content/docs/api/fabric/namespaces/util/functions/isTransparent.md similarity index 53% rename from src/content/docs/api/namespaces/util/functions/isTransparent.md rename to src/content/docs/api/fabric/namespaces/util/functions/isTransparent.md index de81b5e2c..2fc8f3027 100644 --- a/src/content/docs/api/namespaces/util/functions/isTransparent.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/isTransparent.md @@ -7,21 +7,34 @@ title: "isTransparent" > **isTransparent**(`ctx`, `x`, `y`, `tolerance`): `boolean` +Defined in: [src/util/misc/isTransparent.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/isTransparent.ts#L10) + +Returns true if context has transparent pixel +at specified location (taking tolerance into account) + ## Parameters -• **ctx**: `CanvasRenderingContext2D` +### ctx + +`CanvasRenderingContext2D` context -• **x**: `number` +### x + +`number` x coordinate in canvasElementCoordinate, not fabric space. integer -• **y**: `number` +### y + +`number` y coordinate in canvasElementCoordinate, not fabric space. integer -• **tolerance**: `number` +### tolerance + +`number` Tolerance pixels around the point, not alpha tolerance, integer @@ -30,7 +43,3 @@ Tolerance pixels around the point, not alpha tolerance, integer `boolean` true if transparent - -## Defined in - -[src/util/misc/isTransparent.ts:10](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/isTransparent.ts#L10) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/joinPath.md b/src/content/docs/api/fabric/namespaces/util/functions/joinPath.md new file mode 100644 index 000000000..0b8eb9942 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/joinPath.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "joinPath" +--- + +> **joinPath**(`pathData`, `fractionDigits?`): `string` + +Defined in: [src/util/path/index.ts:1032](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L1032) + +Join path commands to go back to svg format + +## Parameters + +### pathData + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +fabricJS parsed path commands + +### fractionDigits? + +`number` + +number of fraction digits to "leave" + +## Returns + +`string` + +joined path 'M 0 0 L 20 30' diff --git a/src/content/docs/api/fabric/namespaces/util/functions/loadImage.md b/src/content/docs/api/fabric/namespaces/util/functions/loadImage.md new file mode 100644 index 000000000..db82b5a11 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/loadImage.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "loadImage" +--- + +> **loadImage**(`url`, `options?`): `Promise`\<`HTMLImageElement`\> + +Defined in: [src/util/misc/objectEnlive.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectEnlive.ts#L29) + +Loads image element from given url and resolve it, or catch. + +## Parameters + +### url + +`string` + +URL representing an image + +### options? + +[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) = `{}` + +image loading options + +## Returns + +`Promise`\<`HTMLImageElement`\> + +the loaded image. diff --git a/src/content/docs/api/fabric/namespaces/util/functions/magnitude.md b/src/content/docs/api/fabric/namespaces/util/functions/magnitude.md new file mode 100644 index 000000000..04150c44b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/magnitude.md @@ -0,0 +1,22 @@ +--- +editUrl: false +next: false +prev: false +title: "magnitude" +--- + +> **magnitude**(`point`): `number` + +Defined in: [src/util/misc/vectors.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L31) + +return the magnitude of a vector + +## Parameters + +### point + +[`Point`](/api/classes/point/) + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/makeBoundingBoxFromPoints.md b/src/content/docs/api/fabric/namespaces/util/functions/makeBoundingBoxFromPoints.md new file mode 100644 index 000000000..822a64852 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/makeBoundingBoxFromPoints.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "makeBoundingBoxFromPoints" +--- + +> **makeBoundingBoxFromPoints**(`points`): [`TBBox`](/api/type-aliases/tbbox/) + +Defined in: [src/util/misc/boundingBoxFromPoints.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/boundingBoxFromPoints.ts#L9) + +Calculates bounding box (left, top, width, height) from given `points` + +## Parameters + +### points + +[`XY`](/api/interfaces/xy/)[] + +## Returns + +[`TBBox`](/api/type-aliases/tbbox/) + +Object with left, top, width, height properties diff --git a/src/content/docs/api/fabric/namespaces/util/functions/makePathSimpler.md b/src/content/docs/api/fabric/namespaces/util/functions/makePathSimpler.md new file mode 100644 index 000000000..a70cfcce1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/makePathSimpler.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "makePathSimpler" +--- + +> **makePathSimpler**(`path`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/util/path/index.ts:351](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L351) + +This function takes a parsed SVG path and makes it simpler for fabricJS logic. +Simplification consist of: +- All commands converted to absolute (lowercase to uppercase) +- S converted to C +- T converted to Q +- A converted to C + +## Parameters + +### path + +[`TComplexPathData`](/api/type-aliases/tcomplexpathdata/) + +the array of commands of a parsed SVG path for `Path` + +## Returns + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +the simplified array of commands of a parsed SVG path for `Path` +TODO: figure out how to remove the type assertions in a nice way diff --git a/src/content/docs/api/fabric/namespaces/util/functions/matrixToSVG.md b/src/content/docs/api/fabric/namespaces/util/functions/matrixToSVG.md new file mode 100644 index 000000000..7dbafaeec --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/matrixToSVG.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "matrixToSVG" +--- + +> **matrixToSVG**(`transform`): `string` + +Defined in: [src/util/misc/svgExport.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/svgExport.ts#L10) + +given an array of 6 number returns something like `"matrix(...numbers)"` + +## Parameters + +### transform + +[`TMat2D`](/api/type-aliases/tmat2d/) + +an array with 6 numbers + +## Returns + +`string` + +transform matrix for svg diff --git a/src/content/docs/api/fabric/namespaces/util/functions/mergeClipPaths.md b/src/content/docs/api/fabric/namespaces/util/functions/mergeClipPaths.md new file mode 100644 index 000000000..3d9d0260e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/mergeClipPaths.md @@ -0,0 +1,39 @@ +--- +editUrl: false +next: false +prev: false +title: "mergeClipPaths" +--- + +> **mergeClipPaths**(`c1`, `c2`): [`Group`](/api/classes/group/) + +Defined in: [src/util/misc/mergeClipPaths.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/mergeClipPaths.ts#L22) + +Merges 2 clip paths into one visually equal clip path + +**IMPORTANT**:\ +Does **NOT** clone the arguments, clone them proir if necessary. + +Creates a wrapper (group) that contains one clip path and is clipped by the other so content is kept where both overlap. +Use this method if both the clip paths may have nested clip paths of their own, so assigning one to the other's clip path property is not possible. + +In order to handle the `inverted` property we follow logic described in the following cases:\ +**(1)** both clip paths are inverted - the clip paths pass the inverted prop to the wrapper and loose it themselves.\ +**(2)** one is inverted and the other isn't - the wrapper shouldn't become inverted and the inverted clip path must clip the non inverted one to produce an identical visual effect.\ +**(3)** both clip paths are not inverted - wrapper and clip paths remain unchanged. + +## Parameters + +### c1 + +[`FabricObject`](/api/classes/fabricobject/) + +### c2 + +[`FabricObject`](/api/classes/fabricobject/) + +## Returns + +[`Group`](/api/classes/group/) + +merged clip path diff --git a/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrices.md b/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrices.md new file mode 100644 index 000000000..87ab5eca3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrices.md @@ -0,0 +1,38 @@ +--- +editUrl: false +next: false +prev: false +title: "multiplyTransformMatrices" +--- + +> **multiplyTransformMatrices**(`a`, `b`, `is2x2?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L73) + +Multiply matrix A by matrix B to nest transformations + +## Parameters + +### a + +[`TMat2D`](/api/type-aliases/tmat2d/) + +First transformMatrix + +### b + +[`TMat2D`](/api/type-aliases/tmat2d/) + +Second transformMatrix + +### is2x2? + +`boolean` + +flag to multiply matrices as 2x2 matrices + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +The product of the two transform matrices diff --git a/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrixArray.md b/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrixArray.md new file mode 100644 index 000000000..6f1840b3d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/multiplyTransformMatrixArray.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "multiplyTransformMatrixArray" +--- + +> **multiplyTransformMatrixArray**(`matrices`, `is2x2?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/matrix.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L96) + +Multiplies the matrices array such that a matrix defines the plane for the rest of the matrices **after** it + +`multiplyTransformMatrixArray([A, B, C, D])` is equivalent to `A(B(C(D)))` + +## Parameters + +### matrices + +(`undefined` \| `null` \| `false` \| [`TMat2D`](/api/type-aliases/tmat2d/))[] + +an array of matrices + +### is2x2? + +`boolean` + +flag to multiply matrices as 2x2 matrices + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +the multiplication product diff --git a/src/content/docs/api/fabric/namespaces/util/functions/parsePath.md b/src/content/docs/api/fabric/namespaces/util/functions/parsePath.md new file mode 100644 index 000000000..2c367591a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/parsePath.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "parsePath" +--- + +> **parsePath**(`pathString`): [`TComplexPathData`](/api/type-aliases/tcomplexpathdata/) + +Defined in: [src/util/path/index.ts:857](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L857) + +## Parameters + +### pathString + +`string` + +## Returns + +[`TComplexPathData`](/api/type-aliases/tcomplexpathdata/) + +An array of SVG path commands + +## Example + +```ts +parsePath('M 3 4 Q 3 5 2 1 4 0 Q 9 12 2 1 4 0') === [ + ['M', 3, 4], + ['Q', 3, 5, 2, 1, 4, 0], + ['Q', 9, 12, 2, 1, 4, 0], +]; +``` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/parsePreserveAspectRatioAttribute.md b/src/content/docs/api/fabric/namespaces/util/functions/parsePreserveAspectRatioAttribute.md new file mode 100644 index 000000000..61ef4251a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/parsePreserveAspectRatioAttribute.md @@ -0,0 +1,27 @@ +--- +editUrl: false +next: false +prev: false +title: "parsePreserveAspectRatioAttribute" +--- + +> **parsePreserveAspectRatioAttribute**(`attribute`): `TPreserveArParsed` + +Defined in: [src/util/misc/svgParsing.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/svgParsing.ts#L103) + +Parse preserveAspectRatio attribute from element +https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio + +## Parameters + +### attribute + +`string` + +to be parsed + +## Returns + +`TPreserveArParsed` + +an object containing align and meetOrSlice attribute diff --git a/src/content/docs/api/fabric/namespaces/util/functions/parseUnit.md b/src/content/docs/api/fabric/namespaces/util/functions/parseUnit.md new file mode 100644 index 000000000..acd2bb911 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/parseUnit.md @@ -0,0 +1,29 @@ +--- +editUrl: false +next: false +prev: false +title: "parseUnit" +--- + +> **parseUnit**(`value`, `fontSize`): `number` + +Defined in: [src/util/misc/svgParsing.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/svgParsing.ts#L48) + +Converts from attribute value to pixel value if applicable. +Returns converted pixels or original value not converted. + +## Parameters + +### value + +`string` + +number to operate on + +### fontSize + +`number` = `DEFAULT_SVG_FONT_SIZE` + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/pick.md b/src/content/docs/api/fabric/namespaces/util/functions/pick.md new file mode 100644 index 000000000..97024d28d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/pick.md @@ -0,0 +1,36 @@ +--- +editUrl: false +next: false +prev: false +title: "pick" +--- + +> **pick**\<`T`\>(`source`, `keys`): `Partial`\<`T`\> + +Defined in: [src/util/misc/pick.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/pick.ts#L7) + +Populates an object with properties of another object + +## Type Parameters + +### T + +`T` *extends* `Record`\<`string`, `any`\> + +## Parameters + +### source + +`T` + +Source object + +### keys + +keyof `T`[] = `[]` + +## Returns + +`Partial`\<`T`\> + +object populated with the picked keys diff --git a/src/content/docs/api/fabric/namespaces/util/functions/projectStrokeOnPoints.md b/src/content/docs/api/fabric/namespaces/util/functions/projectStrokeOnPoints.md new file mode 100644 index 000000000..2f77da4b1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/projectStrokeOnPoints.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "projectStrokeOnPoints" +--- + +> **projectStrokeOnPoints**(`points`, `options`, `openPath`): [`TProjection`](/api/fabric/namespaces/util/type-aliases/tprojection/)[] + +Defined in: [src/util/misc/projectStroke/index.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/index.ts#L16) + +Used to calculate object's bounding box + +## Parameters + +### points + +[`XY`](/api/interfaces/xy/)[] + +### options + +[`TProjectStrokeOnPointsOptions`](/api/fabric/namespaces/util/type-aliases/tprojectstrokeonpointsoptions/) + +### openPath + +`boolean` = `false` + +## Returns + +[`TProjection`](/api/fabric/namespaces/util/type-aliases/tprojection/)[] + +## See + +https://github.com/fabricjs/fabric.js/pull/8344 diff --git a/src/content/docs/api/fabric/namespaces/util/functions/qrDecompose.md b/src/content/docs/api/fabric/namespaces/util/functions/qrDecompose.md new file mode 100644 index 000000000..d2c235190 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/qrDecompose.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "qrDecompose" +--- + +> **qrDecompose**(`a`): [`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/) + +Defined in: [src/util/misc/matrix.ts:116](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L116) + +Decomposes standard 2x3 matrix into transform components + +## Parameters + +### a + +[`TMat2D`](/api/type-aliases/tmat2d/) + +transformMatrix + +## Returns + +[`TQrDecomposeOut`](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/) + +Components of transform diff --git a/src/content/docs/api/fabric/namespaces/util/functions/radiansToDegrees.md b/src/content/docs/api/fabric/namespaces/util/functions/radiansToDegrees.md new file mode 100644 index 000000000..03d54ae18 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/radiansToDegrees.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "radiansToDegrees" +--- + +> **radiansToDegrees**(`radians`): [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/radiansDegreesConversion.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/radiansDegreesConversion.ts#L17) + +Transforms radians to degrees. + +## Parameters + +### radians + +[`TRadian`](/api/type-aliases/tradian/) + +value in radians + +## Returns + +[`TDegree`](/api/type-aliases/tdegree/) + +value in degrees diff --git a/src/content/docs/api/fabric/namespaces/util/functions/removeFromArray.md b/src/content/docs/api/fabric/namespaces/util/functions/removeFromArray.md new file mode 100644 index 000000000..688b7a25e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/removeFromArray.md @@ -0,0 +1,35 @@ +--- +editUrl: false +next: false +prev: false +title: "removeFromArray" +--- + +> **removeFromArray**\<`T`\>(`array`, `value`): `T`[] + +Defined in: [src/util/internals/removeFromArray.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/internals/removeFromArray.ts#L8) + +Removes value from an array. +Presence of value (and its position in an array) is determined via `Array.prototype.indexOf` + +## Type Parameters + +### T + +`T` + +## Parameters + +### array + +`T`[] + +### value + +`T` + +## Returns + +`T`[] + +original array diff --git a/src/content/docs/api/namespaces/util/functions/removeTransformFromObject.md b/src/content/docs/api/fabric/namespaces/util/functions/removeTransformFromObject.md similarity index 62% rename from src/content/docs/api/namespaces/util/functions/removeTransformFromObject.md rename to src/content/docs/api/fabric/namespaces/util/functions/removeTransformFromObject.md index 139ed798c..fef5d517f 100644 --- a/src/content/docs/api/namespaces/util/functions/removeTransformFromObject.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/removeTransformFromObject.md @@ -7,6 +7,8 @@ title: "removeTransformFromObject" > **removeTransformFromObject**(`object`, `transform`): `void` +Defined in: [src/util/misc/objectTransforms.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L23) + given an object and a transform, apply the inverse transform to the object, this is equivalent to remove from that object that transformation, so that added in a space with the removed transform, the object will be the same as before. @@ -17,18 +19,18 @@ This util is used to add objects inside transformed groups or nested groups. ## Parameters -• **object**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +### object + +[`BaseFabricObject`](/api/classes/basefabricobject/) the object you want to transform -• **transform**: [`TMat2D`](/api/type-aliases/tmat2d/) +### transform + +[`TMat2D`](/api/type-aliases/tmat2d/) the destination transform ## Returns `void` - -## Defined in - -[src/util/misc/objectTransforms.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L23) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/requestAnimFrame.md b/src/content/docs/api/fabric/namespaces/util/functions/requestAnimFrame.md new file mode 100644 index 000000000..b1d6e0b8b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/requestAnimFrame.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "requestAnimFrame" +--- + +> **requestAnimFrame**(`callback`): `number` + +Defined in: [src/util/animation/AnimationFrameProvider.ts:3](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/AnimationFrameProvider.ts#L3) + +## Parameters + +### callback + +`FrameRequestCallback` + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/resetObjectTransform.md b/src/content/docs/api/fabric/namespaces/util/functions/resetObjectTransform.md new file mode 100644 index 000000000..bd925644e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/resetObjectTransform.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "resetObjectTransform" +--- + +> **resetObjectTransform**(`target`): `void` + +Defined in: [src/util/misc/objectTransforms.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L71) + +reset an object transform state to neutral. Top and left are not accounted for + +## Parameters + +### target + +[`BaseFabricObject`](/api/classes/basefabricobject/) + +object to transform + +## Returns + +`void` diff --git a/src/content/docs/api/namespaces/util/functions/rotateVector.md b/src/content/docs/api/fabric/namespaces/util/functions/rotateVector.md similarity index 51% rename from src/content/docs/api/namespaces/util/functions/rotateVector.md rename to src/content/docs/api/fabric/namespaces/util/functions/rotateVector.md index 1c9c4fb36..70470624a 100644 --- a/src/content/docs/api/namespaces/util/functions/rotateVector.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/rotateVector.md @@ -7,13 +7,21 @@ title: "rotateVector" > **rotateVector**(`vector`, `radians`): [`Point`](/api/classes/point/) +Defined in: [src/util/misc/vectors.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/vectors.ts#L14) + +Rotates `vector` with `radians` + ## Parameters -• **vector**: [`Point`](/api/classes/point/) +### vector + +[`Point`](/api/classes/point/) The vector to rotate (x and y) -• **radians**: [`TRadian`](/api/type-aliases/tradian/) +### radians + +[`TRadian`](/api/type-aliases/tradian/) The radians of the angle for the rotation @@ -22,7 +30,3 @@ The radians of the angle for the rotation [`Point`](/api/classes/point/) The new rotated point - -## Defined in - -[src/util/misc/vectors.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L14) diff --git a/src/content/docs/api/namespaces/util/functions/saveObjectTransform.md b/src/content/docs/api/fabric/namespaces/util/functions/saveObjectTransform.md similarity index 64% rename from src/content/docs/api/namespaces/util/functions/saveObjectTransform.md rename to src/content/docs/api/fabric/namespaces/util/functions/saveObjectTransform.md index 8b0ef1f38..97fe5e6d2 100644 --- a/src/content/docs/api/namespaces/util/functions/saveObjectTransform.md +++ b/src/content/docs/api/fabric/namespaces/util/functions/saveObjectTransform.md @@ -7,9 +7,15 @@ title: "saveObjectTransform" > **saveObjectTransform**(`target`): `object` +Defined in: [src/util/misc/objectTransforms.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L86) + +Extract Object transform values + ## Parameters -• **target**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +### target + +[`BaseFabricObject`](/api/classes/basefabricobject/) object to read from @@ -54,7 +60,3 @@ Components of transform ### top > **top**: `number` = `target.top` - -## Defined in - -[src/util/misc/objectTransforms.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L86) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/sendObjectToPlane.md b/src/content/docs/api/fabric/namespaces/util/functions/sendObjectToPlane.md new file mode 100644 index 000000000..fda63d597 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/sendObjectToPlane.md @@ -0,0 +1,61 @@ +--- +editUrl: false +next: false +prev: false +title: "sendObjectToPlane" +--- + +> **sendObjectToPlane**(`object`, `from?`, `to?`): [`TMat2D`](/api/type-aliases/tmat2d/) + +Defined in: [src/util/misc/planeChange.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/planeChange.ts#L81) + +A util that abstracts applying transform to objects.\ +Sends `object` to the destination coordinate plane by applying the relevant transformations.\ +Changes the space/plane where `object` is drawn.\ +From the canvas/viewer's perspective `object` remains unchanged. + +## Parameters + +### object + +[`BaseFabricObject`](/api/classes/basefabricobject/) + +### from? + +[`TMat2D`](/api/type-aliases/tmat2d/) + +plane matrix containing object. Passing `undefined` is equivalent to passing the identity matrix, which means `object` is a direct child of canvas. + +### to? + +[`TMat2D`](/api/type-aliases/tmat2d/) + +destination plane matrix to contain object. Passing `undefined` means `object` should be sent to the canvas coordinate plane. + +## Returns + +[`TMat2D`](/api/type-aliases/tmat2d/) + +the transform matrix that was applied to `object` + +## Examples + +```ts +let obj, obj2; +let clipPath = new Circle({ radius: 50 }); +obj.clipPath = clipPath; +// render +sendObjectToPlane(clipPath, obj.calcTransformMatrix(), obj2.calcTransformMatrix()); +obj.clipPath = undefined; +obj2.clipPath = clipPath; +// render, clipPath now clips obj2 but seems unchanged from the eyes of the viewer +``` + +```ts +let obj, existingObj; +let clipPath = new Circle({ radius: 50 }); +obj.clipPath = clipPath; +let transformTo = multiplyTransformMatrices(obj.calcTransformMatrix(), clipPath.calcTransformMatrix()); +sendObjectToPlane(existingObj, existingObj.group?.calcTransformMatrix(), transformTo); +clipPath.clipPath = existingObj; +``` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/sendPointToPlane.md b/src/content/docs/api/fabric/namespaces/util/functions/sendPointToPlane.md new file mode 100644 index 000000000..e0d00ebdc --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/sendPointToPlane.md @@ -0,0 +1,47 @@ +--- +editUrl: false +next: false +prev: false +title: "sendPointToPlane" +--- + +> **sendPointToPlane**(`point`, `from?`, `to?`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/planeChange.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/planeChange.ts#L36) + +Sends a point from the source coordinate plane to the destination coordinate plane.\ +From the canvas/viewer's perspective the point remains unchanged. + +## Parameters + +### point + +[`Point`](/api/classes/point/) + +### from? + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +plane matrix containing object. Passing `undefined` is equivalent to passing the identity matrix, which means `point` exists in the canvas coordinate plane. + +### to? + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +destination plane matrix to contain object. Passing `undefined` means `point` should be sent to the canvas coordinate plane. + +## Returns + +[`Point`](/api/classes/point/) + +transformed point + +## Example + +```ts +var obj = new Rect({ left: 20, top: 20, width: 60, height: 60, strokeWidth: 0 }); +var group = new Group([obj], { strokeWidth: 0 }); +var sentPoint1 = sendPointToPlane(new Point(50, 50), undefined, group.calcTransformMatrix()); +var sentPoint2 = sendPointToPlane(new Point(50, 50), iMatrix, group.calcTransformMatrix()); +console.log(sentPoint1, sentPoint2) // both points print (0,0) which is the center of group +``` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/sendVectorToPlane.md b/src/content/docs/api/fabric/namespaces/util/functions/sendVectorToPlane.md new file mode 100644 index 000000000..a2fff2b7e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/sendVectorToPlane.md @@ -0,0 +1,30 @@ +--- +editUrl: false +next: false +prev: false +title: "sendVectorToPlane" +--- + +> **sendVectorToPlane**(`point`, `from`, `to`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/planeChange.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/planeChange.ts#L45) + +See [sendPointToPlane](/api/fabric/namespaces/util/functions/sendpointtoplane/) + +## Parameters + +### point + +[`Point`](/api/classes/point/) + +### from + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +### to + +[`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` + +## Returns + +[`Point`](/api/classes/point/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/sin.md b/src/content/docs/api/fabric/namespaces/util/functions/sin.md new file mode 100644 index 000000000..63f5bbaa1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/sin.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "sin" +--- + +> **sin**(`angle`): `number` + +Defined in: [src/util/misc/sin.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/sin.ts#L11) + +Calculate the cos of an angle, avoiding returning floats for known results +This function is here just to avoid getting 0.999999999999999 when dealing +with numbers that are really 1 or 0. + +## Parameters + +### angle + +[`TRadian`](/api/type-aliases/tradian/) + +the angle + +## Returns + +`number` + +the sin value for angle. diff --git a/src/content/docs/api/fabric/namespaces/util/functions/sizeAfterTransform.md b/src/content/docs/api/fabric/namespaces/util/functions/sizeAfterTransform.md new file mode 100644 index 000000000..1498e69a5 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/sizeAfterTransform.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "sizeAfterTransform" +--- + +> **sizeAfterTransform**(`width`, `height`, `t`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/objectTransforms.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectTransforms.ts#L107) + +given a width and height, return the size of the bounding box +that can contains the box with width/height with applied transform. +Use to calculate the boxes around objects for controls. + +## Parameters + +### width + +`number` + +### height + +`number` + +### t + +[`TMat2D`](/api/type-aliases/tmat2d/) + +## Returns + +[`Point`](/api/classes/point/) + +size diff --git a/src/content/docs/api/fabric/namespaces/util/functions/stylesFromArray.md b/src/content/docs/api/fabric/namespaces/util/functions/stylesFromArray.md new file mode 100644 index 000000000..d50109d60 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/stylesFromArray.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "stylesFromArray" +--- + +> **stylesFromArray**(`styles`, `text`): [`TextStyle`](/api/type-aliases/textstyle/) + +Defined in: [src/util/misc/textStyles.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/textStyles.ts#L100) + +Returns the object form of the styles property with styles that are assigned per +character rather than grouped by range. This format is more verbose, and is +only used during runtime (not for serialization/storage) + +## Parameters + +### styles + +the serialized form of a text object's styles + +[`TextStyle`](/api/type-aliases/textstyle/) | [`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) + +### text + +`string` + +the text string that the styles are applied to + +## Returns + +[`TextStyle`](/api/type-aliases/textstyle/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/stylesToArray.md b/src/content/docs/api/fabric/namespaces/util/functions/stylesToArray.md new file mode 100644 index 000000000..74dc6a977 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/stylesToArray.md @@ -0,0 +1,32 @@ +--- +editUrl: false +next: false +prev: false +title: "stylesToArray" +--- + +> **stylesToArray**(`styles`, `text`): [`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) + +Defined in: [src/util/misc/textStyles.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/textStyles.ts#L49) + +Returns the array form of a text object's inline styles property with styles grouped in ranges +rather than per character. This format is less verbose, and is better suited for storage +so it is used in serialization (not during runtime). + +## Parameters + +### styles + +[`TextStyle`](/api/type-aliases/textstyle/) + +per character styles for a text object + +### text + +`string` + +the text string that the styles are applied to + +## Returns + +[`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) diff --git a/src/content/docs/api/fabric/namespaces/util/functions/toBlob.md b/src/content/docs/api/fabric/namespaces/util/functions/toBlob.md new file mode 100644 index 000000000..7d07213f4 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/toBlob.md @@ -0,0 +1,28 @@ +--- +editUrl: false +next: false +prev: false +title: "toBlob" +--- + +> **toBlob**(`canvasEl`, `format?`, `quality?`): `Promise`\<`null` \| `Blob`\> + +Defined in: [src/util/misc/dom.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/dom.ts#L70) + +## Parameters + +### canvasEl + +`HTMLCanvasElement` + +### format? + +[`ImageFormat`](/api/type-aliases/imageformat/) + +### quality? + +`number` + +## Returns + +`Promise`\<`null` \| `Blob`\> diff --git a/src/content/docs/api/fabric/namespaces/util/functions/toDataURL.md b/src/content/docs/api/fabric/namespaces/util/functions/toDataURL.md new file mode 100644 index 000000000..bd1398af4 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/toDataURL.md @@ -0,0 +1,39 @@ +--- +editUrl: false +next: false +prev: false +title: "toDataURL" +--- + +> **toDataURL**(`canvasEl`, `format`, `quality`): `string` + +Defined in: [src/util/misc/dom.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/dom.ts#L58) + +since 2.6.0 moved from canvas instance to utility. +possibly useless + +## Parameters + +### canvasEl + +`HTMLCanvasElement` + +to copy size and content of + +### format + +[`ImageFormat`](/api/type-aliases/imageformat/) + +'jpeg' or 'png', in some browsers 'webp' is ok too + +### quality + +`number` + +<= 1 and > 0 + +## Returns + +`string` + +data url diff --git a/src/content/docs/api/fabric/namespaces/util/functions/toFixed.md b/src/content/docs/api/fabric/namespaces/util/functions/toFixed.md new file mode 100644 index 000000000..a35655315 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/toFixed.md @@ -0,0 +1,30 @@ +--- +editUrl: false +next: false +prev: false +title: "toFixed" +--- + +> **toFixed**(`number`, `fractionDigits`): `number` + +Defined in: [src/util/misc/toFixed.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/toFixed.ts#L7) + +A wrapper around Number#toFixed, which contrary to native method returns number, not string. + +## Parameters + +### number + +number to operate on + +`string` | `number` + +### fractionDigits + +`number` + +number of fraction digits to "leave" + +## Returns + +`number` diff --git a/src/content/docs/api/fabric/namespaces/util/functions/transformPath.md b/src/content/docs/api/fabric/namespaces/util/functions/transformPath.md new file mode 100644 index 000000000..a84fd6e0c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/transformPath.md @@ -0,0 +1,40 @@ +--- +editUrl: false +next: false +prev: false +title: "transformPath" +--- + +> **transformPath**(`path`, `transform`, `pathOffset?`): [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/util/path/index.ts:966](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/index.ts#L966) + +Transform a path by transforming each segment. +it has to be a simplified path or it won't work. +WARNING: this depends from pathOffset for correct operation + +## Parameters + +### path + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +fabricJS parsed and simplified path commands + +### transform + +[`TMat2D`](/api/type-aliases/tmat2d/) + +matrix that represent the transformation + +### pathOffset? + +[`Point`](/api/classes/point/) + +`Path.pathOffset` + +## Returns + +[`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +the transformed path diff --git a/src/content/docs/api/fabric/namespaces/util/functions/transformPoint.md b/src/content/docs/api/fabric/namespaces/util/functions/transformPoint.md new file mode 100644 index 000000000..253ee5365 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/functions/transformPoint.md @@ -0,0 +1,42 @@ +--- +editUrl: false +next: false +prev: false +title: "transformPoint" +--- + +> **transformPoint**(`p`, `t`, `ignoreOffset?`): [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/matrix.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L46) + +Apply transform t to point p + +:::caution[Deprecated] +use [Point#transform](/api/classes/point/#transform) +::: + +## Parameters + +### p + +[`XY`](/api/interfaces/xy/) + +The point to transform + +### t + +[`TMat2D`](/api/type-aliases/tmat2d/) + +The transform + +### ignoreOffset? + +`boolean` + +Indicates that the offset should not be applied + +## Returns + +[`Point`](/api/classes/point/) + +The transformed point diff --git a/src/content/docs/api/fabric/namespaces/util/index.md b/src/content/docs/api/fabric/namespaces/util/index.md new file mode 100644 index 000000000..4f674126e --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/index.md @@ -0,0 +1,443 @@ +--- +editUrl: false +next: false +prev: false +title: "util" +--- + +## Namespaces + +- [ease](/api/fabric/namespaces/util/namespaces/ease/index/) +- [string](/api/fabric/namespaces/util/namespaces/string/index/) + +## Type Aliases + +- [AnimationOptions](/api/fabric/namespaces/util/type-aliases/animationoptions/) +- [AnimationState](/api/fabric/namespaces/util/type-aliases/animationstate/) +- [ArrayAnimationOptions](/api/fabric/namespaces/util/type-aliases/arrayanimationoptions/) +- [ColorAnimationOptions](/api/fabric/namespaces/util/type-aliases/coloranimationoptions/) +- [EnlivenObjectOptions](/api/fabric/namespaces/util/type-aliases/enlivenobjectoptions/) +- [LoadImageOptions](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) +- [TAbortCallback](/api/fabric/namespaces/util/type-aliases/tabortcallback/) +- [TAnimation](/api/fabric/namespaces/util/type-aliases/tanimation/) +- [TAnimationBaseOptions](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/) +- [TAnimationCallbacks](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/) +- [TAnimationOptions](/api/fabric/namespaces/util/type-aliases/tanimationoptions/) +- [TBaseAnimationOptions](/api/fabric/namespaces/util/type-aliases/tbaseanimationoptions/) +- [TComposeMatrixArgs](/api/fabric/namespaces/util/type-aliases/tcomposematrixargs/) +- [TEasingFunction](/api/fabric/namespaces/util/type-aliases/teasingfunction/) +- [TextStyleArray](/api/fabric/namespaces/util/type-aliases/textstylearray/) +- [TOnAnimationChangeCallback](/api/fabric/namespaces/util/type-aliases/tonanimationchangecallback/) +- [TProjection](/api/fabric/namespaces/util/type-aliases/tprojection/) +- [TProjectStrokeOnPointsOptions](/api/fabric/namespaces/util/type-aliases/tprojectstrokeonpointsoptions/) +- [TQrDecomposeOut](/api/fabric/namespaces/util/type-aliases/tqrdecomposeout/) +- [TRotateMatrixArgs](/api/fabric/namespaces/util/type-aliases/trotatematrixargs/) +- [TScaleMatrixArgs](/api/fabric/namespaces/util/type-aliases/tscalematrixargs/) +- [TTranslateMatrixArgs](/api/fabric/namespaces/util/type-aliases/ttranslatematrixargs/) +- [ValueAnimationOptions](/api/fabric/namespaces/util/type-aliases/valueanimationoptions/) + +## Functions + +- [addTransformToObject](/api/fabric/namespaces/util/functions/addtransformtoobject/) +- [animate](/api/fabric/namespaces/util/functions/animate/) +- [animateColor](/api/fabric/namespaces/util/functions/animatecolor/) +- [applyTransformToObject](/api/fabric/namespaces/util/functions/applytransformtoobject/) +- [calcAngleBetweenVectors](/api/fabric/namespaces/util/functions/calcanglebetweenvectors/) +- [calcDimensionsMatrix](/api/fabric/namespaces/util/functions/calcdimensionsmatrix/) +- [calcPlaneChangeMatrix](/api/fabric/namespaces/util/functions/calcplanechangematrix/) +- [calcVectorRotation](/api/fabric/namespaces/util/functions/calcvectorrotation/) +- [cancelAnimFrame](/api/fabric/namespaces/util/functions/cancelanimframe/) +- [capValue](/api/fabric/namespaces/util/functions/capvalue/) +- [composeMatrix](/api/fabric/namespaces/util/functions/composematrix/) +- [copyCanvasElement](/api/fabric/namespaces/util/functions/copycanvaselement/) +- [cos](/api/fabric/namespaces/util/functions/cos/) +- [createCanvasElement](/api/fabric/namespaces/util/functions/createcanvaselement/) +- [createImage](/api/fabric/namespaces/util/functions/createimage/) +- [createRotateMatrix](/api/fabric/namespaces/util/functions/createrotatematrix/) +- [createScaleMatrix](/api/fabric/namespaces/util/functions/createscalematrix/) +- [createSkewXMatrix](/api/fabric/namespaces/util/functions/createskewxmatrix/) +- [createSkewYMatrix](/api/fabric/namespaces/util/functions/createskewymatrix/) +- [createTranslateMatrix](/api/fabric/namespaces/util/functions/createtranslatematrix/) +- [createVector](/api/fabric/namespaces/util/functions/createvector/) +- [crossProduct](/api/fabric/namespaces/util/functions/crossproduct/) +- [degreesToRadians](/api/fabric/namespaces/util/functions/degreestoradians/) +- [dotProduct](/api/fabric/namespaces/util/functions/dotproduct/) +- [enlivenObjectEnlivables](/api/fabric/namespaces/util/functions/enlivenobjectenlivables/) +- [enlivenObjects](/api/fabric/namespaces/util/functions/enlivenobjects/) +- [findScaleToCover](/api/fabric/namespaces/util/functions/findscaletocover/) +- [findScaleToFit](/api/fabric/namespaces/util/functions/findscaletofit/) +- [getBoundsOfCurve](/api/fabric/namespaces/util/functions/getboundsofcurve/) +- [getOrthonormalVector](/api/fabric/namespaces/util/functions/getorthonormalvector/) +- [getPathSegmentsInfo](/api/fabric/namespaces/util/functions/getpathsegmentsinfo/) +- [getPointer](/api/fabric/namespaces/util/functions/getpointer/) +- [getPointOnPath](/api/fabric/namespaces/util/functions/getpointonpath/) +- [getRandomInt](/api/fabric/namespaces/util/functions/getrandomint/) +- [getRegularPolygonPath](/api/fabric/namespaces/util/functions/getregularpolygonpath/) +- [getSmoothPathFromPoints](/api/fabric/namespaces/util/functions/getsmoothpathfrompoints/) +- [getSvgAttributes](/api/fabric/namespaces/util/functions/getsvgattributes/) +- [getUnitVector](/api/fabric/namespaces/util/functions/getunitvector/) +- [groupSVGElements](/api/fabric/namespaces/util/functions/groupsvgelements/) +- [hasStyleChanged](/api/fabric/namespaces/util/functions/hasstylechanged/) +- [invertTransform](/api/fabric/namespaces/util/functions/inverttransform/) +- [isBetweenVectors](/api/fabric/namespaces/util/functions/isbetweenvectors/) +- [isIdentityMatrix](/api/fabric/namespaces/util/functions/isidentitymatrix/) +- [isTouchEvent](/api/fabric/namespaces/util/functions/istouchevent/) +- [isTransparent](/api/fabric/namespaces/util/functions/istransparent/) +- [joinPath](/api/fabric/namespaces/util/functions/joinpath/) +- [loadImage](/api/fabric/namespaces/util/functions/loadimage/) +- [magnitude](/api/fabric/namespaces/util/functions/magnitude/) +- [makeBoundingBoxFromPoints](/api/fabric/namespaces/util/functions/makeboundingboxfrompoints/) +- [makePathSimpler](/api/fabric/namespaces/util/functions/makepathsimpler/) +- [matrixToSVG](/api/fabric/namespaces/util/functions/matrixtosvg/) +- [mergeClipPaths](/api/fabric/namespaces/util/functions/mergeclippaths/) +- [multiplyTransformMatrices](/api/fabric/namespaces/util/functions/multiplytransformmatrices/) +- [multiplyTransformMatrixArray](/api/fabric/namespaces/util/functions/multiplytransformmatrixarray/) +- [parsePath](/api/fabric/namespaces/util/functions/parsepath/) +- [parsePreserveAspectRatioAttribute](/api/fabric/namespaces/util/functions/parsepreserveaspectratioattribute/) +- [parseUnit](/api/fabric/namespaces/util/functions/parseunit/) +- [pick](/api/fabric/namespaces/util/functions/pick/) +- [projectStrokeOnPoints](/api/fabric/namespaces/util/functions/projectstrokeonpoints/) +- [qrDecompose](/api/fabric/namespaces/util/functions/qrdecompose/) +- [radiansToDegrees](/api/fabric/namespaces/util/functions/radianstodegrees/) +- [removeFromArray](/api/fabric/namespaces/util/functions/removefromarray/) +- [removeTransformFromObject](/api/fabric/namespaces/util/functions/removetransformfromobject/) +- [requestAnimFrame](/api/fabric/namespaces/util/functions/requestanimframe/) +- [resetObjectTransform](/api/fabric/namespaces/util/functions/resetobjecttransform/) +- [rotateVector](/api/fabric/namespaces/util/functions/rotatevector/) +- [saveObjectTransform](/api/fabric/namespaces/util/functions/saveobjecttransform/) +- [sendObjectToPlane](/api/fabric/namespaces/util/functions/sendobjecttoplane/) +- [sendPointToPlane](/api/fabric/namespaces/util/functions/sendpointtoplane/) +- [sendVectorToPlane](/api/fabric/namespaces/util/functions/sendvectortoplane/) +- [sin](/api/fabric/namespaces/util/functions/sin/) +- [sizeAfterTransform](/api/fabric/namespaces/util/functions/sizeaftertransform/) +- [stylesFromArray](/api/fabric/namespaces/util/functions/stylesfromarray/) +- [stylesToArray](/api/fabric/namespaces/util/functions/stylestoarray/) +- [toBlob](/api/fabric/namespaces/util/functions/toblob/) +- [toDataURL](/api/fabric/namespaces/util/functions/todataurl/) +- [toFixed](/api/fabric/namespaces/util/functions/tofixed/) +- [transformPath](/api/fabric/namespaces/util/functions/transformpath/) +- [~~transformPoint~~](/api/fabric/namespaces/util/functions/transformpoint/) + +## References + +### TArcCommand + +Re-exports [TArcCommand](/api/type-aliases/tarccommand/) + +*** + +### TArcCommandSingleFlag + +Re-exports [TArcCommandSingleFlag](/api/type-aliases/tarccommandsingleflag/) + +*** + +### TClosePathCommand + +Re-exports [TClosePathCommand](/api/type-aliases/tclosepathcommand/) + +*** + +### TComplexParsedCommand + +Re-exports [TComplexParsedCommand](/api/type-aliases/tcomplexparsedcommand/) + +*** + +### TComplexParsedCommandType + +Re-exports [TComplexParsedCommandType](/api/type-aliases/tcomplexparsedcommandtype/) + +*** + +### TComplexPathData + +Re-exports [TComplexPathData](/api/type-aliases/tcomplexpathdata/) + +*** + +### TCubicCurveCommand + +Re-exports [TCubicCurveCommand](/api/type-aliases/tcubiccurvecommand/) + +*** + +### TCubicCurveShortcutCommand + +Re-exports [TCubicCurveShortcutCommand](/api/type-aliases/tcubiccurveshortcutcommand/) + +*** + +### TCurveInfo + +Re-exports [TCurveInfo](/api/type-aliases/tcurveinfo/) + +*** + +### TEndPathInfo + +Re-exports [TEndPathInfo](/api/type-aliases/tendpathinfo/) + +*** + +### THorizontalLineCommand + +Re-exports [THorizontalLineCommand](/api/type-aliases/thorizontallinecommand/) + +*** + +### TLineCommand + +Re-exports [TLineCommand](/api/type-aliases/tlinecommand/) + +*** + +### TMoveToCommand + +Re-exports [TMoveToCommand](/api/type-aliases/tmovetocommand/) + +*** + +### TParsedAbsoluteArcCommand + +Re-exports [TParsedAbsoluteArcCommand](/api/type-aliases/tparsedabsolutearccommand/) + +*** + +### TParsedAbsoluteClosePathCommand + +Re-exports [TParsedAbsoluteClosePathCommand](/api/type-aliases/tparsedabsoluteclosepathcommand/) + +*** + +### TParsedAbsoluteCubicCurveCommand + +Re-exports [TParsedAbsoluteCubicCurveCommand](/api/type-aliases/tparsedabsolutecubiccurvecommand/) + +*** + +### TParsedAbsoluteCubicCurveShortcutCommand + +Re-exports [TParsedAbsoluteCubicCurveShortcutCommand](/api/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) + +*** + +### TParsedAbsoluteHorizontalLineCommand + +Re-exports [TParsedAbsoluteHorizontalLineCommand](/api/type-aliases/tparsedabsolutehorizontallinecommand/) + +*** + +### TParsedAbsoluteLineCommand + +Re-exports [TParsedAbsoluteLineCommand](/api/type-aliases/tparsedabsolutelinecommand/) + +*** + +### TParsedAbsoluteMoveToCommand + +Re-exports [TParsedAbsoluteMoveToCommand](/api/type-aliases/tparsedabsolutemovetocommand/) + +*** + +### TParsedAbsoluteQuadraticCurveCommand + +Re-exports [TParsedAbsoluteQuadraticCurveCommand](/api/type-aliases/tparsedabsolutequadraticcurvecommand/) + +*** + +### TParsedAbsoluteQuadraticCurveShortcutCommand + +Re-exports [TParsedAbsoluteQuadraticCurveShortcutCommand](/api/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) + +*** + +### TParsedAbsoluteVerticalLineCommand + +Re-exports [TParsedAbsoluteVerticalLineCommand](/api/type-aliases/tparsedabsoluteverticallinecommand/) + +*** + +### TParsedArcCommand + +Re-exports [TParsedArcCommand](/api/type-aliases/tparsedarccommand/) + +*** + +### TParsedClosePathCommand + +Re-exports [TParsedClosePathCommand](/api/type-aliases/tparsedclosepathcommand/) + +*** + +### TParsedCommand + +Re-exports [TParsedCommand](/api/type-aliases/tparsedcommand/) + +*** + +### TParsedCubicCurveCommand + +Re-exports [TParsedCubicCurveCommand](/api/type-aliases/tparsedcubiccurvecommand/) + +*** + +### TParsedCubicCurveShortcutCommand + +Re-exports [TParsedCubicCurveShortcutCommand](/api/type-aliases/tparsedcubiccurveshortcutcommand/) + +*** + +### TParsedHorizontalLineCommand + +Re-exports [TParsedHorizontalLineCommand](/api/type-aliases/tparsedhorizontallinecommand/) + +*** + +### TParsedLineCommand + +Re-exports [TParsedLineCommand](/api/type-aliases/tparsedlinecommand/) + +*** + +### TParsedMoveToCommand + +Re-exports [TParsedMoveToCommand](/api/type-aliases/tparsedmovetocommand/) + +*** + +### TParsedQuadraticCurveCommand + +Re-exports [TParsedQuadraticCurveCommand](/api/type-aliases/tparsedquadraticcurvecommand/) + +*** + +### TParsedQuadraticCurveShortcutCommand + +Re-exports [TParsedQuadraticCurveShortcutCommand](/api/type-aliases/tparsedquadraticcurveshortcutcommand/) + +*** + +### TParsedRelativeArcCommand + +Re-exports [TParsedRelativeArcCommand](/api/type-aliases/tparsedrelativearccommand/) + +*** + +### TParsedRelativeClosePathCommand + +Re-exports [TParsedRelativeClosePathCommand](/api/type-aliases/tparsedrelativeclosepathcommand/) + +*** + +### TParsedRelativeCubicCurveCommand + +Re-exports [TParsedRelativeCubicCurveCommand](/api/type-aliases/tparsedrelativecubiccurvecommand/) + +*** + +### TParsedRelativeCubicCurveShortcutCommand + +Re-exports [TParsedRelativeCubicCurveShortcutCommand](/api/type-aliases/tparsedrelativecubiccurveshortcutcommand/) + +*** + +### TParsedRelativeHorizontalLineCommand + +Re-exports [TParsedRelativeHorizontalLineCommand](/api/type-aliases/tparsedrelativehorizontallinecommand/) + +*** + +### TParsedRelativeLineCommand + +Re-exports [TParsedRelativeLineCommand](/api/type-aliases/tparsedrelativelinecommand/) + +*** + +### TParsedRelativeMoveToCommand + +Re-exports [TParsedRelativeMoveToCommand](/api/type-aliases/tparsedrelativemovetocommand/) + +*** + +### TParsedRelativeQuadraticCurveCommand + +Re-exports [TParsedRelativeQuadraticCurveCommand](/api/type-aliases/tparsedrelativequadraticcurvecommand/) + +*** + +### TParsedRelativeQuadraticCurveShortcutCommand + +Re-exports [TParsedRelativeQuadraticCurveShortcutCommand](/api/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) + +*** + +### TParsedRelativeVerticalLineCommand + +Re-exports [TParsedRelativeVerticalLineCommand](/api/type-aliases/tparsedrelativeverticallinecommand/) + +*** + +### TParsedVerticalLineCommand + +Re-exports [TParsedVerticalLineCommand](/api/type-aliases/tparsedverticallinecommand/) + +*** + +### TPathSegmentCommandInfo + +Re-exports [TPathSegmentCommandInfo](/api/type-aliases/tpathsegmentcommandinfo/) + +*** + +### TPathSegmentInfo + +Re-exports [TPathSegmentInfo](/api/type-aliases/tpathsegmentinfo/) + +*** + +### TPathSegmentInfoCommon + +Re-exports [TPathSegmentInfoCommon](/api/type-aliases/tpathsegmentinfocommon/) + +*** + +### TPointAngle + +Re-exports [TPointAngle](/api/type-aliases/tpointangle/) + +*** + +### TQuadraticCurveCommand + +Re-exports [TQuadraticCurveCommand](/api/type-aliases/tquadraticcurvecommand/) + +*** + +### TQuadraticCurveShortcutCommand + +Re-exports [TQuadraticCurveShortcutCommand](/api/type-aliases/tquadraticcurveshortcutcommand/) + +*** + +### TSimpleParseCommandType + +Re-exports [TSimpleParseCommandType](/api/type-aliases/tsimpleparsecommandtype/) + +*** + +### TSimpleParsedCommand + +Re-exports [TSimpleParsedCommand](/api/type-aliases/tsimpleparsedcommand/) + +*** + +### TSimplePathData + +Re-exports [TSimplePathData](/api/type-aliases/tsimplepathdata/) + +*** + +### TVerticalLineCommand + +Re-exports [TVerticalLineCommand](/api/type-aliases/tverticallinecommand/) diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/index.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/index.md new file mode 100644 index 000000000..ab1093ad9 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/index.md @@ -0,0 +1,40 @@ +--- +editUrl: false +next: false +prev: false +title: "ease" +--- + +## Variables + +- [defaultEasing](/api/fabric/namespaces/util/namespaces/ease/variables/defaulteasing/) +- [easeInBack](/api/fabric/namespaces/util/namespaces/ease/variables/easeinback/) +- [easeInBounce](/api/fabric/namespaces/util/namespaces/ease/variables/easeinbounce/) +- [easeInCirc](/api/fabric/namespaces/util/namespaces/ease/variables/easeincirc/) +- [easeInCubic](/api/fabric/namespaces/util/namespaces/ease/variables/easeincubic/) +- [easeInElastic](/api/fabric/namespaces/util/namespaces/ease/variables/easeinelastic/) +- [easeInExpo](/api/fabric/namespaces/util/namespaces/ease/variables/easeinexpo/) +- [easeInOutBack](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutback/) +- [easeInOutBounce](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutbounce/) +- [easeInOutCirc](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutcirc/) +- [easeInOutCubic](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutcubic/) +- [easeInOutElastic](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutelastic/) +- [easeInOutExpo](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutexpo/) +- [easeInOutQuad](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutquad/) +- [easeInOutQuart](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutquart/) +- [easeInOutQuint](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutquint/) +- [easeInOutSine](/api/fabric/namespaces/util/namespaces/ease/variables/easeinoutsine/) +- [easeInQuad](/api/fabric/namespaces/util/namespaces/ease/variables/easeinquad/) +- [easeInQuart](/api/fabric/namespaces/util/namespaces/ease/variables/easeinquart/) +- [easeInQuint](/api/fabric/namespaces/util/namespaces/ease/variables/easeinquint/) +- [easeInSine](/api/fabric/namespaces/util/namespaces/ease/variables/easeinsine/) +- [easeOutBack](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutback/) +- [easeOutBounce](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutbounce/) +- [easeOutCirc](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutcirc/) +- [easeOutCubic](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutcubic/) +- [easeOutElastic](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutelastic/) +- [easeOutExpo](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutexpo/) +- [easeOutQuad](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutquad/) +- [easeOutQuart](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutquart/) +- [easeOutQuint](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutquint/) +- [easeOutSine](/api/fabric/namespaces/util/namespaces/ease/variables/easeoutsine/) diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/defaultEasing.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/defaultEasing.md new file mode 100644 index 000000000..960af08ec --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/defaultEasing.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "defaultEasing" +--- + +> `const` **defaultEasing**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L36) + +Default sinusoidal easing diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBack.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBack.md new file mode 100644 index 000000000..0fffc7158 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBack.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInBack" +--- + +> `const` **easeInBack**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:258](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L258) + +Backwards easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBounce.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBounce.md new file mode 100644 index 000000000..abfeb323b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInBounce.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInBounce" +--- + +> `const` **easeInBounce**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:296](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L296) + +Bouncing easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCirc.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCirc.md new file mode 100644 index 000000000..1bc15ba70 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCirc.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInCirc" +--- + +> `const` **easeInCirc**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:158](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L158) + +Circular easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCubic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCubic.md new file mode 100644 index 000000000..b4211e263 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInCubic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInCubic" +--- + +> `const` **easeInCubic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L42) + +Cubic easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInElastic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInElastic.md new file mode 100644 index 000000000..60b95d4ba --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInElastic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInElastic" +--- + +> `const` **easeInElastic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:181](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L181) + +Elastic easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInExpo.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInExpo.md new file mode 100644 index 000000000..15729e577 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInExpo.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInExpo" +--- + +> `const` **easeInExpo**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:129](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L129) + +Exponential easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBack.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBack.md new file mode 100644 index 000000000..1156d6e1d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBack.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutBack" +--- + +> `const` **easeInOutBack**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:270](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L270) + +Backwards easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBounce.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBounce.md new file mode 100644 index 000000000..2053adac5 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutBounce.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutBounce" +--- + +> `const` **easeInOutBounce**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:302](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L302) + +Bouncing easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCirc.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCirc.md new file mode 100644 index 000000000..d2d804566 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCirc.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutCirc" +--- + +> `const` **easeInOutCirc**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L170) + +Circular easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCubic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCubic.md new file mode 100644 index 000000000..72006a5f9 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutCubic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutCubic" +--- + +> `const` **easeInOutCubic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L54) + +Cubic easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutElastic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutElastic.md new file mode 100644 index 000000000..d4d7b3dae --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutElastic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutElastic" +--- + +> `const` **easeInOutElastic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:227](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L227) + +Elastic easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutExpo.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutExpo.md new file mode 100644 index 000000000..8ef32fcd0 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutExpo.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutExpo" +--- + +> `const` **easeInOutExpo**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L141) + +Exponential easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuad.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuad.md new file mode 100644 index 000000000..33b7d1f41 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuad.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutQuad" +--- + +> `const` **easeInOutQuad**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L321) + +Quadratic easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuart.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuart.md new file mode 100644 index 000000000..f6ecca15b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuart.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutQuart" +--- + +> `const` **easeInOutQuart**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L77) + +Quartic easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuint.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuint.md new file mode 100644 index 000000000..5caf33f07 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutQuint.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutQuint" +--- + +> `const` **easeInOutQuint**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L100) + +Quintic easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutSine.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutSine.md new file mode 100644 index 000000000..fa2a5ffcf --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInOutSine.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInOutSine" +--- + +> `const` **easeInOutSine**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L123) + +Sinusoidal easing in and out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuad.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuad.md new file mode 100644 index 000000000..81df686ac --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuad.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInQuad" +--- + +> `const` **easeInQuad**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:310](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L310) + +Quadratic easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuart.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuart.md new file mode 100644 index 000000000..0cf98c369 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuart.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInQuart" +--- + +> `const` **easeInQuart**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L65) + +Quartic easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuint.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuint.md new file mode 100644 index 000000000..a8095e0ad --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInQuint.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInQuint" +--- + +> `const` **easeInQuint**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L88) + +Quintic easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInSine.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInSine.md new file mode 100644 index 000000000..9e3f6ae1c --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeInSine.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeInSine" +--- + +> `const` **easeInSine**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L111) + +Sinusoidal easing in diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBack.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBack.md new file mode 100644 index 000000000..984d7733a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBack.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutBack" +--- + +> `const` **easeOutBack**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:264](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L264) + +Backwards easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBounce.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBounce.md new file mode 100644 index 000000000..3ee62a9ca --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutBounce.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutBounce" +--- + +> `const` **easeOutBounce**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:281](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L281) + +Bouncing easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCirc.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCirc.md new file mode 100644 index 000000000..3f86e1b80 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCirc.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutCirc" +--- + +> `const` **easeOutCirc**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:164](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L164) + +Circular easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCubic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCubic.md new file mode 100644 index 000000000..47432096d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutCubic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutCubic" +--- + +> `const` **easeOutCubic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L48) + +Cubic easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutElastic.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutElastic.md new file mode 100644 index 000000000..ea638295b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutElastic.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutElastic" +--- + +> `const` **easeOutElastic**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L202) + +Elastic easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutExpo.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutExpo.md new file mode 100644 index 000000000..3d708ccef --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutExpo.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutExpo" +--- + +> `const` **easeOutExpo**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L135) + +Exponential easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuad.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuad.md new file mode 100644 index 000000000..6cdf3a93d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuad.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutQuad" +--- + +> `const` **easeOutQuad**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:315](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L315) + +Quadratic easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuart.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuart.md new file mode 100644 index 000000000..48343d8b1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuart.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutQuart" +--- + +> `const` **easeOutQuart**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L71) + +Quartic easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuint.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuint.md new file mode 100644 index 000000000..dda053a61 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutQuint.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutQuint" +--- + +> `const` **easeOutQuint**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L94) + +Quintic easing out diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutSine.md b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutSine.md new file mode 100644 index 000000000..d063b2a81 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/ease/variables/easeOutSine.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "easeOutSine" +--- + +> `const` **easeOutSine**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/) + +Defined in: [src/util/animation/easing.ts:117](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/easing.ts#L117) + +Sinusoidal easing out diff --git a/src/content/docs/api/namespaces/util/namespaces/string/functions/capitalize.md b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/capitalize.md similarity index 52% rename from src/content/docs/api/namespaces/util/namespaces/string/functions/capitalize.md rename to src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/capitalize.md index 2855f04f1..8c709030a 100644 --- a/src/content/docs/api/namespaces/util/namespaces/string/functions/capitalize.md +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/capitalize.md @@ -5,15 +5,23 @@ prev: false title: "capitalize" --- -> **capitalize**(`string`, `firstLetterOnly`?): `string` +> **capitalize**(`string`, `firstLetterOnly?`): `string` + +Defined in: [src/util/lang\_string.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/lang_string.ts#L11) + +Capitalizes a string ## Parameters -• **string**: `string` +### string + +`string` String to capitalize -• **firstLetterOnly?**: `boolean` = `false` +### firstLetterOnly? + +`boolean` = `false` If true only first letter is capitalized and other letters stay untouched, if false first letter is capitalized @@ -24,7 +32,3 @@ and other letters are converted to lowercase. `string` Capitalized version of a string - -## Defined in - -[src/util/lang\_string.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/lang_string.ts#L9) diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/escapeXml.md b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/escapeXml.md new file mode 100644 index 000000000..d2441ec07 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/escapeXml.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "escapeXml" +--- + +> **escapeXml**(`string`): `string` + +Defined in: [src/util/lang\_string.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/lang_string.ts#L21) + +Escapes XML in a string + +## Parameters + +### string + +`string` + +String to escape + +## Returns + +`string` + +Escaped version of a string diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/graphemeSplit.md b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/graphemeSplit.md new file mode 100644 index 000000000..d8737b090 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/string/functions/graphemeSplit.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "graphemeSplit" +--- + +> **graphemeSplit**(`textstring`): `string`[] + +Defined in: [src/util/lang\_string.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/lang_string.ts#L48) + +Divide a string in the user perceived single units + +## Parameters + +### textstring + +`string` + +String to escape + +## Returns + +`string`[] + +array containing the graphemes diff --git a/src/content/docs/api/fabric/namespaces/util/namespaces/string/index.md b/src/content/docs/api/fabric/namespaces/util/namespaces/string/index.md new file mode 100644 index 000000000..30b08a2d3 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/namespaces/string/index.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "string" +--- + +## Functions + +- [capitalize](/api/fabric/namespaces/util/namespaces/string/functions/capitalize/) +- [escapeXml](/api/fabric/namespaces/util/namespaces/string/functions/escapexml/) +- [graphemeSplit](/api/fabric/namespaces/util/namespaces/string/functions/graphemesplit/) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationOptions.md new file mode 100644 index 000000000..dbeb5ab6a --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationOptions.md @@ -0,0 +1,16 @@ +--- +editUrl: false +next: false +prev: false +title: "AnimationOptions" +--- + +> **AnimationOptions**\<`T`\> = `T` *extends* [`TColorArg`](/api/type-aliases/tcolorarg/) ? [`ColorAnimationOptions`](/api/fabric/namespaces/util/type-aliases/coloranimationoptions/) : `T` *extends* `number`[] ? [`ArrayAnimationOptions`](/api/fabric/namespaces/util/type-aliases/arrayanimationoptions/) : [`ValueAnimationOptions`](/api/fabric/namespaces/util/type-aliases/valueanimationoptions/) + +Defined in: [src/util/animation/types.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L131) + +## Type Parameters + +### T + +`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationState.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationState.md new file mode 100644 index 000000000..371d69346 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/AnimationState.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "AnimationState" +--- + +> **AnimationState** = `"pending"` \| `"running"` \| `"completed"` \| `"aborted"` + +Defined in: [src/util/animation/types.ts:3](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L3) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/ArrayAnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/ArrayAnimationOptions.md new file mode 100644 index 000000000..050288c3b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/ArrayAnimationOptions.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "ArrayAnimationOptions" +--- + +> **ArrayAnimationOptions** = [`TAnimationOptions`](/api/fabric/namespaces/util/type-aliases/tanimationoptions/)\<`number`[]\> + +Defined in: [src/util/animation/types.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L123) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/ColorAnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/ColorAnimationOptions.md new file mode 100644 index 000000000..292b69e5d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/ColorAnimationOptions.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "ColorAnimationOptions" +--- + +> **ColorAnimationOptions** = [`TAnimationOptions`](/api/fabric/namespaces/util/type-aliases/tanimationoptions/)\<[`TColorArg`](/api/type-aliases/tcolorarg/), `string`, `number`[]\> + +Defined in: [src/util/animation/types.ts:125](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L125) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/EnlivenObjectOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/EnlivenObjectOptions.md new file mode 100644 index 000000000..9012535d7 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/EnlivenObjectOptions.md @@ -0,0 +1,39 @@ +--- +editUrl: false +next: false +prev: false +title: "EnlivenObjectOptions" +--- + +> **EnlivenObjectOptions** = [`Abortable`](/api/type-aliases/abortable/) & `object` + +Defined in: [src/util/misc/objectEnlive.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectEnlive.ts#L64) + +## Type Declaration + +### reviver()? + +> `optional` **reviver**: \<`T`\>(`serializedObj`, `instance`) => `void` + +Method for further parsing of object elements, +called after each fabric object created. + +#### Type Parameters + +##### T + +`T` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) \| [`FabricObject`](/api/classes/fabricobject/) \| [`BaseFilter`](/api/fabric/namespaces/filters/classes/basefilter/)\<`string`\> \| [`Shadow`](/api/classes/shadow/) \| [`TFiller`](/api/type-aliases/tfiller/) + +#### Parameters + +##### serializedObj + +`Record`\<`string`, `any`\> + +##### instance + +`T` + +#### Returns + +`void` diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/LoadImageOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/LoadImageOptions.md new file mode 100644 index 000000000..cd7124cbd --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/LoadImageOptions.md @@ -0,0 +1,18 @@ +--- +editUrl: false +next: false +prev: false +title: "LoadImageOptions" +--- + +> **LoadImageOptions** = [`Abortable`](/api/type-aliases/abortable/) & `object` + +Defined in: [src/util/misc/objectEnlive.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/objectEnlive.ts#L16) + +## Type Declaration + +### crossOrigin? + +> `optional` **crossOrigin**: [`TCrossOrigin`](/api/type-aliases/tcrossorigin/) + +cors value for the image loading, default to anonymous diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TAbortCallback.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAbortCallback.md new file mode 100644 index 000000000..8bd9565d2 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAbortCallback.md @@ -0,0 +1,22 @@ +--- +editUrl: false +next: false +prev: false +title: "TAbortCallback" +--- + +> **TAbortCallback**\<`T`\> = [`TOnAnimationChangeCallback`](/api/fabric/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`, `boolean`\> + +Defined in: [src/util/animation/types.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L22) + +Called on each step to determine if animation should abort + +## Type Parameters + +### T + +`T` + +## Returns + +truthy if animation should abort diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimation.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimation.md new file mode 100644 index 000000000..794dae69b --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimation.md @@ -0,0 +1,16 @@ +--- +editUrl: false +next: false +prev: false +title: "TAnimation" +--- + +> **TAnimation**\<`T`\> = `T` *extends* [`TColorArg`](/api/type-aliases/tcolorarg/) ? `ColorAnimation` : `T` *extends* `number`[] ? `ArrayAnimation` : `ValueAnimation` + +Defined in: [src/util/animation/animate.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/animate.ts#L11) + +## Type Parameters + +### T + +`T` *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationBaseOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationBaseOptions.md new file mode 100644 index 000000000..a1ad2fdc1 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationBaseOptions.md @@ -0,0 +1,74 @@ +--- +editUrl: false +next: false +prev: false +title: "TAnimationBaseOptions" +--- + +> **TAnimationBaseOptions**\<`T`\> = `object` + +Defined in: [src/util/animation/types.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L49) + +## Type Parameters + +### T + +`T` + +## Properties + +### delay + +> **delay**: `number` + +Defined in: [src/util/animation/types.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L60) + +Delay to start the animation in ms + +#### Default + +```ts +0 +``` + +*** + +### duration + +> **duration**: `number` + +Defined in: [src/util/animation/types.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L54) + +Duration of the animation in ms + +#### Default + +```ts +500 +``` + +*** + +### easing + +> **easing**: [`TEasingFunction`](/api/fabric/namespaces/util/type-aliases/teasingfunction/)\<`T`\> + +Defined in: [src/util/animation/types.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L66) + +Easing function + +#### Default + +```ts +{defaultEasing} +``` + +*** + +### target + +> **target**: `unknown` + +Defined in: [src/util/animation/types.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L71) + +The object this animation is being performed on diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationCallbacks.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationCallbacks.md new file mode 100644 index 000000000..6ee872a64 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationCallbacks.md @@ -0,0 +1,57 @@ +--- +editUrl: false +next: false +prev: false +title: "TAnimationCallbacks" +--- + +> **TAnimationCallbacks**\<`T`\> = `object` + +Defined in: [src/util/animation/types.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L74) + +## Type Parameters + +### T + +`T` + +## Properties + +### abort + +> **abort**: [`TAbortCallback`](/api/fabric/namespaces/util/type-aliases/tabortcallback/)\<`T`\> + +Defined in: [src/util/animation/types.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L94) + +Function called at each frame. +If it returns true, abort + +*** + +### onComplete + +> **onComplete**: [`TOnAnimationChangeCallback`](/api/fabric/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`\> + +Defined in: [src/util/animation/types.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L88) + +Called after the last frame of the animation + +*** + +### onChange + +> **onChange**: [`TOnAnimationChangeCallback`](/api/fabric/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`\> + +Defined in: [src/util/animation/types.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L83) + +Called at each frame of the animation + +*** + +### onStart + +> **onStart**: `VoidFunction` + +Defined in: [src/util/animation/types.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L78) + +Called when the animation starts diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationOptions.md new file mode 100644 index 000000000..a236e24c5 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TAnimationOptions.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "TAnimationOptions" +--- + +> **TAnimationOptions**\<`T`, `TCallback`, `TEasing`\> = `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`TEasing`\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`TCallback`\> & `object`\> + +Defined in: [src/util/animation/types.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L104) + +## Type Parameters + +### T + +`T` + +### TCallback + +`TCallback` = `T` + +### TEasing + +`TEasing` = `T` diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TBaseAnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TBaseAnimationOptions.md new file mode 100644 index 000000000..a027cb259 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TBaseAnimationOptions.md @@ -0,0 +1,34 @@ +--- +editUrl: false +next: false +prev: false +title: "TBaseAnimationOptions" +--- + +> **TBaseAnimationOptions**\<`T`, `TCallback`, `TEasing`\> = `Partial`\<[`TAnimationBaseOptions`](/api/fabric/namespaces/util/type-aliases/tanimationbaseoptions/)\<`TEasing`\> & [`TAnimationCallbacks`](/api/fabric/namespaces/util/type-aliases/tanimationcallbacks/)\<`TCallback`\>\> & `object` + +Defined in: [src/util/animation/types.ts:97](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L97) + +## Type Declaration + +### byValue + +> **byValue**: `T` + +### startValue + +> **startValue**: `T` + +## Type Parameters + +### T + +`T` + +### TCallback + +`TCallback` = `T` + +### TEasing + +`TEasing` = `T` diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TComposeMatrixArgs.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TComposeMatrixArgs.md new file mode 100644 index 000000000..30293ac48 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TComposeMatrixArgs.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TComposeMatrixArgs" +--- + +> **TComposeMatrixArgs** = [`TTranslateMatrixArgs`](/api/fabric/namespaces/util/type-aliases/ttranslatematrixargs/) & [`TRotateMatrixArgs`](/api/fabric/namespaces/util/type-aliases/trotatematrixargs/) & [`TScaleMatrixArgs`](/api/fabric/namespaces/util/type-aliases/tscalematrixargs/) + +Defined in: [src/util/misc/matrix.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L27) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TEasingFunction.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TEasingFunction.md new file mode 100644 index 000000000..e8ac1824d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TEasingFunction.md @@ -0,0 +1,38 @@ +--- +editUrl: false +next: false +prev: false +title: "TEasingFunction" +--- + +> **TEasingFunction**\<`T`\> = `T` *extends* `number`[] ? (`timeElapsed`, `startValue`, `byValue`, `duration`, `index`) => `number` : (`timeElapsed`, `startValue`, `byValue`, `duration`) => `number` + +Defined in: [src/util/animation/types.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L34) + +An easing function used to calculate the current value + +## Type Parameters + +### T + +`T` = `unknown` + +## See + +AnimationBase#calculate + +## Param + +ms elapsed since start + +## Param + +## Param + +## Param + +in ms + +## Returns + +next value diff --git a/src/content/docs/api/namespaces/util/type-aliases/TOnAnimationChangeCallback.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TOnAnimationChangeCallback.md similarity index 50% rename from src/content/docs/api/namespaces/util/type-aliases/TOnAnimationChangeCallback.md rename to src/content/docs/api/fabric/namespaces/util/type-aliases/TOnAnimationChangeCallback.md index d6b8a8cd6..0ea6d8ab4 100644 --- a/src/content/docs/api/namespaces/util/type-aliases/TOnAnimationChangeCallback.md +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TOnAnimationChangeCallback.md @@ -5,35 +5,43 @@ prev: false title: "TOnAnimationChangeCallback" --- -> **TOnAnimationChangeCallback**\<`T`, `R`\>: (`value`, `valueProgress`, `durationProgress`) => `R` +> **TOnAnimationChangeCallback**\<`T`, `R`\> = (`value`, `valueProgress`, `durationProgress`) => `R` + +Defined in: [src/util/animation/types.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L12) Callback called every frame ## Type Parameters -• **T** +### T + +`T` -• **R** = `void` +### R + +`R` = `void` ## Parameters -• **value**: `T` +### value + +`T` current value of the animation. -• **valueProgress**: `number` +### valueProgress + +`number` ∈ [0, 1], the current animation progress reflected on value, normalized. 0 is the starting value and 1 is the ending value. -• **durationProgress**: `number` +### durationProgress + +`number` ∈ [0, 1], the current animation duration normalized to 1. ## Returns `R` - -## Defined in - -[src/util/animation/types.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L12) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md new file mode 100644 index 000000000..5c0d8fdc7 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md @@ -0,0 +1,84 @@ +--- +editUrl: false +next: false +prev: false +title: "TProjectStrokeOnPointsOptions" +--- + +> **TProjectStrokeOnPointsOptions** = `object` + +Defined in: [src/util/misc/projectStroke/types.ts:4](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L4) + +## Properties + +### scaleX + +> **scaleX**: `number` + +Defined in: [src/util/misc/projectStroke/types.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L13) + +*** + +### scaleY + +> **scaleY**: `number` + +Defined in: [src/util/misc/projectStroke/types.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L14) + +*** + +### skewX + +> **skewX**: [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/projectStroke/types.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L15) + +*** + +### skewY + +> **skewY**: [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/projectStroke/types.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L16) + +*** + +### strokeLineCap + +> **strokeLineCap**: `CanvasLineCap` + +Defined in: [src/util/misc/projectStroke/types.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L6) + +*** + +### strokeLineJoin + +> **strokeLineJoin**: `CanvasLineJoin` + +Defined in: [src/util/misc/projectStroke/types.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L7) + +*** + +### strokeMiterLimit + +> **strokeMiterLimit**: `number` + +Defined in: [src/util/misc/projectStroke/types.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L11) + +https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit + +*** + +### strokeUniform + +> **strokeUniform**: `boolean` + +Defined in: [src/util/misc/projectStroke/types.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L12) + +*** + +### strokeWidth + +> **strokeWidth**: `number` + +Defined in: [src/util/misc/projectStroke/types.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L5) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjection.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjection.md new file mode 100644 index 000000000..3e91a496d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TProjection.md @@ -0,0 +1,42 @@ +--- +editUrl: false +next: false +prev: false +title: "TProjection" +--- + +> **TProjection** = `object` + +Defined in: [src/util/misc/projectStroke/types.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L19) + +## Properties + +### angle? + +> `optional` **angle**: [`TRadian`](/api/type-aliases/tradian/) + +Defined in: [src/util/misc/projectStroke/types.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L22) + +*** + +### bisector? + +> `optional` **bisector**: [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/projectStroke/types.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L23) + +*** + +### originPoint + +> **originPoint**: [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/projectStroke/types.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L21) + +*** + +### projectedPoint + +> **projectedPoint**: [`Point`](/api/classes/point/) + +Defined in: [src/util/misc/projectStroke/types.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/projectStroke/types.ts#L20) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TQrDecomposeOut.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TQrDecomposeOut.md new file mode 100644 index 000000000..2ff46d378 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TQrDecomposeOut.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TQrDecomposeOut" +--- + +> **TQrDecomposeOut** = `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/fabric/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\> + +Defined in: [src/util/misc/matrix.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L31) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TRotateMatrixArgs.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TRotateMatrixArgs.md new file mode 100644 index 000000000..1a4d73159 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TRotateMatrixArgs.md @@ -0,0 +1,18 @@ +--- +editUrl: false +next: false +prev: false +title: "TRotateMatrixArgs" +--- + +> **TRotateMatrixArgs** = `object` + +Defined in: [src/util/misc/matrix.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L9) + +## Properties + +### angle? + +> `optional` **angle**: [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/matrix.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L10) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TScaleMatrixArgs.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TScaleMatrixArgs.md new file mode 100644 index 000000000..1cc782b96 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TScaleMatrixArgs.md @@ -0,0 +1,58 @@ +--- +editUrl: false +next: false +prev: false +title: "TScaleMatrixArgs" +--- + +> **TScaleMatrixArgs** = `object` + +Defined in: [src/util/misc/matrix.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L18) + +## Properties + +### flipX? + +> `optional` **flipX**: `boolean` + +Defined in: [src/util/misc/matrix.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L21) + +*** + +### flipY? + +> `optional` **flipY**: `boolean` + +Defined in: [src/util/misc/matrix.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L22) + +*** + +### scaleX? + +> `optional` **scaleX**: `number` + +Defined in: [src/util/misc/matrix.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L19) + +*** + +### scaleY? + +> `optional` **scaleY**: `number` + +Defined in: [src/util/misc/matrix.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L20) + +*** + +### skewX? + +> `optional` **skewX**: [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/matrix.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L23) + +*** + +### skewY? + +> `optional` **skewY**: [`TDegree`](/api/type-aliases/tdegree/) + +Defined in: [src/util/misc/matrix.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L24) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TTranslateMatrixArgs.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TTranslateMatrixArgs.md new file mode 100644 index 000000000..97b0f76ac --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TTranslateMatrixArgs.md @@ -0,0 +1,26 @@ +--- +editUrl: false +next: false +prev: false +title: "TTranslateMatrixArgs" +--- + +> **TTranslateMatrixArgs** = `object` + +Defined in: [src/util/misc/matrix.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L13) + +## Properties + +### translateX? + +> `optional` **translateX**: `number` + +Defined in: [src/util/misc/matrix.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L14) + +*** + +### translateY? + +> `optional` **translateY**: `number` + +Defined in: [src/util/misc/matrix.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/matrix.ts#L15) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/TextStyleArray.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/TextStyleArray.md new file mode 100644 index 000000000..8266f0ab7 --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/TextStyleArray.md @@ -0,0 +1,24 @@ +--- +editUrl: false +next: false +prev: false +title: "TextStyleArray" +--- + +> **TextStyleArray** = `object`[] + +Defined in: [src/util/misc/textStyles.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/misc/textStyles.ts#L9) + +## Type Declaration + +### end + +> **end**: `number` + +### start + +> **start**: `number` + +### style + +> **style**: [`TextStyleDeclaration`](/api/type-aliases/textstyledeclaration/) diff --git a/src/content/docs/api/fabric/namespaces/util/type-aliases/ValueAnimationOptions.md b/src/content/docs/api/fabric/namespaces/util/type-aliases/ValueAnimationOptions.md new file mode 100644 index 000000000..4f443980d --- /dev/null +++ b/src/content/docs/api/fabric/namespaces/util/type-aliases/ValueAnimationOptions.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "ValueAnimationOptions" +--- + +> **ValueAnimationOptions** = [`TAnimationOptions`](/api/fabric/namespaces/util/type-aliases/tanimationoptions/)\<`number`\> + +Defined in: [src/util/animation/types.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/types.ts#L121) diff --git a/src/content/docs/api/functions/createCollectionMixin.md b/src/content/docs/api/functions/createCollectionMixin.md index a17d7f650..e71e946b3 100644 --- a/src/content/docs/api/functions/createCollectionMixin.md +++ b/src/content/docs/api/functions/createCollectionMixin.md @@ -5,20 +5,22 @@ prev: false title: "createCollectionMixin" --- -> **createCollectionMixin**\<`TBase`\>(`Base`): (...`args`) => `Collection`\<`TBase`\> & `TBase` +> **createCollectionMixin**\<`TBase`\>(`Base`): \{(...`args`): `Collection`; `prototype`: `Collection`\<`any`\>; \} & `TBase` + +Defined in: [src/Collection.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Collection.ts#L15) ## Type Parameters -• **TBase** *extends* [`Constructor`](/api/type-aliases/constructor/) +### TBase + +`TBase` *extends* [`Constructor`](/api/type-aliases/constructor/) ## Parameters -• **Base**: `TBase` +### Base -## Returns +`TBase` -(...`args`) => `Collection`\<`TBase`\> & `TBase` - -## Defined in +## Returns -[src/Collection.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Collection.ts#L15) +\{(...`args`): `Collection`; `prototype`: `Collection`\<`any`\>; \} & `TBase` diff --git a/src/content/docs/api/functions/getCSSRules.md b/src/content/docs/api/functions/getCSSRules.md deleted file mode 100644 index f32ba52f0..000000000 --- a/src/content/docs/api/functions/getCSSRules.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getCSSRules" ---- - -> **getCSSRules**(`doc`): `CSSRules` - -Returns CSS rules for a given SVG document - -## Parameters - -• **doc**: `Document` - -SVG document to parse - -## Returns - -`CSSRules` - -CSS rules of this document - -## Defined in - -[src/parser/getCSSRules.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/getCSSRules.ts#L8) diff --git a/src/content/docs/api/functions/getEnv.md b/src/content/docs/api/functions/getEnv.md index dd00f4b7b..a24a5e8e7 100644 --- a/src/content/docs/api/functions/getEnv.md +++ b/src/content/docs/api/functions/getEnv.md @@ -7,12 +7,10 @@ title: "getEnv" > **getEnv**(): `TFabricEnv` +Defined in: [src/env/index.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/env/index.ts#L36) + In order to support SSR we **MUST** access the browser env only after the window has loaded ## Returns `TFabricEnv` - -## Defined in - -[src/env/index.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/env/index.ts#L36) diff --git a/src/content/docs/api/functions/getFabricDocument.md b/src/content/docs/api/functions/getFabricDocument.md index 146a6a14a..e95ad6595 100644 --- a/src/content/docs/api/functions/getFabricDocument.md +++ b/src/content/docs/api/functions/getFabricDocument.md @@ -7,10 +7,8 @@ title: "getFabricDocument" > **getFabricDocument**(): `Document` +Defined in: [src/env/index.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/env/index.ts#L38) + ## Returns `Document` - -## Defined in - -[src/env/index.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/env/index.ts#L38) diff --git a/src/content/docs/api/functions/getFabricWindow.md b/src/content/docs/api/functions/getFabricWindow.md index 7f29ddc33..33f6aa885 100644 --- a/src/content/docs/api/functions/getFabricWindow.md +++ b/src/content/docs/api/functions/getFabricWindow.md @@ -7,10 +7,8 @@ title: "getFabricWindow" > **getFabricWindow**(): `Window` & *typeof* `globalThis` \| `DOMWindow` +Defined in: [src/env/index.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/env/index.ts#L40) + ## Returns `Window` & *typeof* `globalThis` \| `DOMWindow` - -## Defined in - -[src/env/index.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/env/index.ts#L40) diff --git a/src/content/docs/api/functions/getFilterBackend.md b/src/content/docs/api/functions/getFilterBackend.md index 3739165e4..c18e4bd24 100644 --- a/src/content/docs/api/functions/getFilterBackend.md +++ b/src/content/docs/api/functions/getFilterBackend.md @@ -5,13 +5,17 @@ prev: false title: "getFilterBackend" --- -> **getFilterBackend**(`strict`?): `FilterBackend` +> **getFilterBackend**(`strict?`): `FilterBackend` + +Defined in: [src/filters/FilterBackend.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/FilterBackend.ts#L29) Get the current fabricJS filter backend or initialize one if not available yet ## Parameters -• **strict?**: `boolean` = `true` +### strict? + +`boolean` = `true` pass `true` to create the backend if it wasn't created yet (default behavior), pass `false` to get the backend ref without mutating it @@ -19,7 +23,3 @@ pass `false` to get the backend ref without mutating it ## Returns `FilterBackend` - -## Defined in - -[src/filters/FilterBackend.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/FilterBackend.ts#L29) diff --git a/src/content/docs/api/functions/initFilterBackend.md b/src/content/docs/api/functions/initFilterBackend.md index 7411aaafc..a807ecd15 100644 --- a/src/content/docs/api/functions/initFilterBackend.md +++ b/src/content/docs/api/functions/initFilterBackend.md @@ -7,12 +7,10 @@ title: "initFilterBackend" > **initFilterBackend**(): `FilterBackend` +Defined in: [src/filters/FilterBackend.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/FilterBackend.ts#L14) + Verifies if it is possible to initialize webgl or fallback on a canvas2d filtering backend ## Returns `FilterBackend` - -## Defined in - -[src/filters/FilterBackend.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/FilterBackend.ts#L14) diff --git a/src/content/docs/api/functions/isPutImageFaster.md b/src/content/docs/api/functions/isPutImageFaster.md index 3f0b8ca47..32c157f9c 100644 --- a/src/content/docs/api/functions/isPutImageFaster.md +++ b/src/content/docs/api/functions/isPutImageFaster.md @@ -7,6 +7,8 @@ title: "isPutImageFaster" > **isPutImageFaster**(`width`, `height`): `boolean` +Defined in: [src/filters/utils.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/utils.ts#L18) + Pick a method to copy data from GL context to 2d canvas. In some browsers using drawImage should be faster, but is also bugged for a small combination of old hardware and drivers. @@ -14,14 +16,14 @@ putImageData is faster than drawImage for that specific operation. ## Parameters -• **width**: `number` +### width -• **height**: `number` +`number` -## Returns +### height -`boolean` +`number` -## Defined in +## Returns -[src/filters/utils.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/utils.ts#L18) +`boolean` diff --git a/src/content/docs/api/functions/isWebGLPipelineState.md b/src/content/docs/api/functions/isWebGLPipelineState.md index 7409b4bbb..c13b52616 100644 --- a/src/content/docs/api/functions/isWebGLPipelineState.md +++ b/src/content/docs/api/functions/isWebGLPipelineState.md @@ -7,14 +7,14 @@ title: "isWebGLPipelineState" > **isWebGLPipelineState**(`options`): `options is TWebGLPipelineState` +Defined in: [src/filters/utils.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/utils.ts#L6) + ## Parameters -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) +### options + +[`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) | [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) ## Returns `options is TWebGLPipelineState` - -## Defined in - -[src/filters/utils.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/utils.ts#L6) diff --git a/src/content/docs/api/functions/loadSVGFromString.md b/src/content/docs/api/functions/loadSVGFromString.md index aa923c890..ee8bf82d7 100644 --- a/src/content/docs/api/functions/loadSVGFromString.md +++ b/src/content/docs/api/functions/loadSVGFromString.md @@ -5,34 +5,34 @@ prev: false title: "loadSVGFromString" --- -> **loadSVGFromString**(`string`, `reviver`?, `options`?): `Promise`\<`SVGParsingOutput`\> +> **loadSVGFromString**(`string`, `reviver?`, `options?`): `Promise`\<`SVGParsingOutput`\> + +Defined in: [src/parser/loadSVGFromString.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/parser/loadSVGFromString.ts#L19) Takes string corresponding to an SVG document, and parses it into a set of fabric objects ## Parameters -• **string**: `string` +### string + +`string` representing the svg -• **reviver?**: `TSvgReviverCallback` +### reviver? + +`TSvgReviverCallback` Extra callback for further parsing of SVG elements, called after each fabric object has been created. Takes as input the original svg element and the generated `FabricObject` as arguments. Used to inspect extra properties not parsed by fabric, or extra custom manipulation -• **options?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) +### options? + +[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) Object containing options for parsing ## Returns `Promise`\<`SVGParsingOutput`\> - -## Member Of - -fabric - -## Defined in - -[src/parser/loadSVGFromString.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/loadSVGFromString.ts#L20) diff --git a/src/content/docs/api/functions/loadSVGFromURL.md b/src/content/docs/api/functions/loadSVGFromURL.md index e184a8aea..722cdf79d 100644 --- a/src/content/docs/api/functions/loadSVGFromURL.md +++ b/src/content/docs/api/functions/loadSVGFromURL.md @@ -5,35 +5,35 @@ prev: false title: "loadSVGFromURL" --- -> **loadSVGFromURL**(`url`, `reviver`?, `options`?): `Promise`\<`SVGParsingOutput`\> +> **loadSVGFromURL**(`url`, `reviver?`, `options?`): `Promise`\<`SVGParsingOutput`\> + +Defined in: [src/parser/loadSVGFromURL.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/parser/loadSVGFromURL.ts#L21) Takes url corresponding to an SVG document, and parses it into a set of fabric objects. -Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy) +Note that SVG is fetched via fetch API, so it needs to conform to SOP (Same Origin Policy) ## Parameters -• **url**: `string` +### url + +`string` where the SVG is -• **reviver?**: `TSvgReviverCallback` +### reviver? + +`TSvgReviverCallback` Extra callback for further parsing of SVG elements, called after each fabric object has been created. Takes as input the original svg element and the generated `FabricObject` as arguments. Used to inspect extra properties not parsed by fabric, or extra custom manipulation -• **options?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) = `{}` +### options? + +[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) = `{}` Object containing options for parsing ## Returns `Promise`\<`SVGParsingOutput`\> - -## Member Of - -fabric - -## Defined in - -[src/parser/loadSVGFromURL.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/loadSVGFromURL.ts#L21) diff --git a/src/content/docs/api/functions/parseAttributes.md b/src/content/docs/api/functions/parseAttributes.md deleted file mode 100644 index 6861f4365..000000000 --- a/src/content/docs/api/functions/parseAttributes.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parseAttributes" ---- - -> **parseAttributes**(`element`, `attributes`, `cssRules`?): `Record`\<`string`, `any`\> - -Returns an object of attributes' name/value, given element and an array of attribute names; -Parses parent "g" nodes recursively upwards. - -## Parameters - -• **element**: `null` \| `HTMLElement` - -Element to parse - -• **attributes**: `string`[] - -Array of attributes to parse - -• **cssRules?**: `CSSRules` - -## Returns - -`Record`\<`string`, `any`\> - -object containing parsed attributes' names/values - -## Defined in - -[src/parser/parseAttributes.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parseAttributes.ts#L19) diff --git a/src/content/docs/api/functions/parseFontDeclaration.md b/src/content/docs/api/functions/parseFontDeclaration.md deleted file mode 100644 index 5b54f250b..000000000 --- a/src/content/docs/api/functions/parseFontDeclaration.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parseFontDeclaration" ---- - -> **parseFontDeclaration**(`value`, `oStyle`): `void` - -Parses a short font declaration, building adding its properties to a style object - -## Parameters - -• **value**: `string` - -font declaration - -• **oStyle**: `Record`\<`string`, `any`\> - -definition - -## Returns - -`void` - -## Static - -## Function - -## Member Of - -fabric - -## Defined in - -[src/parser/parseFontDeclaration.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parseFontDeclaration.ts#L12) diff --git a/src/content/docs/api/functions/parsePointsAttribute.md b/src/content/docs/api/functions/parsePointsAttribute.md deleted file mode 100644 index bfcfcfe67..000000000 --- a/src/content/docs/api/functions/parsePointsAttribute.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parsePointsAttribute" ---- - -> **parsePointsAttribute**(`points`): [`XY`](/api/interfaces/xy/)[] - -Parses "points" attribute, returning an array of values - -## Parameters - -• **points**: `null` \| `string` - -points attribute string - -## Returns - -[`XY`](/api/interfaces/xy/)[] - -array of points - -## Static - -## Member Of - -fabric - -## Defined in - -[src/parser/parsePointsAttribute.ts:10](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parsePointsAttribute.ts#L10) diff --git a/src/content/docs/api/functions/parseSVGDocument.md b/src/content/docs/api/functions/parseSVGDocument.md index d4c169286..25c359813 100644 --- a/src/content/docs/api/functions/parseSVGDocument.md +++ b/src/content/docs/api/functions/parseSVGDocument.md @@ -5,23 +5,31 @@ prev: false title: "parseSVGDocument" --- -> **parseSVGDocument**(`doc`, `reviver`?, `__namedParameters`?): `Promise`\<`SVGParsingOutput`\> +> **parseSVGDocument**(`doc`, `reviver?`, `__namedParameters?`): `Promise`\<`SVGParsingOutput`\> + +Defined in: [src/parser/parseSVGDocument.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/parser/parseSVGDocument.ts#L35) Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback ## Parameters -• **doc**: `Document` +### doc + +`Document` SVG document to parse -• **reviver?**: `TSvgReviverCallback` +### reviver? + +`TSvgReviverCallback` Extra callback for further parsing of SVG elements, called after each fabric object has been created. Takes as input the original svg element and the generated `FabricObject` as arguments. Used to inspect extra properties not parsed by fabric, or extra custom manipulation -• **\_\_namedParameters?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) = `{}` +### \_\_namedParameters? + +[`LoadImageOptions`](/api/fabric/namespaces/util/type-aliases/loadimageoptions/) = `{}` ## Returns @@ -29,15 +37,3 @@ or extra custom manipulation SVGParsingOutput also receives `allElements` array as the last argument. This is the full list of svg nodes available in the document. You may want to use it if you are trying to regroup the objects as they were originally grouped in the SVG. ( This was the reason why it was added ) - -## Static - -## Function - -## Member Of - -fabric - -## Defined in - -[src/parser/parseSVGDocument.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parseSVGDocument.ts#L38) diff --git a/src/content/docs/api/functions/parseStyleAttribute.md b/src/content/docs/api/functions/parseStyleAttribute.md deleted file mode 100644 index 93067d7d2..000000000 --- a/src/content/docs/api/functions/parseStyleAttribute.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parseStyleAttribute" ---- - -> **parseStyleAttribute**(`element`): `Record`\<`string`, `any`\> - -Parses "style" attribute, retuning an object with values - -## Parameters - -• **element**: `HTMLElement` - -Element to parse - -## Returns - -`Record`\<`string`, `any`\> - -Objects with values parsed from style attribute of an element - -## Static - -## Member Of - -fabric - -## Defined in - -[src/parser/parseStyleAttribute.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parseStyleAttribute.ts#L11) diff --git a/src/content/docs/api/functions/parseTransformAttribute.md b/src/content/docs/api/functions/parseTransformAttribute.md deleted file mode 100644 index 98e4d9b73..000000000 --- a/src/content/docs/api/functions/parseTransformAttribute.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parseTransformAttribute" ---- - -> **parseTransformAttribute**(`attributeValue`): [`TMat2D`](/api/type-aliases/tmat2d/) - -Parses "transform" attribute, returning an array of values - -## Parameters - -• **attributeValue**: `string` - -String containing attribute value - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -Array of 6 elements representing transformation matrix - -## Static - -## Function - -## Member Of - -fabric - -## Defined in - -[src/parser/parseTransformAttribute.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/parser/parseTransformAttribute.ts#L39) diff --git a/src/content/docs/api/functions/setEnv.md b/src/content/docs/api/functions/setEnv.md index 6c9a7f291..77c5635ed 100644 --- a/src/content/docs/api/functions/setEnv.md +++ b/src/content/docs/api/functions/setEnv.md @@ -7,6 +7,8 @@ title: "setEnv" > **setEnv**(`value`): `void` +Defined in: [src/env/index.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/env/index.ts#L29) + Sets the environment variables used by fabric.\ This is exposed for special cases, such as configuring a test environment, and should be used with care. @@ -14,7 +16,9 @@ This is exposed for special cases, such as configuring a test environment, and s ## Parameters -• **value**: `TFabricEnv` +### value + +`TFabricEnv` ## Returns @@ -28,7 +32,3 @@ import { getEnv, setEnv } from 'fabric'; setEnv({ ...getEnv(), window, document }); // done with setup, using fabric is now safe ``` - -## Defined in - -[src/env/index.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/env/index.ts#L29) diff --git a/src/content/docs/api/functions/setFilterBackend.md b/src/content/docs/api/functions/setFilterBackend.md index 62e03ce4e..69ec79e59 100644 --- a/src/content/docs/api/functions/setFilterBackend.md +++ b/src/content/docs/api/functions/setFilterBackend.md @@ -7,14 +7,14 @@ title: "setFilterBackend" > **setFilterBackend**(`backend`): `void` +Defined in: [src/filters/FilterBackend.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/FilterBackend.ts#L36) + ## Parameters -• **backend**: `FilterBackend` +### backend + +`FilterBackend` ## Returns `void` - -## Defined in - -[src/filters/FilterBackend.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/FilterBackend.ts#L36) diff --git a/src/content/docs/api/index.md b/src/content/docs/api/index.md index 5a0a48150..a702932db 100644 --- a/src/content/docs/api/index.md +++ b/src/content/docs/api/index.md @@ -5,353 +5,11 @@ prev: false title: "fabric" --- -## References - -### Image - -Renames and re-exports [FabricImage](/api/classes/fabricimage/) - -*** - -### Object - -Renames and re-exports [FabricObject](/api/classes/fabricobject/) - -*** - -### TArcCommand - -Re-exports [TArcCommand](/api/namespaces/util/type-aliases/tarccommand/) - -*** - -### TArcCommandSingleFlag - -Re-exports [TArcCommandSingleFlag](/api/namespaces/util/type-aliases/tarccommandsingleflag/) - -*** - -### TClosePathCommand - -Re-exports [TClosePathCommand](/api/namespaces/util/type-aliases/tclosepathcommand/) - -*** - -### TComplexParsedCommand - -Re-exports [TComplexParsedCommand](/api/namespaces/util/type-aliases/tcomplexparsedcommand/) - -*** - -### TComplexParsedCommandType - -Re-exports [TComplexParsedCommandType](/api/namespaces/util/type-aliases/tcomplexparsedcommandtype/) - -*** - -### TComplexPathData - -Re-exports [TComplexPathData](/api/namespaces/util/type-aliases/tcomplexpathdata/) - -*** - -### TCubicCurveCommand - -Re-exports [TCubicCurveCommand](/api/namespaces/util/type-aliases/tcubiccurvecommand/) - -*** - -### TCubicCurveShortcutCommand - -Re-exports [TCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tcubiccurveshortcutcommand/) - -*** - -### TCurveInfo - -Re-exports [TCurveInfo](/api/namespaces/util/type-aliases/tcurveinfo/) - -*** - -### TEndPathInfo - -Re-exports [TEndPathInfo](/api/namespaces/util/type-aliases/tendpathinfo/) - -*** - -### THorizontalLineCommand - -Re-exports [THorizontalLineCommand](/api/namespaces/util/type-aliases/thorizontallinecommand/) - -*** - -### TLineCommand - -Re-exports [TLineCommand](/api/namespaces/util/type-aliases/tlinecommand/) - -*** - -### TMoveToCommand - -Re-exports [TMoveToCommand](/api/namespaces/util/type-aliases/tmovetocommand/) - -*** - -### TParsedAbsoluteArcCommand - -Re-exports [TParsedAbsoluteArcCommand](/api/namespaces/util/type-aliases/tparsedabsolutearccommand/) - -*** - -### TParsedAbsoluteClosePathCommand - -Re-exports [TParsedAbsoluteClosePathCommand](/api/namespaces/util/type-aliases/tparsedabsoluteclosepathcommand/) - -*** - -### TParsedAbsoluteCubicCurveCommand - -Re-exports [TParsedAbsoluteCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurvecommand/) - -*** - -### TParsedAbsoluteCubicCurveShortcutCommand - -Re-exports [TParsedAbsoluteCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) - -*** - -### TParsedAbsoluteHorizontalLineCommand - -Re-exports [TParsedAbsoluteHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedabsolutehorizontallinecommand/) - -*** - -### TParsedAbsoluteLineCommand - -Re-exports [TParsedAbsoluteLineCommand](/api/namespaces/util/type-aliases/tparsedabsolutelinecommand/) - -*** - -### TParsedAbsoluteMoveToCommand - -Re-exports [TParsedAbsoluteMoveToCommand](/api/namespaces/util/type-aliases/tparsedabsolutemovetocommand/) - -*** - -### TParsedAbsoluteQuadraticCurveCommand - -Re-exports [TParsedAbsoluteQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurvecommand/) - -*** - -### TParsedAbsoluteQuadraticCurveShortcutCommand - -Re-exports [TParsedAbsoluteQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) - -*** - -### TParsedAbsoluteVerticalLineCommand - -Re-exports [TParsedAbsoluteVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedabsoluteverticallinecommand/) - -*** - -### TParsedArcCommand - -Re-exports [TParsedArcCommand](/api/namespaces/util/type-aliases/tparsedarccommand/) - -*** - -### TParsedClosePathCommand - -Re-exports [TParsedClosePathCommand](/api/namespaces/util/type-aliases/tparsedclosepathcommand/) - -*** - -### TParsedCommand - -Re-exports [TParsedCommand](/api/namespaces/util/type-aliases/tparsedcommand/) - -*** - -### TParsedCubicCurveCommand - -Re-exports [TParsedCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedcubiccurvecommand/) - -*** - -### TParsedCubicCurveShortcutCommand - -Re-exports [TParsedCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedcubiccurveshortcutcommand/) - -*** - -### TParsedHorizontalLineCommand - -Re-exports [TParsedHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedhorizontallinecommand/) - -*** - -### TParsedLineCommand - -Re-exports [TParsedLineCommand](/api/namespaces/util/type-aliases/tparsedlinecommand/) - -*** - -### TParsedMoveToCommand - -Re-exports [TParsedMoveToCommand](/api/namespaces/util/type-aliases/tparsedmovetocommand/) - -*** - -### TParsedQuadraticCurveCommand - -Re-exports [TParsedQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedquadraticcurvecommand/) - -*** - -### TParsedQuadraticCurveShortcutCommand - -Re-exports [TParsedQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedquadraticcurveshortcutcommand/) - -*** - -### TParsedRelativeArcCommand - -Re-exports [TParsedRelativeArcCommand](/api/namespaces/util/type-aliases/tparsedrelativearccommand/) - -*** - -### TParsedRelativeClosePathCommand - -Re-exports [TParsedRelativeClosePathCommand](/api/namespaces/util/type-aliases/tparsedrelativeclosepathcommand/) - -*** - -### TParsedRelativeCubicCurveCommand - -Re-exports [TParsedRelativeCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedrelativecubiccurvecommand/) - -*** - -### TParsedRelativeCubicCurveShortcutCommand - -Re-exports [TParsedRelativeCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedrelativecubiccurveshortcutcommand/) - -*** - -### TParsedRelativeHorizontalLineCommand - -Re-exports [TParsedRelativeHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedrelativehorizontallinecommand/) - -*** - -### TParsedRelativeLineCommand - -Re-exports [TParsedRelativeLineCommand](/api/namespaces/util/type-aliases/tparsedrelativelinecommand/) - -*** - -### TParsedRelativeMoveToCommand - -Re-exports [TParsedRelativeMoveToCommand](/api/namespaces/util/type-aliases/tparsedrelativemovetocommand/) - -*** - -### TParsedRelativeQuadraticCurveCommand - -Re-exports [TParsedRelativeQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurvecommand/) - -*** - -### TParsedRelativeQuadraticCurveShortcutCommand - -Re-exports [TParsedRelativeQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) - -*** - -### TParsedRelativeVerticalLineCommand - -Re-exports [TParsedRelativeVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedrelativeverticallinecommand/) - -*** - -### TParsedVerticalLineCommand - -Re-exports [TParsedVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedverticallinecommand/) - -*** - -### TPathSegmentCommandInfo - -Re-exports [TPathSegmentCommandInfo](/api/namespaces/util/type-aliases/tpathsegmentcommandinfo/) - -*** - -### TPathSegmentInfo - -Re-exports [TPathSegmentInfo](/api/namespaces/util/type-aliases/tpathsegmentinfo/) - -*** - -### TPathSegmentInfoCommon - -Re-exports [TPathSegmentInfoCommon](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/) - -*** - -### TPointAngle - -Re-exports [TPointAngle](/api/namespaces/util/type-aliases/tpointangle/) - -*** - -### TQuadraticCurveCommand - -Re-exports [TQuadraticCurveCommand](/api/namespaces/util/type-aliases/tquadraticcurvecommand/) - -*** - -### TQuadraticCurveShortcutCommand - -Re-exports [TQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tquadraticcurveshortcutcommand/) - -*** - -### TSimpleParseCommandType - -Re-exports [TSimpleParseCommandType](/api/namespaces/util/type-aliases/tsimpleparsecommandtype/) - -*** - -### TSimpleParsedCommand - -Re-exports [TSimpleParsedCommand](/api/namespaces/util/type-aliases/tsimpleparsedcommand/) - -*** - -### TSimplePathData - -Re-exports [TSimplePathData](/api/namespaces/util/type-aliases/tsimplepathdata/) - -*** - -### TVerticalLineCommand - -Re-exports [TVerticalLineCommand](/api/namespaces/util/type-aliases/tverticallinecommand/) - -*** - -### Text - -Renames and re-exports [FabricText](/api/classes/fabrictext/) - ## Namespaces -- [controlsUtils](/api/namespaces/controlsutils/index/) -- [filters](/api/namespaces/filters/index/) -- [util](/api/namespaces/util/index/) +- [controlsUtils](/api/fabric/namespaces/controlsutils/index/) +- [filters](/api/fabric/namespaces/filters/index/) +- [util](/api/fabric/namespaces/util/index/) ## Classes @@ -374,12 +32,12 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [FixedLayout](/api/classes/fixedlayout/) - [Gradient](/api/classes/gradient/) - [Group](/api/classes/group/) -- [IText](/api/classes/itext/) - [InteractiveFabricObject](/api/classes/interactivefabricobject/) - [Intersection](/api/classes/intersection/) +- [IText](/api/classes/itext/) - [LayoutManager](/api/classes/layoutmanager/) - [LayoutStrategy](/api/classes/layoutstrategy/) -- [Line](/api/classes/line/) +- [~~Line~~](/api/classes/line/) - [Observable](/api/classes/observable/) - [Path](/api/classes/path/) - [Pattern](/api/classes/pattern/) @@ -412,8 +70,8 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [GroupEvents](/api/interfaces/groupevents/) - [GroupOwnProps](/api/interfaces/groupownprops/) - [GroupProps](/api/interfaces/groupprops/) -- [ITextProps](/api/interfaces/itextprops/) - [ImageProps](/api/interfaces/imageprops/) +- [ITextProps](/api/interfaces/itextprops/) - [MiscEvents](/api/interfaces/miscevents/) - [ModifiedEvent](/api/interfaces/modifiedevent/) - [ModifyPathEvent](/api/interfaces/modifypathevent/) @@ -423,21 +81,21 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [SerializedCircleProps](/api/interfaces/serializedcircleprops/) - [SerializedEllipseProps](/api/interfaces/serializedellipseprops/) - [SerializedGroupProps](/api/interfaces/serializedgroupprops/) -- [SerializedITextProps](/api/interfaces/serializeditextprops/) - [SerializedImageProps](/api/interfaces/serializedimageprops/) +- [SerializedITextProps](/api/interfaces/serializeditextprops/) - [SerializedLineProps](/api/interfaces/serializedlineprops/) - [SerializedObjectProps](/api/interfaces/serializedobjectprops/) - [SerializedPathProps](/api/interfaces/serializedpathprops/) - [SerializedPolylineProps](/api/interfaces/serializedpolylineprops/) - [SerializedRectProps](/api/interfaces/serializedrectprops/) -- [SerializedTextProps](/api/interfaces/serializedtextprops/) - [SerializedTextboxProps](/api/interfaces/serializedtextboxprops/) +- [SerializedTextProps](/api/interfaces/serializedtextprops/) - [StaticCanvasEvents](/api/interfaces/staticcanvasevents/) - [StaticCanvasOptions](/api/interfaces/staticcanvasoptions/) - [TEvent](/api/interfaces/tevent/) -- [TPointerEventInfo](/api/interfaces/tpointereventinfo/) -- [TextProps](/api/interfaces/textprops/) - [TextboxProps](/api/interfaces/textboxprops/) +- [TextProps](/api/interfaces/textprops/) +- [TPointerEventInfo](/api/interfaces/tpointereventinfo/) - [XY](/api/interfaces/xy/) ## Type Aliases @@ -455,20 +113,21 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [ControlCursorCallback](/api/type-aliases/controlcursorcallback/) - [CursorBoundaries](/api/type-aliases/cursorboundaries/) - [CursorRenderingData](/api/type-aliases/cursorrenderingdata/) -- [GradientCoordValue](/api/type-aliases/gradientcoordvalue/) +- [DrawContext](/api/type-aliases/drawcontext/) - [GradientCoords](/api/type-aliases/gradientcoords/) +- [GradientCoordValue](/api/type-aliases/gradientcoordvalue/) - [GradientOptions](/api/type-aliases/gradientoptions/) - [GradientType](/api/type-aliases/gradienttype/) - [GradientUnits](/api/type-aliases/gradientunits/) - [GraphemeBBox](/api/type-aliases/graphemebbox/) - [GraphemeData](/api/type-aliases/graphemedata/) -- [ITextEvents](/api/type-aliases/itextevents/) - [ImageFormat](/api/type-aliases/imageformat/) - [ImageSource](/api/type-aliases/imagesource/) - [ImperativeLayoutContext](/api/type-aliases/imperativelayoutcontext/) - [ImperativeLayoutOptions](/api/type-aliases/imperativelayoutoptions/) - [InitializationLayoutContext](/api/type-aliases/initializationlayoutcontext/) - [IntersectionType](/api/type-aliases/intersectiontype/) +- [ITextEvents](/api/type-aliases/itextevents/) - [LayoutAfterEvent](/api/type-aliases/layoutafterevent/) - [LayoutBeforeEvent](/api/type-aliases/layoutbeforeevent/) - [LayoutContext](/api/type-aliases/layoutcontext/) @@ -487,15 +146,18 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [Percent](/api/type-aliases/percent/) - [RadialGradientCoords](/api/type-aliases/radialgradientcoords/) - [RegistrationContext](/api/type-aliases/registrationcontext/) -- [SVGElementName](/api/type-aliases/svgelementname/) -- [SVGOptions](/api/type-aliases/svgoptions/) +- [SerializedGradientProps](/api/type-aliases/serializedgradientprops/) - [SerializedLayoutManager](/api/type-aliases/serializedlayoutmanager/) - [SerializedPatternOptions](/api/type-aliases/serializedpatternoptions/) - [SerializedShadowOptions](/api/type-aliases/serializedshadowoptions/) - [SprayBrushPoint](/api/type-aliases/spraybrushpoint/) - [StrictLayoutContext](/api/type-aliases/strictlayoutcontext/) - [SupportedSVGUnit](/api/type-aliases/supportedsvgunit/) +- [SVGElementName](/api/type-aliases/svgelementname/) +- [SVGOptions](/api/type-aliases/svgoptions/) - [T2DPipelineState](/api/type-aliases/t2dpipelinestate/) +- [TArcCommand](/api/type-aliases/tarccommand/) +- [TArcCommandSingleFlag](/api/type-aliases/tarccommandsingleflag/) - [TAxis](/api/type-aliases/taxis/) - [TAxisKey](/api/type-aliases/taxiskey/) - [TBBox](/api/type-aliases/tbbox/) @@ -503,45 +165,98 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [TCacheCanvasDimensions](/api/type-aliases/tcachecanvasdimensions/) - [TCanvasSizeOptions](/api/type-aliases/tcanvassizeoptions/) - [TClassProperties](/api/type-aliases/tclassproperties/) +- [TClosePathCommand](/api/type-aliases/tclosepathcommand/) - [TColorArg](/api/type-aliases/tcolorarg/) +- [TComplexParsedCommand](/api/type-aliases/tcomplexparsedcommand/) +- [TComplexParsedCommandType](/api/type-aliases/tcomplexparsedcommandtype/) +- [TComplexPathData](/api/type-aliases/tcomplexpathdata/) - [TCornerPoint](/api/type-aliases/tcornerpoint/) - [TCrossOrigin](/api/type-aliases/tcrossorigin/) +- [TCubicCurveCommand](/api/type-aliases/tcubiccurvecommand/) +- [TCubicCurveShortcutCommand](/api/type-aliases/tcubiccurveshortcutcommand/) +- [TCurveInfo](/api/type-aliases/tcurveinfo/) - [TDataUrlOptions](/api/type-aliases/tdataurloptions/) - [TDegree](/api/type-aliases/tdegree/) +- [TEndPathInfo](/api/type-aliases/tendpathinfo/) +- [TEventsExtraData](/api/type-aliases/teventsextradata/) +- [TextStyle](/api/type-aliases/textstyle/) +- [TextStyleDeclaration](/api/type-aliases/textstyledeclaration/) - [TFabricObjectProps](/api/type-aliases/tfabricobjectprops/) - [TFiller](/api/type-aliases/tfiller/) +- [THorizontalLineCommand](/api/type-aliases/thorizontallinecommand/) +- [TLineCommand](/api/type-aliases/tlinecommand/) - [TMat2D](/api/type-aliases/tmat2d/) - [TMatColorMatrix](/api/type-aliases/tmatcolormatrix/) - [TModificationEvents](/api/type-aliases/tmodificationevents/) +- [TMoveToCommand](/api/type-aliases/tmovetocommand/) - [TOptionalModifierKey](/api/type-aliases/toptionalmodifierkey/) - [TOptions](/api/type-aliases/toptions/) - [TOriginX](/api/type-aliases/toriginx/) - [TOriginY](/api/type-aliases/toriginy/) +- [TParsedAbsoluteArcCommand](/api/type-aliases/tparsedabsolutearccommand/) +- [TParsedAbsoluteClosePathCommand](/api/type-aliases/tparsedabsoluteclosepathcommand/) +- [TParsedAbsoluteCubicCurveCommand](/api/type-aliases/tparsedabsolutecubiccurvecommand/) +- [TParsedAbsoluteCubicCurveShortcutCommand](/api/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) +- [TParsedAbsoluteHorizontalLineCommand](/api/type-aliases/tparsedabsolutehorizontallinecommand/) +- [TParsedAbsoluteLineCommand](/api/type-aliases/tparsedabsolutelinecommand/) +- [TParsedAbsoluteMoveToCommand](/api/type-aliases/tparsedabsolutemovetocommand/) +- [TParsedAbsoluteQuadraticCurveCommand](/api/type-aliases/tparsedabsolutequadraticcurvecommand/) +- [TParsedAbsoluteQuadraticCurveShortcutCommand](/api/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) +- [TParsedAbsoluteVerticalLineCommand](/api/type-aliases/tparsedabsoluteverticallinecommand/) +- [TParsedArcCommand](/api/type-aliases/tparsedarccommand/) +- [TParsedClosePathCommand](/api/type-aliases/tparsedclosepathcommand/) +- [TParsedCommand](/api/type-aliases/tparsedcommand/) +- [TParsedCubicCurveCommand](/api/type-aliases/tparsedcubiccurvecommand/) +- [TParsedCubicCurveShortcutCommand](/api/type-aliases/tparsedcubiccurveshortcutcommand/) +- [TParsedHorizontalLineCommand](/api/type-aliases/tparsedhorizontallinecommand/) +- [TParsedLineCommand](/api/type-aliases/tparsedlinecommand/) +- [TParsedMoveToCommand](/api/type-aliases/tparsedmovetocommand/) +- [TParsedQuadraticCurveCommand](/api/type-aliases/tparsedquadraticcurvecommand/) +- [TParsedQuadraticCurveShortcutCommand](/api/type-aliases/tparsedquadraticcurveshortcutcommand/) +- [TParsedRelativeArcCommand](/api/type-aliases/tparsedrelativearccommand/) +- [TParsedRelativeClosePathCommand](/api/type-aliases/tparsedrelativeclosepathcommand/) +- [TParsedRelativeCubicCurveCommand](/api/type-aliases/tparsedrelativecubiccurvecommand/) +- [TParsedRelativeCubicCurveShortcutCommand](/api/type-aliases/tparsedrelativecubiccurveshortcutcommand/) +- [TParsedRelativeHorizontalLineCommand](/api/type-aliases/tparsedrelativehorizontallinecommand/) +- [TParsedRelativeLineCommand](/api/type-aliases/tparsedrelativelinecommand/) +- [TParsedRelativeMoveToCommand](/api/type-aliases/tparsedrelativemovetocommand/) +- [TParsedRelativeQuadraticCurveCommand](/api/type-aliases/tparsedrelativequadraticcurvecommand/) +- [TParsedRelativeQuadraticCurveShortcutCommand](/api/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) +- [TParsedRelativeVerticalLineCommand](/api/type-aliases/tparsedrelativeverticallinecommand/) +- [TParsedVerticalLineCommand](/api/type-aliases/tparsedverticallinecommand/) - [TPathAlign](/api/type-aliases/tpathalign/) +- [TPathSegmentCommandInfo](/api/type-aliases/tpathsegmentcommandinfo/) +- [TPathSegmentInfo](/api/type-aliases/tpathsegmentinfo/) +- [TPathSegmentInfoCommon](/api/type-aliases/tpathsegmentinfocommon/) - [TPathSide](/api/type-aliases/tpathside/) - [TPipelineResources](/api/type-aliases/tpipelineresources/) +- [TPointAngle](/api/type-aliases/tpointangle/) - [TPointerEvent](/api/type-aliases/tpointerevent/) - [TPointerEventNames](/api/type-aliases/tpointereventnames/) - [TProgramCache](/api/type-aliases/tprogramcache/) -- [TRGBAColorSource](/api/type-aliases/trgbacolorsource/) -- [TRGBColorSource](/api/type-aliases/trgbcolorsource/) +- [TQuadraticCurveCommand](/api/type-aliases/tquadraticcurvecommand/) +- [TQuadraticCurveShortcutCommand](/api/type-aliases/tquadraticcurveshortcutcommand/) - [TRadian](/api/type-aliases/tradian/) +- [Transform](/api/type-aliases/transform/) +- [TransformAction](/api/type-aliases/transformaction/) +- [TransformActionHandler](/api/type-aliases/transformactionhandler/) - [TRectBounds](/api/type-aliases/trectbounds/) +- [TRGBAColorSource](/api/type-aliases/trgbacolorsource/) +- [TRGBColorSource](/api/type-aliases/trgbcolorsource/) +- [TSimpleParseCommandType](/api/type-aliases/tsimpleparsecommandtype/) +- [TSimpleParsedCommand](/api/type-aliases/tsimpleparsedcommand/) +- [TSimplePathData](/api/type-aliases/tsimplepathdata/) +- [TSize](/api/type-aliases/tsize/) - [TSVGExportOptions](/api/type-aliases/tsvgexportoptions/) - [TSVGReviver](/api/type-aliases/tsvgreviver/) -- [TSize](/api/type-aliases/tsize/) - [TTextureCache](/api/type-aliases/ttexturecache/) - [TToCanvasElementOptions](/api/type-aliases/ttocanvaselementoptions/) - [TValidToObjectMethod](/api/type-aliases/tvalidtoobjectmethod/) +- [TVerticalLineCommand](/api/type-aliases/tverticallinecommand/) - [TWebGLAttributeLocationMap](/api/type-aliases/twebglattributelocationmap/) - [TWebGLPipelineState](/api/type-aliases/twebglpipelinestate/) - [TWebGLProgramCacheItem](/api/type-aliases/twebglprogramcacheitem/) - [TWebGLUniformLocationMap](/api/type-aliases/twebgluniformlocationmap/) -- [TextStyle](/api/type-aliases/textstyle/) -- [TextStyleDeclaration](/api/type-aliases/textstyledeclaration/) -- [Transform](/api/type-aliases/transform/) -- [TransformAction](/api/type-aliases/transformaction/) -- [TransformActionHandler](/api/type-aliases/transformactionhandler/) ## Variables @@ -555,7 +270,6 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) ## Functions - [createCollectionMixin](/api/functions/createcollectionmixin/) -- [getCSSRules](/api/functions/getcssrules/) - [getEnv](/api/functions/getenv/) - [getFabricDocument](/api/functions/getfabricdocument/) - [getFabricWindow](/api/functions/getfabricwindow/) @@ -565,11 +279,24 @@ Renames and re-exports [FabricText](/api/classes/fabrictext/) - [isWebGLPipelineState](/api/functions/iswebglpipelinestate/) - [loadSVGFromString](/api/functions/loadsvgfromstring/) - [loadSVGFromURL](/api/functions/loadsvgfromurl/) -- [parseAttributes](/api/functions/parseattributes/) -- [parseFontDeclaration](/api/functions/parsefontdeclaration/) -- [parsePointsAttribute](/api/functions/parsepointsattribute/) - [parseSVGDocument](/api/functions/parsesvgdocument/) -- [parseStyleAttribute](/api/functions/parsestyleattribute/) -- [parseTransformAttribute](/api/functions/parsetransformattribute/) - [setEnv](/api/functions/setenv/) - [setFilterBackend](/api/functions/setfilterbackend/) + +## References + +### Image + +Renames and re-exports [FabricImage](/api/classes/fabricimage/) + +*** + +### Object + +Renames and re-exports [FabricObject](/api/classes/fabricobject/) + +*** + +### Text + +Renames and re-exports [FabricText](/api/classes/fabrictext/) diff --git a/src/content/docs/api/interfaces/ActiveSelectionOptions.md b/src/content/docs/api/interfaces/ActiveSelectionOptions.md index 6c55dd183..5402e745d 100644 --- a/src/content/docs/api/interfaces/ActiveSelectionOptions.md +++ b/src/content/docs/api/interfaces/ActiveSelectionOptions.md @@ -5,6 +5,8 @@ prev: false title: "ActiveSelectionOptions" --- +Defined in: [src/shapes/ActiveSelection.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L16) + ## Extends - [`GroupProps`](/api/interfaces/groupprops/) @@ -15,6 +17,8 @@ title: "ActiveSelectionOptions" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`GroupProps`](/api/interfaces/groupprops/).[`absolutePositioned`](/api/interfaces/groupprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`GroupProps`](/api/interfaces/groupprops/).[`angle`](/api/interfaces/groupprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`backgroundColor`](/api/interfaces/groupprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`GroupProps`](/api/interfaces/groupprops/).[`borderColor`](/api/interfaces/groupprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`GroupProps`](/api/interfaces/groupprops/).[`borderDashArray`](/api/interfaces/groupprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`GroupProps`](/api/interfaces/groupprops/).[`borderOpacityWhenMoving`](/api/interfaces/groupprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`GroupProps`](/api/interfaces/groupprops/).[`borderScaleFactor`](/api/interfaces/groupprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`canvas`](/api/interfaces/groupprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`centeredRotation`](/api/interfaces/groupprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`centeredScaling`](/api/interfaces/groupprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`GroupProps`](/api/interfaces/groupprops/).[`clipPath`](/api/interfaces/groupprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`GroupProps`](/api/interfaces/groupprops/).[`cornerColor`](/api/interfaces/groupprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`GroupProps`](/api/interfaces/groupprops/).[`cornerDashArray`](/api/interfaces/groupprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`GroupProps`](/api/interfaces/groupprops/).[`cornerSize`](/api/interfaces/groupprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`GroupProps`](/api/interfaces/groupprops/).[`cornerStrokeColor`](/api/interfaces/groupprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,72 +337,50 @@ 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 [`GroupProps`](/api/interfaces/groupprops/).[`cornerStyle`](/api/interfaces/groupprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`GroupProps`](/api/interfaces/groupprops/).[`evented`](/api/interfaces/groupprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`excludeFromExport`](/api/interfaces/groupprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -455,16 +394,14 @@ rgb(0,0,0) [`GroupProps`](/api/interfaces/groupprops/).[`fill`](/api/interfaces/groupprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -479,16 +416,14 @@ nonzero [`GroupProps`](/api/interfaces/groupprops/).[`fillRule`](/api/interfaces/groupprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -501,16 +436,14 @@ false [`GroupProps`](/api/interfaces/groupprops/).[`flipX`](/api/interfaces/groupprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -523,60 +456,42 @@ false [`GroupProps`](/api/interfaces/groupprops/).[`flipY`](/api/interfaces/groupprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`globalCompositeOperation`](/api/interfaces/groupprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`hasBorders`](/api/interfaces/groupprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -589,38 +504,28 @@ true [`GroupProps`](/api/interfaces/groupprops/).[`hasControls`](/api/interfaces/groupprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`height`](/api/interfaces/groupprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -633,52 +538,40 @@ null [`GroupProps`](/api/interfaces/groupprops/).[`hoverCursor`](/api/interfaces/groupprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -```ts - -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`includeDefaultValues`](/api/interfaces/groupprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### interactive > **interactive**: `boolean` +Defined in: [src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L56) + #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`interactive`](/api/interfaces/groupprops/#interactive) -#### Defined in - -[src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L56) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -693,33 +586,29 @@ false [`GroupProps`](/api/interfaces/groupprops/).[`inverted`](/api/interfaces/groupprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### layoutManager > **layoutManager**: [`LayoutManager`](/api/classes/layoutmanager/) +Defined in: [src/shapes/Group.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L67) + #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`layoutManager`](/api/interfaces/groupprops/#layoutmanager) -#### Defined in - -[src/shapes/Group.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L67) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -731,192 +620,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`GroupProps`](/api/interfaces/groupprops/).[`left`](/api/interfaces/groupprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockMovementX`](/api/interfaces/groupprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockMovementY`](/api/interfaces/groupprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockRotation`](/api/interfaces/groupprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockScalingFlip`](/api/interfaces/groupprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -```ts - -``` +When `true`, object horizontal scaling is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockScalingX`](/api/interfaces/groupprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -#### Default - -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockScalingY`](/api/interfaces/groupprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -``` +When `true`, object horizontal skewing is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockSkewingX`](/api/interfaces/groupprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -``` +When `true`, object vertical skewing is locked #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`lockSkewingY`](/api/interfaces/groupprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -929,16 +752,14 @@ Minimum allowed scale value of an object [`GroupProps`](/api/interfaces/groupprops/).[`minScaleLimit`](/api/interfaces/groupprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -951,19 +772,13 @@ null [`GroupProps`](/api/interfaces/groupprops/).[`moveCursor`](/api/interfaces/groupprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### multiSelectionStacking > **multiSelectionStacking**: [`MultiSelectionStacking`](/api/type-aliases/multiselectionstacking/) -#### Defined in - -[src/shapes/ActiveSelection.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L17) +Defined in: [src/shapes/ActiveSelection.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L17) *** @@ -971,6 +786,8 @@ null > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -987,16 +804,14 @@ true [`GroupProps`](/api/interfaces/groupprops/).[`noScaleCache`](/api/interfaces/groupprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1015,16 +830,14 @@ true [`GroupProps`](/api/interfaces/groupprops/).[`objectCaching`](/api/interfaces/groupprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1037,38 +850,32 @@ Opacity of an object [`GroupProps`](/api/interfaces/groupprops/).[`opacity`](/api/interfaces/groupprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`GroupProps`](/api/interfaces/groupprops/).[`originX`](/api/interfaces/groupprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`GroupProps`](/api/interfaces/groupprops/).[`originX`](/api/interfaces/groupprops/#originx) *** @@ -1076,28 +883,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`GroupProps`](/api/interfaces/groupprops/).[`originY`](/api/interfaces/groupprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`GroupProps`](/api/interfaces/groupprops/).[`originY`](/api/interfaces/groupprops/#originy) *** @@ -1105,6 +910,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1117,60 +924,42 @@ Padding between object and its controlling borders (in pixels) [`GroupProps`](/api/interfaces/groupprops/).[`padding`](/api/interfaces/groupprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`paintFirst`](/api/interfaces/groupprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`perPixelTargetFind`](/api/interfaces/groupprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1183,16 +972,14 @@ Object scale factor (horizontal) [`GroupProps`](/api/interfaces/groupprops/).[`scaleX`](/api/interfaces/groupprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1205,48 +992,32 @@ Object scale factor (vertical) [`GroupProps`](/api/interfaces/groupprops/).[`scaleY`](/api/interfaces/groupprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`GroupProps`](/api/interfaces/groupprops/).[`selectable`](/api/interfaces/groupprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1255,16 +1026,14 @@ This API is no longer supported and may be removed in a future release. [`GroupProps`](/api/interfaces/groupprops/).[`selectionBackgroundColor`](/api/interfaces/groupprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1277,16 +1046,14 @@ null [`GroupProps`](/api/interfaces/groupprops/).[`shadow`](/api/interfaces/groupprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1299,16 +1066,14 @@ Angle of skew on x axes of an object (in degrees) [`GroupProps`](/api/interfaces/groupprops/).[`skewX`](/api/interfaces/groupprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1321,32 +1086,28 @@ Angle of skew on y axes of an object (in degrees) [`GroupProps`](/api/interfaces/groupprops/).[`skewY`](/api/interfaces/groupprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`snapAngle`](/api/interfaces/groupprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1354,16 +1115,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`GroupProps`](/api/interfaces/groupprops/).[`snapThreshold`](/api/interfaces/groupprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1377,16 +1136,14 @@ null [`GroupProps`](/api/interfaces/groupprops/).[`stroke`](/api/interfaces/groupprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1399,16 +1156,14 @@ null; [`GroupProps`](/api/interfaces/groupprops/).[`strokeDashArray`](/api/interfaces/groupprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1421,16 +1176,14 @@ Line offset of an object's stroke [`GroupProps`](/api/interfaces/groupprops/).[`strokeDashOffset`](/api/interfaces/groupprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1443,38 +1196,28 @@ butt [`GroupProps`](/api/interfaces/groupprops/).[`strokeLineCap`](/api/interfaces/groupprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`strokeLineJoin`](/api/interfaces/groupprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1487,16 +1230,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`GroupProps`](/api/interfaces/groupprops/).[`strokeMiterLimit`](/api/interfaces/groupprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1522,16 +1263,14 @@ false [`GroupProps`](/api/interfaces/groupprops/).[`strokeUniform`](/api/interfaces/groupprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1544,33 +1283,29 @@ Width of a stroke used to render this object [`GroupProps`](/api/interfaces/groupprops/).[`strokeWidth`](/api/interfaces/groupprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### subTargetCheck > **subTargetCheck**: `boolean` +Defined in: [src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L55) + #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`subTargetCheck`](/api/interfaces/groupprops/#subtargetcheck) -#### Defined in - -[src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L55) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1582,16 +1317,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`GroupProps`](/api/interfaces/groupprops/).[`top`](/api/interfaces/groupprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1604,16 +1337,14 @@ Size of object's controlling corners when touch interaction is detected [`GroupProps`](/api/interfaces/groupprops/).[`touchCornerSize`](/api/interfaces/groupprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1626,50 +1357,30 @@ true [`GroupProps`](/api/interfaces/groupprops/).[`transparentCorners`](/api/interfaces/groupprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`visible`](/api/interfaces/groupprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`GroupProps`](/api/interfaces/groupprops/).[`width`](/api/interfaces/groupprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/BasicTransformEvent.md b/src/content/docs/api/interfaces/BasicTransformEvent.md index 072e74320..229d11dd2 100644 --- a/src/content/docs/api/interfaces/BasicTransformEvent.md +++ b/src/content/docs/api/interfaces/BasicTransformEvent.md @@ -5,13 +5,17 @@ prev: false title: "BasicTransformEvent" --- +Defined in: [src/EventTypeDefs.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L109) + ## Extends - [`TEvent`](/api/interfaces/tevent/)\<`E`\> ## Type Parameters -• **E** *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### E + +`E` *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) ## Properties @@ -19,13 +23,11 @@ title: "BasicTransformEvent" > **e**: `E` -#### Inherited from - -[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e) +Defined in: [src/EventTypeDefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L102) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L96) +[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e-1) *** @@ -33,9 +35,7 @@ title: "BasicTransformEvent" > **pointer**: [`Point`](/api/classes/point/) -#### Defined in - -[src/EventTypeDefs.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L106) +Defined in: [src/EventTypeDefs.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L115) *** @@ -43,6 +43,4 @@ title: "BasicTransformEvent" > **transform**: [`Transform`](/api/type-aliases/transform/) -#### Defined in - -[src/EventTypeDefs.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L105) +Defined in: [src/EventTypeDefs.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L111) diff --git a/src/content/docs/api/interfaces/CanvasEvents.md b/src/content/docs/api/interfaces/CanvasEvents.md index 023e890a4..43e184f43 100644 --- a/src/content/docs/api/interfaces/CanvasEvents.md +++ b/src/content/docs/api/interfaces/CanvasEvents.md @@ -5,6 +5,8 @@ prev: false title: "CanvasEvents" --- +Defined in: [src/EventTypeDefs.ts:318](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L318) + ## Extends - [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`CanvasPointerEvents`](/api/type-aliases/canvaspointerevents/).`CanvasDnDEvents`.[`MiscEvents`](/api/interfaces/miscevents/).`CanvasModificationEvents`.`CanvasSelectionEvents` @@ -15,17 +17,15 @@ title: "CanvasEvents" > **after:render**: `object` +Defined in: [src/EventTypeDefs.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L313) + #### ctx > **ctx**: `CanvasRenderingContext2D` #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`after:render`](/api/interfaces/staticcanvasevents/#after:render) - -#### Defined in - -[src/EventTypeDefs.ts:318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L318) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`after:render`](/api/interfaces/staticcanvasevents/#afterrender) *** @@ -33,13 +33,11 @@ title: "CanvasEvents" > **before:path:created**: `object` -#### path - -> **path**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:326](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L326) -#### Defined in +#### path -[src/EventTypeDefs.ts:331](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L331) +> **path**: [`FabricObject`](/api/classes/fabricobject/) *** @@ -47,17 +45,15 @@ title: "CanvasEvents" > **before:render**: `object` +Defined in: [src/EventTypeDefs.ts:312](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L312) + #### ctx > **ctx**: `CanvasRenderingContext2D` #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`before:render`](/api/interfaces/staticcanvasevents/#before:render) - -#### Defined in - -[src/EventTypeDefs.ts:317](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L317) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`before:render`](/api/interfaces/staticcanvasevents/#beforerender) *** @@ -65,7 +61,9 @@ title: "CanvasEvents" > **before:selection:cleared**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L226) + +#### Type Declaration ##### deselected @@ -75,17 +73,15 @@ title: "CanvasEvents" `CanvasSelectionEvents.before:selection:cleared` -#### Defined in - -[src/EventTypeDefs.ts:241](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L241) - *** ### before:transform > **before:transform**: [`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:151](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L151) + +#### Type Declaration ##### transform @@ -95,23 +91,17 @@ title: "CanvasEvents" `CanvasModificationEvents.before:transform` -#### Defined in - -[src/EventTypeDefs.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L142) - *** ### canvas:cleared > **canvas:cleared**: `never` -#### Inherited from - -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`canvas:cleared`](/api/interfaces/staticcanvasevents/#canvas:cleared) +Defined in: [src/EventTypeDefs.ts:309](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L309) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L314) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`canvas:cleared`](/api/interfaces/staticcanvasevents/#canvascleared) *** @@ -119,27 +109,23 @@ title: "CanvasEvents" > **contextmenu**: `SimpleEventHandler`\<`Event`\> +Defined in: [src/EventTypeDefs.ts:283](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L283) + #### Inherited from [`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu`](/api/interfaces/miscevents/#contextmenu) -#### Defined in - -[src/EventTypeDefs.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L288) - *** ### contextmenu:before > **contextmenu:before**: `SimpleEventHandler`\<`Event`\> -#### Inherited from - -[`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu:before`](/api/interfaces/miscevents/#contextmenu:before) +Defined in: [src/EventTypeDefs.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L282) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L287) +[`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu:before`](/api/interfaces/miscevents/#contextmenubefore) *** @@ -147,175 +133,155 @@ title: "CanvasEvents" > **drag**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L203) + #### Inherited from `CanvasDnDEvents.drag` -#### Defined in - -[src/EventTypeDefs.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L218) - *** ### drag:enter > **drag:enter**: [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` +Defined in: [src/EventTypeDefs.ts:214](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L214) + #### Inherited from `CanvasDnDEvents.drag:enter` -#### Defined in - -[src/EventTypeDefs.ts:229](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L229) - *** ### drag:leave > **drag:leave**: [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` +Defined in: [src/EventTypeDefs.ts:215](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L215) + #### Inherited from `CanvasDnDEvents.drag:leave` -#### Defined in - -[src/EventTypeDefs.ts:230](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L230) - *** ### dragend > **dragend**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L207) + #### Inherited from `CanvasDnDEvents.dragend` -#### Defined in - -[src/EventTypeDefs.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L222) - *** ### dragenter > **dragenter**: [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` +Defined in: [src/EventTypeDefs.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L205) + #### Inherited from `CanvasDnDEvents.dragenter` -#### Defined in - -[src/EventTypeDefs.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L220) - *** ### dragleave > **dragleave**: [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` +Defined in: [src/EventTypeDefs.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L206) + #### Inherited from `CanvasDnDEvents.dragleave` -#### Defined in - -[src/EventTypeDefs.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L221) - *** ### dragover > **dragover**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L204) + #### Inherited from `CanvasDnDEvents.dragover` -#### Defined in - -[src/EventTypeDefs.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L219) - *** ### dragstart > **dragstart**: `TEventWithTarget`\<`DragEvent`\> +Defined in: [src/EventTypeDefs.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L202) + #### Inherited from `CanvasDnDEvents.dragstart` -#### Defined in - -[src/EventTypeDefs.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L217) - *** ### drop > **drop**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L209) + #### Inherited from `CanvasDnDEvents.drop` -#### Defined in - -[src/EventTypeDefs.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L224) - *** ### drop:after > **drop:after**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L210) + #### Inherited from `CanvasDnDEvents.drop:after` -#### Defined in - -[src/EventTypeDefs.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L225) - *** ### drop:before > **drop:before**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L208) + #### Inherited from `CanvasDnDEvents.drop:before` -#### Defined in - -[src/EventTypeDefs.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L223) - *** ### erasing:end > **erasing:end**: `object` +Defined in: [src/EventTypeDefs.ts:331](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L331) + #### drawables > **drawables**: `object` -#### drawables.backgroundImage? +##### drawables.backgroundImage? > `optional` **backgroundImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### drawables.overlayImage? +##### drawables.overlayImage? > `optional` **overlayImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> #### path -> **path**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **path**: [`FabricObject`](/api/classes/fabricobject/) #### subTargets @@ -325,19 +291,13 @@ title: "CanvasEvents" > **targets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] -#### Defined in - -[src/EventTypeDefs.ts:336](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L336) - *** ### erasing:start > **erasing:start**: `never` -#### Defined in - -[src/EventTypeDefs.ts:335](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L335) +Defined in: [src/EventTypeDefs.ts:330](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L330) *** @@ -353,11 +313,20 @@ title: "CanvasEvents" ### mouse:down -> **mouse:down**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **mouse:down**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` + +#### Type Declaration + +##### alreadySelected + +> **alreadySelected**: `boolean` + +Indicates if the target or current target where already selected +before the cycle of mouse down -> mouse up started #### Inherited from -`CanvasPointerEvents.mouse:down` +[`CanvasEvents`](/api/interfaces/canvasevents/).[`mouse:down`](/api/interfaces/canvasevents/#mousedown) *** @@ -411,19 +380,21 @@ title: "CanvasEvents" *** -### mouse:up +### mouse:tripleclick -> **mouse:up**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` +> **mouse:tripleclick**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> -#### Type declaration +#### Inherited from -##### currentSubTargets +`CanvasPointerEvents.mouse:tripleclick` -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +*** -##### currentTarget? +### mouse:up -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **mouse:up**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` + +#### Type Declaration ##### isClick @@ -439,15 +410,7 @@ title: "CanvasEvents" > **mouse:up:before**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration - -##### currentSubTargets - -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] - -##### currentTarget? - -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +#### Type Declaration ##### isClick @@ -473,17 +436,15 @@ title: "CanvasEvents" > **object:added**: `object` +Defined in: [src/EventTypeDefs.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L235) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:added`](/api/interfaces/staticcanvasevents/#object:added) - -#### Defined in - -[src/EventTypeDefs.ts:250](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L250) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:added`](/api/interfaces/staticcanvasevents/#objectadded) *** @@ -491,7 +452,9 @@ title: "CanvasEvents" > **object:layout:after**: [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:315](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L315) + +#### Type Declaration ##### target @@ -499,11 +462,7 @@ title: "CanvasEvents" #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:layout:after`](/api/interfaces/staticcanvasevents/#object:layout:after) - -#### Defined in - -[src/EventTypeDefs.ts:320](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L320) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:layout:after`](/api/interfaces/staticcanvasevents/#objectlayoutafter) *** @@ -511,7 +470,9 @@ title: "CanvasEvents" > **object:layout:before**: [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:314](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L314) + +#### Type Declaration ##### target @@ -519,103 +480,89 @@ title: "CanvasEvents" #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:layout:before`](/api/interfaces/staticcanvasevents/#object:layout:before) - -#### Defined in - -[src/EventTypeDefs.ts:319](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L319) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:layout:before`](/api/interfaces/staticcanvasevents/#objectlayoutbefore) *** ### object:modified -> **object:modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **object:modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/) + +Defined in: [src/EventTypeDefs.ts:161](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L161) #### Inherited from `CanvasModificationEvents.object:modified` -#### Defined in - -[src/EventTypeDefs.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L152) - *** ### object:modifyPath > **object:modifyPath**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) -#### Type declaration +Defined in: [src/EventTypeDefs.ts:158](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L158) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:modifyPath` -#### Defined in - -[src/EventTypeDefs.ts:149](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L149) - *** ### object:modifyPoly > **object:modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:157](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L157) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:modifyPoly` -#### Defined in - -[src/EventTypeDefs.ts:148](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L148) - *** ### object:moving > **object:moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:152](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L152) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:moving` -#### Defined in - -[src/EventTypeDefs.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L143) - *** ### object:removed > **object:removed**: `object` +Defined in: [src/EventTypeDefs.ts:236](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L236) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:removed`](/api/interfaces/staticcanvasevents/#object:removed) - -#### Defined in - -[src/EventTypeDefs.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L251) +[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/).[`object:removed`](/api/interfaces/staticcanvasevents/#objectremoved) *** @@ -623,93 +570,83 @@ title: "CanvasEvents" > **object:resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:156](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L156) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:resizing` -#### Defined in - -[src/EventTypeDefs.ts:147](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L147) - *** ### object:rotating > **object:rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:154](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L154) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:rotating` -#### Defined in - -[src/EventTypeDefs.ts:145](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L145) - *** ### object:scaling > **object:scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:153](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L153) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:scaling` -#### Defined in - -[src/EventTypeDefs.ts:144](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L144) - *** ### object:skewing > **object:skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:155](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L155) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from `CanvasModificationEvents.object:skewing` -#### Defined in - -[src/EventTypeDefs.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L146) - *** ### path:created > **path:created**: `object` -#### path - -> **path**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:327](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L327) -#### Defined in +#### path -[src/EventTypeDefs.ts:332](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L332) +> **path**: [`FabricObject`](/api/classes/fabricobject/) *** @@ -717,7 +654,9 @@ title: "CanvasEvents" > **selection:cleared**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:229](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L229) + +#### Type Declaration ##### deselected @@ -727,17 +666,15 @@ title: "CanvasEvents" `CanvasSelectionEvents.selection:cleared` -#### Defined in - -[src/EventTypeDefs.ts:244](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L244) - *** ### selection:created > **selection:created**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:219](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L219) + +#### Type Declaration ##### selected @@ -747,17 +684,15 @@ title: "CanvasEvents" `CanvasSelectionEvents.selection:created` -#### Defined in - -[src/EventTypeDefs.ts:234](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L234) - *** ### selection:updated > **selection:updated**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:222](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L222) + +#### Type Declaration ##### deselected @@ -771,53 +706,43 @@ title: "CanvasEvents" `CanvasSelectionEvents.selection:updated` -#### Defined in - -[src/EventTypeDefs.ts:237](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L237) - *** -### text:changed +### text:editing:entered -> **text:changed**: `object` +> **text:editing:entered**: `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> -#### target +Defined in: [src/EventTypeDefs.ts:346](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L346) -> **target**: [`IText`](/api/classes/itext/)\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\> +#### Type Declaration -#### Defined in +##### target -[src/EventTypeDefs.ts:350](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L350) +> **target**: [`IText`](/api/classes/itext/) *** -### text:editing:entered - -> **text:editing:entered**: `object` & `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> - -#### Type declaration +### text:editing:exited -##### target +> **text:editing:exited**: `object` -> **target**: [`IText`](/api/classes/itext/)\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\> +Defined in: [src/EventTypeDefs.ts:347](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L347) -#### Defined in +#### target -[src/EventTypeDefs.ts:351](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L351) +> **target**: [`IText`](/api/classes/itext/) *** -### text:editing:exited - -> **text:editing:exited**: `object` +### text:changed -#### target +> **text:changed**: `object` -> **target**: [`IText`](/api/classes/itext/)\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\> +Defined in: [src/EventTypeDefs.ts:345](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L345) -#### Defined in +#### target -[src/EventTypeDefs.ts:352](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L352) +> **target**: [`IText`](/api/classes/itext/) *** @@ -825,10 +750,8 @@ title: "CanvasEvents" > **text:selection:changed**: `object` -#### target - -> **target**: [`IText`](/api/classes/itext/)\<`Partial`\<[`ITextProps`](/api/interfaces/itextprops/)\>, [`SerializedITextProps`](/api/interfaces/serializeditextprops/), [`ITextEvents`](/api/type-aliases/itextevents/)\> +Defined in: [src/EventTypeDefs.ts:344](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L344) -#### Defined in +#### target -[src/EventTypeDefs.ts:349](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L349) +> **target**: [`IText`](/api/classes/itext/) diff --git a/src/content/docs/api/interfaces/CanvasOptions.md b/src/content/docs/api/interfaces/CanvasOptions.md index cafa4a0e6..601b178da 100644 --- a/src/content/docs/api/interfaces/CanvasOptions.md +++ b/src/content/docs/api/interfaces/CanvasOptions.md @@ -5,6 +5,8 @@ prev: false title: "CanvasOptions" --- +Defined in: [src/canvas/CanvasOptions.ts:229](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L229) + ## Extends - [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).`CanvasTransformOptions`.`CanvasSelectionOptions`.`CanvasCursorOptions`.`TargetFindOptions`.`CanvasEventsOptions` @@ -15,17 +17,13 @@ title: "CanvasOptions" > **allowTouchScrolling**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:150](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L150) + Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas It gives PRIORITY to DOM scrolling, it doesn't make it always possible. If is true, when using a touch event on the canvas, the canvas will scroll if scroll is possible. If we are in drawing mode or if we are selecting an object the canvas preventDefault and so it won't scroll -#### Default - -```ts - -``` - #### Todo move to Canvas @@ -34,16 +32,14 @@ move to Canvas [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`allowTouchScrolling`](/api/interfaces/staticcanvasoptions/#allowtouchscrolling) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L163) - *** ### altActionKey > **altActionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) +Defined in: [src/canvas/CanvasOptions.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L61) + 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 @@ -53,28 +49,22 @@ feature is disabled feature disabled. 1.6.2 -#### Default - -```ts - -``` - #### Inherited from `CanvasTransformOptions.altActionKey` -#### Defined in - -[src/canvas/CanvasOptions.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L67) - *** ### altSelectionKey > **altSelectionKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) +Defined in: [src/canvas/CanvasOptions.ts:95](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L95) + 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. @@ -85,73 +75,49 @@ feature is disabled. 1.6.5 -#### Default - -```ts - -``` - #### Inherited from `CanvasSelectionOptions.altSelectionKey` -#### Defined in - -[src/canvas/CanvasOptions.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L102) - *** ### backgroundColor > **backgroundColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/) -Background color of canvas instance. - -#### Default - -```ts +Defined in: [src/canvas/StaticCanvasOptions.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L18) -``` +Background color of canvas instance. #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundColor`](/api/interfaces/staticcanvasoptions/#backgroundcolor) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L20) - *** ### backgroundImage? > `optional` **backgroundImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L27) + 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 - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundImage`](/api/interfaces/staticcanvasoptions/#backgroundimage) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L30) - *** ### backgroundVpt > **backgroundVpt**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L12) + if set to false background image is not affected by viewport transform #### Since @@ -162,26 +128,18 @@ if set to false background image is not affected by viewport transform we should really find a different way to do this -#### Default - -```ts - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`backgroundVpt`](/api/interfaces/staticcanvasoptions/#backgroundvpt) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L13) - *** ### centeredKey > **centeredKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) +Defined in: [src/canvas/CanvasOptions.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L51) + Indicates which key enable centered Transform values: 'altKey', 'shiftKey', 'ctrlKey'. If `null` or 'none' or any other string that is not a modifier key @@ -191,26 +149,18 @@ feature is disabled feature disabled. 1.6.2 -#### Default - -```ts - -``` - #### Inherited from `CanvasTransformOptions.centeredKey` -#### Defined in - -[src/canvas/CanvasOptions.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L56) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L41) + When true, objects use center point as the origin of rotate transformation. Backwards incompatibility note: This property replaces "centerTransform" (Boolean). @@ -218,26 +168,18 @@ When true, objects use center point as the origin of rotate transformation. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `CanvasTransformOptions.centeredRotation` -#### Defined in - -[src/canvas/CanvasOptions.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L45) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L33) + When true, objects use center point as the origin of scale transformation. Backwards incompatibility note: This property replaces "centerTransform" (Boolean). @@ -245,26 +187,18 @@ When true, objects use center point as the origin of scale transformation. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `CanvasTransformOptions.centeredScaling` -#### Defined in - -[src/canvas/CanvasOptions.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L96) + 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. @@ -274,45 +208,29 @@ clipPath will clip away controls, if you do not want this to happen use controls [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`clipPath`](/api/interfaces/staticcanvasoptions/#clippath) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L105) - *** ### ~~containerClass~~ > **containerClass**: `string` -Default element class that's given to wrapper (div) element of canvas - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:241](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L241) -```ts - -``` +Default element class that's given to wrapper (div) element of canvas :::caution[Deprecated] customize [CanvasDOMManager](/api/classes/canvasdommanager/) instead or access elements directly ::: -#### Defined in - -[src/canvas/CanvasOptions.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L251) - *** ### controlsAboveOverlay > **controlsAboveOverlay**: `boolean` -Indicates whether object controls (borders/controls) are rendered above overlay image - -#### Default - -```ts +Defined in: [src/canvas/StaticCanvasOptions.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L139) -``` +Indicates whether object controls (borders/controls) are rendered above overlay image #### Todo @@ -322,16 +240,14 @@ move to Canvas [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`controlsAboveOverlay`](/api/interfaces/staticcanvasoptions/#controlsaboveoverlay) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L151) - *** ### defaultCursor > **defaultCursor**: `string` +Defined in: [src/canvas/CanvasOptions.ts:149](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L149) + Default cursor value used for the entire canvas #### Default @@ -344,112 +260,96 @@ default `CanvasCursorOptions.defaultCursor` -#### Defined in - -[src/canvas/CanvasOptions.ts:160](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L160) - *** ### enablePointerEvents > **enablePointerEvents**: `boolean` -When the option is enabled, PointerEvent is used instead of TPointerEvent. - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:226](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L226) -```ts - -``` +When the option is enabled, PointerEvent is used instead of TPointerEvent. #### Inherited from `CanvasEventsOptions.enablePointerEvents` -#### Defined in - -[src/canvas/CanvasOptions.ts:235](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L235) - *** ### enableRetinaScaling > **enableRetinaScaling**: `boolean` -When true, canvas is scaled by devicePixelRatio for better rendering on retina screens - -#### Default - -```ts +Defined in: [src/canvas/StaticCanvasOptions.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L81) -``` +When true, canvas is scaled by devicePixelRatio for better rendering on retina screens #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`enableRetinaScaling`](/api/interfaces/staticcanvasoptions/#enableretinascaling) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L89) - *** -### fireMiddleClick +### ~~fireMiddleClick~~ > **fireMiddleClick**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:220](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L220) + 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 #### Inherited from `CanvasEventsOptions.fireMiddleClick` -#### Defined in - -[src/canvas/CanvasOptions.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L228) - *** -### fireRightClick +### ~~fireRightClick~~ > **fireRightClick**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L210) + 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 #### Inherited from `CanvasEventsOptions.fireRightClick` -#### Defined in - -[src/canvas/CanvasOptions.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L220) - *** ### freeDrawingCursor > **freeDrawingCursor**: `string` +Defined in: [src/canvas/CanvasOptions.ts:156](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L156) + Cursor value used during free drawing #### Default @@ -462,16 +362,14 @@ crosshair `CanvasCursorOptions.freeDrawingCursor` -#### Defined in - -[src/canvas/CanvasOptions.ts:167](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L167) - *** ### height > **height**: `number` +Defined in: [src/canvas/StaticCanvasOptions.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L131) + Height in virtual/logical pixels of the canvas. The canvas can be taller than width if retina scaling is active @@ -479,16 +377,14 @@ The canvas can be taller than width if retina scaling is active [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`height`](/api/interfaces/staticcanvasoptions/#height) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L142) - *** ### hoverCursor > **hoverCursor**: `string` +Defined in: [src/canvas/CanvasOptions.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L135) + Default cursor value used when hovering over an object on canvas #### Default @@ -501,61 +397,43 @@ move `CanvasCursorOptions.hoverCursor` -#### Defined in - -[src/canvas/CanvasOptions.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L146) - *** ### imageSmoothingEnabled > **imageSmoothingEnabled**: `boolean` -Indicates whether this canvas will use image smoothing, this is on by default in browsers - -#### Default - -```ts +Defined in: [src/canvas/StaticCanvasOptions.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L87) -``` +Indicates whether this canvas will use image smoothing, this is on by default in browsers #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`imageSmoothingEnabled`](/api/interfaces/staticcanvasoptions/#imagesmoothingenabled) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L96) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L105) + Indicates whether toObject/toDatalessObject should include default values if set to false, takes precedence over the object value. -#### Default - -```ts - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`includeDefaultValues`](/api/interfaces/staticcanvasoptions/#includedefaultvalues) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L115) - *** ### moveCursor > **moveCursor**: `string` +Defined in: [src/canvas/CanvasOptions.ts:142](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L142) + Default cursor value used when moving an object on canvas #### Default @@ -568,16 +446,14 @@ move `CanvasCursorOptions.moveCursor` -#### Defined in - -[src/canvas/CanvasOptions.ts:153](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L153) - *** ### notAllowedCursor > **notAllowedCursor**: `string` +Defined in: [src/canvas/CanvasOptions.ts:164](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L164) + Cursor value used for disabled elements ( corners with disabled action ) #### Since @@ -594,67 +470,49 @@ not-allowed `CanvasCursorOptions.notAllowedCursor` -#### Defined in - -[src/canvas/CanvasOptions.ts:175](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L175) - *** ### overlayColor > **overlayColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/canvas/StaticCanvasOptions.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L42) + Overlay color of canvas instance. #### Since 1.3.9 -#### Default - -```ts - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayColor`](/api/interfaces/staticcanvasoptions/#overlaycolor) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L47) - *** ### overlayImage? > `optional` **overlayImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L51) + 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 - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayImage`](/api/interfaces/staticcanvasoptions/#overlayimage) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L57) - *** ### overlayVpt > **overlayVpt**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L35) + if set to false overlay image is not affected by viewport transform #### Since @@ -665,160 +523,110 @@ if set to false overlay image is not affected by viewport transform we should really find a different way to do this -#### Default - -```ts - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`overlayVpt`](/api/interfaces/staticcanvasoptions/#overlayvpt) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L39) - *** ### perPixelTargetFind > **perPixelTargetFind**: `boolean` -When true, object detection happens on per-pixel basis rather than on per-bounding-box - -#### Default - -```ts +Defined in: [src/canvas/CanvasOptions.ts:172](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L172) -``` +When true, object detection happens on per-pixel basis rather than on per-bounding-box #### Inherited from `TargetFindOptions.perPixelTargetFind` -#### Defined in - -[src/canvas/CanvasOptions.ts:184](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L184) - *** ### preserveObjectStacking > **preserveObjectStacking**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:249](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L249) + 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 ``` -#### Defined in - -[src/canvas/CanvasOptions.ts:259](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L259) - *** ### 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/StaticCanvasOptions.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L64) + +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 - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`renderOnAddRemove`](/api/interfaces/staticcanvasoptions/#renderonaddremove) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L71) - *** ### selection > **selection**: `boolean` -Indicates whether group selection should be enabled - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L69) -```ts - -``` +Indicates whether group selection should be enabled #### Inherited from `CanvasSelectionOptions.selection` -#### Defined in - -[src/canvas/CanvasOptions.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L76) - *** ### selectionBorderColor > **selectionBorderColor**: `string` -Color of the border of selection (usually slightly darker than color of selection itself) - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:114](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L114) -```ts - -``` +Color of the border of selection (usually slightly darker than color of selection itself) #### Inherited from `CanvasSelectionOptions.selectionBorderColor` -#### Defined in - -[src/canvas/CanvasOptions.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L123) - *** ### selectionColor > **selectionColor**: `string` -Color of selection - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L101) -```ts - -``` +Color of selection #### Inherited from `CanvasSelectionOptions.selectionColor` -#### Defined in - -[src/canvas/CanvasOptions.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L109) - *** ### selectionDashArray > **selectionDashArray**: `number`[] +Defined in: [src/canvas/CanvasOptions.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L108) + Default dash array pattern If not empty the selection border is dashed @@ -826,37 +634,27 @@ If not empty the selection border is dashed `CanvasSelectionOptions.selectionDashArray` -#### Defined in - -[src/canvas/CanvasOptions.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L116) - *** ### selectionFullyContained > **selectionFullyContained**: `boolean` -Select only shapes that are fully contained in the dragged selection rectangle. - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:126](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L126) -```ts - -``` +Select only shapes that are fully contained in the dragged selection rectangle. #### Inherited from `CanvasSelectionOptions.selectionFullyContained` -#### Defined in - -[src/canvas/CanvasOptions.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L137) - *** ### 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/CanvasOptions.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L80) Indicates which key or keys enable multiple click selection Pass value as a string or array of strings @@ -868,48 +666,32 @@ feature is disabled. 1.6.2 -#### Default - -```ts - -``` - #### Inherited from `CanvasSelectionOptions.selectionKey` -#### Defined in - -[src/canvas/CanvasOptions.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L88) - *** ### selectionLineWidth > **selectionLineWidth**: `number` -Width of a line used in object/group selection - -#### Default +Defined in: [src/canvas/CanvasOptions.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L120) -```ts - -``` +Width of a line used in object/group selection #### Inherited from `CanvasSelectionOptions.selectionLineWidth` -#### Defined in - -[src/canvas/CanvasOptions.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L130) - *** ### skipOffscreen > **skipOffscreen**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L75) + 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 @@ -926,106 +708,98 @@ true [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`skipOffscreen`](/api/interfaces/staticcanvasoptions/#skipoffscreen) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L82) - *** ### skipTargetFind > **skipTargetFind**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L188) + 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 - -``` - #### Inherited from `TargetFindOptions.skipTargetFind` -#### Defined in - -[src/canvas/CanvasOptions.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L202) - *** -### stopContextMenu +### ~~stopContextMenu~~ > **stopContextMenu**: `boolean` +Defined in: [src/canvas/CanvasOptions.ts:200](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L200) + 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 #### Inherited from `CanvasEventsOptions.stopContextMenu` -#### Defined in - -[src/canvas/CanvasOptions.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L212) - *** ### svgViewportTransformation > **svgViewportTransformation**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L112) + 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 - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`svgViewportTransformation`](/api/interfaces/staticcanvasoptions/#svgviewporttransformation) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L123) - *** ### targetFindTolerance > **targetFindTolerance**: `number` +Defined in: [src/canvas/CanvasOptions.ts:178](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L178) + Number of pixels around target pixel to tolerate (consider active) during object detection -#### Default +#### Inherited from -```ts +`TargetFindOptions.targetFindTolerance` -``` +*** -#### Inherited from +### uniformScaling -`TargetFindOptions.targetFindTolerance` +> **uniformScaling**: `boolean` + +Defined in: [src/canvas/CanvasOptions.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L12) + +When true, objects can be transformed by one side (unproportionately) +when dragged on the corners that normally would not do that. + +#### Since -#### Defined in +fabric 4.0 // changed name and default value -[src/canvas/CanvasOptions.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L191) +#### Inherited from + +`CanvasTransformOptions.uniformScaling` *** @@ -1033,6 +807,8 @@ Number of pixels around target pixel to tolerate (consider active) during object > **uniScaleKey**: [`TOptionalModifierKey`](/api/type-aliases/toptionalmodifierkey/) +Defined in: [src/canvas/CanvasOptions.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/CanvasOptions.ts#L25) + Indicates which key switches uniform scaling. values: 'altKey', 'shiftKey', 'ctrlKey'. If `null` or 'none' or any other string that is not a modifier key @@ -1045,53 +821,18 @@ and viceversa. 1.6.2 -#### Default - -```ts - -``` - #### Inherited from `CanvasTransformOptions.uniScaleKey` -#### Defined in - -[src/canvas/CanvasOptions.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L27) - -*** - -### 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 - -#### Inherited from - -`CanvasTransformOptions.uniformScaling` - -#### Defined in - -[src/canvas/CanvasOptions.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/CanvasOptions.ts#L13) - *** ### viewportTransform > **viewportTransform**: [`TMat2D`](/api/type-aliases/tmat2d/) +Defined in: [src/canvas/StaticCanvasOptions.ts:160](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L160) + The transformation (a Canvas 2D API transform matrix) which focuses the viewport #### Examples @@ -1104,33 +845,21 @@ canvas.viewportTransform = [1, 0, 0, 1, 0, 0]; canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50]; ``` -#### Default - -```ts - -``` - #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`viewportTransform`](/api/interfaces/staticcanvasoptions/#viewporttransform) -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L174) - *** ### width > **width**: `number` +Defined in: [src/canvas/StaticCanvasOptions.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L124) + Width in virtual/logical pixels of the canvas. The canvas can be larger than width if retina scaling is active #### Inherited from [`StaticCanvasOptions`](/api/interfaces/staticcanvasoptions/).[`width`](/api/interfaces/staticcanvasoptions/#width) - -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:135](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L135) diff --git a/src/content/docs/api/interfaces/CircleProps.md b/src/content/docs/api/interfaces/CircleProps.md index 84253fd86..54e99bb33 100644 --- a/src/content/docs/api/interfaces/CircleProps.md +++ b/src/content/docs/api/interfaces/CircleProps.md @@ -5,6 +5,8 @@ prev: false title: "CircleProps" --- +Defined in: [src/shapes/Circle.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L49) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniqueCircleProps` @@ -15,6 +17,8 @@ title: "CircleProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,24 +337,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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### counterClockwise > **counterClockwise**: `boolean` +Defined in: [src/shapes/Circle.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L42) + 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. @@ -408,16 +363,14 @@ false `UniqueCircleProps.counterClockwise` -#### Defined in - -[src/shapes/Circle.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L42) - *** ### endAngle > **endAngle**: `number` +Defined in: [src/shapes/Circle.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L34) + Angle for the end of the circle, in degrees #### Default @@ -430,64 +383,46 @@ Angle for the end of the circle, in degrees `UniqueCircleProps.endAngle` -#### Defined in - -[src/shapes/Circle.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L34) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -#### Default - -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -501,16 +436,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -525,16 +458,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -547,16 +478,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -569,60 +498,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -635,38 +546,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -679,38 +580,28 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -```ts - -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -725,19 +616,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -749,192 +638,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -#### Default - -```ts - -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -947,16 +770,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -969,16 +790,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -995,16 +814,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1023,16 +840,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1045,38 +860,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1084,28 +893,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1113,6 +920,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1125,60 +934,42 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### perPixelTargetFind > **perPixelTargetFind**: `boolean` -When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box - -#### Default +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -```ts - -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### radius > **radius**: `number` +Defined in: [src/shapes/Circle.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L20) + Radius of this circle #### Default @@ -1191,16 +982,14 @@ Radius of this circle `UniqueCircleProps.radius` -#### Defined in - -[src/shapes/Circle.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L20) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1213,16 +1002,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1235,48 +1022,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1285,16 +1056,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1307,16 +1076,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1329,16 +1096,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1351,32 +1116,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1384,16 +1145,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### startAngle > **startAngle**: `number` +Defined in: [src/shapes/Circle.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L27) + Angle for the start of the circle, in degrees. #### Default @@ -1406,16 +1165,14 @@ Angle for the start of the circle, in degrees. `UniqueCircleProps.startAngle` -#### Defined in - -[src/shapes/Circle.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L27) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1429,16 +1186,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1451,16 +1206,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1473,16 +1226,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1495,38 +1246,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1539,16 +1280,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1574,16 +1313,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1596,19 +1333,17 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1620,16 +1355,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1642,16 +1375,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1664,50 +1395,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/CollectionEvents.md b/src/content/docs/api/interfaces/CollectionEvents.md index b592b11b4..492daad8e 100644 --- a/src/content/docs/api/interfaces/CollectionEvents.md +++ b/src/content/docs/api/interfaces/CollectionEvents.md @@ -5,10 +5,12 @@ prev: false title: "CollectionEvents" --- +Defined in: [src/EventTypeDefs.ts:234](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L234) + ## Extended by -- [`GroupEvents`](/api/interfaces/groupevents/) - [`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/) +- [`GroupEvents`](/api/interfaces/groupevents/) ## Properties @@ -16,13 +18,11 @@ title: "CollectionEvents" > **object:added**: `object` -#### target - -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L235) -#### Defined in +#### target -[src/EventTypeDefs.ts:250](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L250) +> **target**: [`FabricObject`](/api/classes/fabricobject/) *** @@ -30,10 +30,8 @@ title: "CollectionEvents" > **object:removed**: `object` -#### target - -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:236](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L236) -#### Defined in +#### target -[src/EventTypeDefs.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L251) +> **target**: [`FabricObject`](/api/classes/fabricobject/) diff --git a/src/content/docs/api/interfaces/DragEventData.md b/src/content/docs/api/interfaces/DragEventData.md index 4b7f875ff..cc903d39c 100644 --- a/src/content/docs/api/interfaces/DragEventData.md +++ b/src/content/docs/api/interfaces/DragEventData.md @@ -5,6 +5,8 @@ prev: false title: "DragEventData" --- +Defined in: [src/EventTypeDefs.ts:187](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L187) + ## Extends - [`TEvent`](/api/interfaces/tevent/)\<`DragEvent`\> @@ -19,9 +21,7 @@ title: "DragEventData" > `optional` **canDrop**: `boolean` -#### Defined in - -[src/EventTypeDefs.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L194) +Defined in: [src/EventTypeDefs.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L191) *** @@ -29,9 +29,7 @@ title: "DragEventData" > `optional` **didDrop**: `boolean` -#### Defined in - -[src/EventTypeDefs.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L195) +Defined in: [src/EventTypeDefs.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L192) *** @@ -39,9 +37,7 @@ title: "DragEventData" > `optional` **dragSource**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:193](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L193) +Defined in: [src/EventTypeDefs.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L190) *** @@ -49,9 +45,7 @@ title: "DragEventData" > `optional` **dropTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L196) +Defined in: [src/EventTypeDefs.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L193) *** @@ -59,13 +53,11 @@ title: "DragEventData" > **e**: `DragEvent` -#### Inherited from - -[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e) +Defined in: [src/EventTypeDefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L102) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L96) +[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e-1) *** @@ -73,9 +65,7 @@ title: "DragEventData" > `optional` **subTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] -#### Defined in - -[src/EventTypeDefs.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L192) +Defined in: [src/EventTypeDefs.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L189) *** @@ -83,6 +73,4 @@ title: "DragEventData" > `optional` **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L191) +Defined in: [src/EventTypeDefs.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L188) diff --git a/src/content/docs/api/interfaces/DropEventData.md b/src/content/docs/api/interfaces/DropEventData.md index bba100ea0..0bccc8911 100644 --- a/src/content/docs/api/interfaces/DropEventData.md +++ b/src/content/docs/api/interfaces/DropEventData.md @@ -5,119 +5,79 @@ prev: false title: "DropEventData" --- +Defined in: [src/EventTypeDefs.ts:196](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L196) + ## Extends - [`DragEventData`](/api/interfaces/drageventdata/) ## Properties -### ~~absolutePointer~~ - -> **absolutePointer**: [`Point`](/api/classes/point/) - -:::caution[Deprecated] -use scenePoint instead. -Kept for compatibility -::: - -#### Defined in - -[src/EventTypeDefs.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L211) - -*** - ### canDrop? > `optional` **canDrop**: `boolean` +Defined in: [src/EventTypeDefs.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L191) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`canDrop`](/api/interfaces/drageventdata/#candrop) -#### Defined in - -[src/EventTypeDefs.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L194) - *** ### didDrop? > `optional` **didDrop**: `boolean` +Defined in: [src/EventTypeDefs.ts:192](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L192) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`didDrop`](/api/interfaces/drageventdata/#diddrop) -#### Defined in - -[src/EventTypeDefs.ts:195](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L195) - *** ### dragSource? > `optional` **dragSource**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:190](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L190) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`dragSource`](/api/interfaces/drageventdata/#dragsource) -#### Defined in - -[src/EventTypeDefs.ts:193](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L193) - *** ### dropTarget? > `optional` **dropTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:193](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L193) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`dropTarget`](/api/interfaces/drageventdata/#droptarget) -#### Defined in - -[src/EventTypeDefs.ts:196](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L196) - *** ### e > **e**: `DragEvent` +Defined in: [src/EventTypeDefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L102) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`e`](/api/interfaces/drageventdata/#e) -#### Defined in - -[src/EventTypeDefs.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L96) - -*** - -### ~~pointer~~ - -> **pointer**: [`Point`](/api/classes/point/) - -:::caution[Deprecated] -use viewportPoint instead. -Kept for compatibility -::: - -#### Defined in - -[src/EventTypeDefs.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L205) - *** ### scenePoint > **scenePoint**: [`Point`](/api/classes/point/) -#### Defined in - -[src/EventTypeDefs.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L212) +Defined in: [src/EventTypeDefs.ts:197](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L197) *** @@ -125,34 +85,28 @@ Kept for compatibility > `optional` **subTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +Defined in: [src/EventTypeDefs.ts:189](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L189) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`subTargets`](/api/interfaces/drageventdata/#subtargets) -#### Defined in - -[src/EventTypeDefs.ts:192](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L192) - *** ### target? > `optional` **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L188) + #### Inherited from [`DragEventData`](/api/interfaces/drageventdata/).[`target`](/api/interfaces/drageventdata/#target) -#### Defined in - -[src/EventTypeDefs.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L191) - *** ### viewportPoint > **viewportPoint**: [`Point`](/api/classes/point/) -#### Defined in - -[src/EventTypeDefs.ts:213](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L213) +Defined in: [src/EventTypeDefs.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L198) diff --git a/src/content/docs/api/interfaces/EllipseProps.md b/src/content/docs/api/interfaces/EllipseProps.md index 02f933fcf..a90cfccef 100644 --- a/src/content/docs/api/interfaces/EllipseProps.md +++ b/src/content/docs/api/interfaces/EllipseProps.md @@ -5,6 +5,8 @@ prev: false title: "EllipseProps" --- +Defined in: [src/shapes/Ellipse.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L25) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniqueEllipseProps` @@ -15,6 +17,8 @@ title: "EllipseProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,72 +337,50 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -455,16 +394,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -479,16 +416,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -501,16 +436,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -523,60 +456,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -589,38 +504,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -633,38 +538,28 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -679,19 +574,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -703,192 +596,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -#### Default - -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -#### Default - -```ts - -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -```ts - -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -901,16 +728,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -923,16 +748,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -949,16 +772,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -977,16 +798,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -999,38 +818,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1038,28 +851,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1067,6 +878,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1079,88 +892,66 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### rx > **rx**: `number` +Defined in: [src/shapes/Ellipse.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L17) + #### Inherited from `UniqueEllipseProps.rx` -#### Defined in - -[src/shapes/Ellipse.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L17) - *** ### ry > **ry**: `number` +Defined in: [src/shapes/Ellipse.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L18) + #### Inherited from `UniqueEllipseProps.ry` -#### Defined in - -[src/shapes/Ellipse.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L18) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1173,16 +964,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1195,48 +984,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1245,16 +1018,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1267,16 +1038,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1289,16 +1058,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1311,32 +1078,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1344,16 +1107,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1367,16 +1128,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1389,16 +1148,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1411,16 +1168,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1433,38 +1188,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1477,16 +1222,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1512,16 +1255,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1534,19 +1275,17 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1558,16 +1297,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1580,16 +1317,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1602,50 +1337,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/FabricObjectProps.md b/src/content/docs/api/interfaces/FabricObjectProps.md index eba643a59..07d8f813e 100644 --- a/src/content/docs/api/interfaces/FabricObjectProps.md +++ b/src/content/docs/api/interfaces/FabricObjectProps.md @@ -5,6 +5,8 @@ prev: false title: "FabricObjectProps" --- +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L6) + ## Extends - `ObjectProps`.`ControlProps`.`BorderProps`.`LockInteractionProps` @@ -25,6 +27,8 @@ title: "FabricObjectProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -42,16 +46,14 @@ false `ObjectProps.absolutePositioned` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -64,39 +66,29 @@ Angle of rotation of an object (in degrees) `ObjectProps.angle` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from `ObjectProps.backgroundColor` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -109,16 +101,14 @@ rgb(178,204,255) `BorderProps.borderColor` -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -129,16 +119,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) `BorderProps.borderDashArray` -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -151,20 +139,19 @@ Opacity of object's controlling borders when object is active and moving `BorderProps.borderOpacityWhenMoving` -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -176,30 +163,26 @@ since there is no way to change the border itself. `BorderProps.borderScaleFactor` -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from `ObjectProps.canvas` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -210,26 +193,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `ObjectProps.centeredRotation` -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -237,26 +212,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from `ObjectProps.centeredScaling` -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -266,16 +233,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi `ObjectProps.clipPath` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -288,16 +253,14 @@ rgb(178,204,255) `ControlProps.cornerColor` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -314,16 +277,14 @@ null `ControlProps.cornerDashArray` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -336,16 +297,14 @@ Size of object's controlling corners (in pixels) `ControlProps.cornerSize` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -362,20 +321,22 @@ Color of controlling corners of an object (when it's active and transparentCorne `ControlProps.cornerStrokeColor` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -386,35 +347,19 @@ 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 `ControlProps.cornerStyle` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) +When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4 *** @@ -422,32 +367,26 @@ When set to `false`, an object can not be a target of events. All events propaga > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from `ObjectProps.excludeFromExport` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -461,16 +400,14 @@ rgb(0,0,0) `ObjectProps.fill` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -485,16 +422,14 @@ nonzero `ObjectProps.fillRule` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -507,16 +442,14 @@ false `ObjectProps.flipX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -529,60 +462,42 @@ false `ObjectProps.flipY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from `ObjectProps.globalCompositeOperation` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from `BorderProps.hasBorders` -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -595,38 +510,28 @@ true `ControlProps.hasControls` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from `ObjectProps.height` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -635,38 +540,28 @@ Default cursor value used when hovering over this object on canvas null ``` -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from `ObjectProps.includeDefaultValues` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -681,19 +576,17 @@ false `ObjectProps.inverted` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -705,192 +598,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject `ObjectProps.left` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -``` +When `true`, object horizontal movement is locked #### Inherited from `LockInteractionProps.lockMovementX` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from `LockInteractionProps.lockMovementY` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from `LockInteractionProps.lockRotation` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from `LockInteractionProps.lockScalingFlip` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from `LockInteractionProps.lockScalingX` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from `LockInteractionProps.lockScalingY` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from `LockInteractionProps.lockSkewingX` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -```ts - -``` +When `true`, object vertical skewing is locked #### Inherited from `LockInteractionProps.lockSkewingY` -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -903,16 +730,14 @@ Minimum allowed scale value of an object `ObjectProps.minScaleLimit` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -921,16 +746,14 @@ Default cursor value used when moving this object on canvas null ``` -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -943,16 +766,14 @@ since 1.7.0 true ``` -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -971,16 +792,14 @@ true `ObjectProps.objectCaching` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -993,38 +812,32 @@ Opacity of an object `ObjectProps.opacity` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -`ObjectProps.originX` +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +`ObjectProps.originX` *** @@ -1032,28 +845,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -`ObjectProps.originY` +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +`ObjectProps.originY` *** @@ -1061,6 +872,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1073,49 +886,29 @@ Padding between object and its controlling borders (in pixels) `ControlProps.padding` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from `ObjectProps.paintFirst` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box *** @@ -1123,6 +916,8 @@ When set to `true`, objects are "found" on canvas on per-pixel basis rather than > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1135,16 +930,14 @@ Object scale factor (horizontal) `ObjectProps.scaleX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1157,58 +950,40 @@ Object scale factor (vertical) `ObjectProps.scaleY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 - -``` - -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1221,16 +996,14 @@ null `ObjectProps.shadow` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1243,16 +1016,14 @@ Angle of skew on x axes of an object (in degrees) `ObjectProps.skewX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1265,32 +1036,28 @@ Angle of skew on y axes of an object (in degrees) `ObjectProps.skewY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from `ObjectProps.snapAngle` -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1298,16 +1065,14 @@ When undefined, the snapThreshold will default to the snapAngle. `ObjectProps.snapThreshold` -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1321,16 +1086,14 @@ null `ObjectProps.stroke` -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1343,16 +1106,14 @@ null; `ObjectProps.strokeDashArray` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1365,16 +1126,14 @@ Line offset of an object's stroke `ObjectProps.strokeDashOffset` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1387,38 +1146,28 @@ butt `ObjectProps.strokeLineCap` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from `ObjectProps.strokeLineJoin` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1431,16 +1180,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke `ObjectProps.strokeMiterLimit` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1466,16 +1213,14 @@ false `ObjectProps.strokeUniform` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1488,19 +1233,17 @@ Width of a stroke used to render this object `ObjectProps.strokeWidth` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1512,16 +1255,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject `ObjectProps.top` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1534,16 +1275,14 @@ Size of object's controlling corners when touch interaction is detected `ControlProps.touchCornerSize` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1556,50 +1295,30 @@ true `ControlProps.transparentCorners` -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from `ObjectProps.visible` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from `ObjectProps.width` - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/GroupEvents.md b/src/content/docs/api/interfaces/GroupEvents.md index 0cf35dec1..dcff7bf16 100644 --- a/src/content/docs/api/interfaces/GroupEvents.md +++ b/src/content/docs/api/interfaces/GroupEvents.md @@ -5,6 +5,8 @@ prev: false title: "GroupEvents" --- +Defined in: [src/shapes/Group.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L49) + ## Extends - [`ObjectEvents`](/api/interfaces/objectevents/).[`CollectionEvents`](/api/interfaces/collectionevents/) @@ -15,6 +17,8 @@ title: "GroupEvents" > **added**: `object` +Defined in: [src/EventTypeDefs.ts:300](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L300) + #### target > **target**: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> @@ -23,37 +27,29 @@ title: "GroupEvents" [`ObjectEvents`](/api/interfaces/objectevents/).[`added`](/api/interfaces/objectevents/#added) -#### Defined in - -[src/EventTypeDefs.ts:305](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L305) - *** ### contextmenu > **contextmenu**: `SimpleEventHandler`\<`Event`\> +Defined in: [src/EventTypeDefs.ts:283](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L283) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`contextmenu`](/api/interfaces/objectevents/#contextmenu) -#### Defined in - -[src/EventTypeDefs.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L288) - *** ### contextmenu:before > **contextmenu:before**: `SimpleEventHandler`\<`Event`\> -#### Inherited from - -[`ObjectEvents`](/api/interfaces/objectevents/).[`contextmenu:before`](/api/interfaces/objectevents/#contextmenu:before) +Defined in: [src/EventTypeDefs.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L282) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L287) +[`ObjectEvents`](/api/interfaces/objectevents/).[`contextmenu:before`](/api/interfaces/objectevents/#contextmenubefore) *** @@ -61,131 +57,113 @@ title: "GroupEvents" > **deselected**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L295) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`deselected`](/api/interfaces/objectevents/#deselected) -#### Defined in - -[src/EventTypeDefs.ts:300](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L300) - *** ### drag > **drag**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L203) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`drag`](/api/interfaces/objectevents/#drag) -#### Defined in - -[src/EventTypeDefs.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L218) - *** ### dragend > **dragend**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L207) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`dragend`](/api/interfaces/objectevents/#dragend) -#### Defined in - -[src/EventTypeDefs.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L222) - *** ### dragenter > **dragenter**: [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` +Defined in: [src/EventTypeDefs.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L205) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`dragenter`](/api/interfaces/objectevents/#dragenter) -#### Defined in - -[src/EventTypeDefs.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L220) - *** ### dragleave > **dragleave**: [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` +Defined in: [src/EventTypeDefs.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L206) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`dragleave`](/api/interfaces/objectevents/#dragleave) -#### Defined in - -[src/EventTypeDefs.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L221) - *** ### dragover > **dragover**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L204) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`dragover`](/api/interfaces/objectevents/#dragover) -#### Defined in - -[src/EventTypeDefs.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L219) - *** ### dragstart > **dragstart**: `TEventWithTarget`\<`DragEvent`\> +Defined in: [src/EventTypeDefs.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L202) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`dragstart`](/api/interfaces/objectevents/#dragstart) -#### Defined in - -[src/EventTypeDefs.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L217) - *** ### drop > **drop**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L209) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`drop`](/api/interfaces/objectevents/#drop) -#### Defined in - -[src/EventTypeDefs.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L224) - *** ### drop:after > **drop:after**: [`DropEventData`](/api/interfaces/dropeventdata/) -#### Inherited from - -[`ObjectEvents`](/api/interfaces/objectevents/).[`drop:after`](/api/interfaces/objectevents/#drop:after) +Defined in: [src/EventTypeDefs.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L210) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L225) +[`ObjectEvents`](/api/interfaces/objectevents/).[`drop:after`](/api/interfaces/objectevents/#dropafter) *** @@ -193,13 +171,11 @@ title: "GroupEvents" > **drop:before**: [`DropEventData`](/api/interfaces/dropeventdata/) -#### Inherited from - -[`ObjectEvents`](/api/interfaces/objectevents/).[`drop:before`](/api/interfaces/objectevents/#drop:before) +Defined in: [src/EventTypeDefs.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L208) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L223) +[`ObjectEvents`](/api/interfaces/objectevents/).[`drop:before`](/api/interfaces/objectevents/#dropbefore) *** @@ -207,17 +183,15 @@ title: "GroupEvents" > **erasing:end**: `object` +Defined in: [src/EventTypeDefs.ts:304](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L304) + #### path -> **path**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **path**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`ObjectEvents`](/api/interfaces/objectevents/).[`erasing:end`](/api/interfaces/objectevents/#erasing:end) - -#### Defined in - -[src/EventTypeDefs.ts:309](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L309) +[`ObjectEvents`](/api/interfaces/objectevents/).[`erasing:end`](/api/interfaces/objectevents/#erasingend) *** @@ -225,9 +199,7 @@ title: "GroupEvents" > **layout:after**: [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) -#### Defined in - -[src/shapes/Group.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L51) +Defined in: [src/shapes/Group.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L51) *** @@ -235,52 +207,44 @@ title: "GroupEvents" > **layout:before**: [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) -#### Defined in - -[src/shapes/Group.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L50) +Defined in: [src/shapes/Group.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L50) *** ### modified -> **modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/) + +Defined in: [src/EventTypeDefs.ts:147](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L147) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`modified`](/api/interfaces/objectevents/#modified) -#### Defined in - -[src/EventTypeDefs.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L138) - *** ### modifyPath > **modifyPath**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) +Defined in: [src/EventTypeDefs.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L146) + #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`modifyPath`](/api/interfaces/objectevents/#modifypath) -#### Defined in - -[src/EventTypeDefs.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L137) - *** ### modifyPoly -> **modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L145) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`modifyPoly`](/api/interfaces/objectevents/#modifypoly) -#### Defined in - -[src/EventTypeDefs.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L136) - *** ### mousedblclick @@ -295,7 +259,16 @@ title: "GroupEvents" ### mousedown -> **mousedown**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **mousedown**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` + +#### Type Declaration + +##### alreadySelected + +> **alreadySelected**: `boolean` + +Indicates if the target or current target where already selected +before the cycle of mouse down -> mouse up started #### Inherited from @@ -309,7 +282,7 @@ title: "GroupEvents" #### Inherited from -[`ObjectEvents`](/api/interfaces/objectevents/).[`mousedown:before`](/api/interfaces/objectevents/#mousedown:before) +[`ObjectEvents`](/api/interfaces/objectevents/).[`mousedown:before`](/api/interfaces/objectevents/#mousedownbefore) *** @@ -329,7 +302,7 @@ title: "GroupEvents" #### Inherited from -[`ObjectEvents`](/api/interfaces/objectevents/).[`mousemove:before`](/api/interfaces/objectevents/#mousemove:before) +[`ObjectEvents`](/api/interfaces/objectevents/).[`mousemove:before`](/api/interfaces/objectevents/#mousemovebefore) *** @@ -353,19 +326,21 @@ title: "GroupEvents" *** -### mouseup +### mousetripleclick -> **mouseup**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` +> **mousetripleclick**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> -#### Type declaration +#### Inherited from + +[`ObjectEvents`](/api/interfaces/objectevents/).[`mousetripleclick`](/api/interfaces/objectevents/#mousetripleclick) -##### currentSubTargets +*** -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +### mouseup -##### currentTarget? +> **mouseup**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +#### Type Declaration ##### isClick @@ -381,15 +356,7 @@ title: "GroupEvents" > **mouseup:before**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration - -##### currentSubTargets - -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] - -##### currentTarget? - -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +#### Type Declaration ##### isClick @@ -397,7 +364,7 @@ title: "GroupEvents" #### Inherited from -[`ObjectEvents`](/api/interfaces/objectevents/).[`mouseup:before`](/api/interfaces/objectevents/#mouseup:before) +[`ObjectEvents`](/api/interfaces/objectevents/).[`mouseup:before`](/api/interfaces/objectevents/#mouseupbefore) *** @@ -413,33 +380,29 @@ title: "GroupEvents" ### moving -> **moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L140) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`moving`](/api/interfaces/objectevents/#moving) -#### Defined in - -[src/EventTypeDefs.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L131) - *** ### object:added > **object:added**: `object` +Defined in: [src/EventTypeDefs.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L235) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:added`](/api/interfaces/collectionevents/#object:added) - -#### Defined in - -[src/EventTypeDefs.ts:250](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L250) +[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:added`](/api/interfaces/collectionevents/#objectadded) *** @@ -447,17 +410,15 @@ title: "GroupEvents" > **object:removed**: `object` +Defined in: [src/EventTypeDefs.ts:236](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L236) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:removed`](/api/interfaces/collectionevents/#object:removed) - -#### Defined in - -[src/EventTypeDefs.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L251) +[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:removed`](/api/interfaces/collectionevents/#objectremoved) *** @@ -465,6 +426,8 @@ title: "GroupEvents" > **removed**: `object` +Defined in: [src/EventTypeDefs.ts:301](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L301) + #### target > **target**: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> @@ -473,82 +436,68 @@ title: "GroupEvents" [`ObjectEvents`](/api/interfaces/objectevents/).[`removed`](/api/interfaces/objectevents/#removed) -#### Defined in - -[src/EventTypeDefs.ts:306](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L306) - *** ### resizing -> **resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L144) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`resizing`](/api/interfaces/objectevents/#resizing) -#### Defined in - -[src/EventTypeDefs.ts:135](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L135) - *** ### rotating -> **rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:142](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L142) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`rotating`](/api/interfaces/objectevents/#rotating) -#### Defined in - -[src/EventTypeDefs.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L133) - *** ### scaling -> **scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L141) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`scaling`](/api/interfaces/objectevents/#scaling) -#### Defined in - -[src/EventTypeDefs.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L132) - *** ### selected > **selected**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:292](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L292) + +#### Type Declaration ##### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`selected`](/api/interfaces/objectevents/#selected) -#### Defined in - -[src/EventTypeDefs.ts:297](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L297) - *** ### skewing -> **skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) + +Defined in: [src/EventTypeDefs.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L143) #### Inherited from [`ObjectEvents`](/api/interfaces/objectevents/).[`skewing`](/api/interfaces/objectevents/#skewing) - -#### Defined in - -[src/EventTypeDefs.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L134) diff --git a/src/content/docs/api/interfaces/GroupOwnProps.md b/src/content/docs/api/interfaces/GroupOwnProps.md index bd4fb1aa5..e6f76356e 100644 --- a/src/content/docs/api/interfaces/GroupOwnProps.md +++ b/src/content/docs/api/interfaces/GroupOwnProps.md @@ -5,6 +5,8 @@ prev: false title: "GroupOwnProps" --- +Defined in: [src/shapes/Group.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L54) + ## Extended by - [`GroupProps`](/api/interfaces/groupprops/) @@ -16,9 +18,7 @@ title: "GroupOwnProps" > **interactive**: `boolean` -#### Defined in - -[src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L56) +Defined in: [src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L56) *** @@ -26,6 +26,4 @@ title: "GroupOwnProps" > **subTargetCheck**: `boolean` -#### Defined in - -[src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L55) +Defined in: [src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L55) diff --git a/src/content/docs/api/interfaces/GroupProps.md b/src/content/docs/api/interfaces/GroupProps.md index b4a07fabf..f01c59f1c 100644 --- a/src/content/docs/api/interfaces/GroupProps.md +++ b/src/content/docs/api/interfaces/GroupProps.md @@ -5,6 +5,8 @@ prev: false title: "GroupProps" --- +Defined in: [src/shapes/Group.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L66) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`GroupOwnProps`](/api/interfaces/groupownprops/) @@ -19,6 +21,8 @@ title: "GroupProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -36,16 +40,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -58,39 +60,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -103,16 +95,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -123,16 +113,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -145,20 +133,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -170,30 +157,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -204,26 +187,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -231,26 +206,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -260,16 +227,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -282,16 +247,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -308,16 +271,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -330,16 +291,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -356,20 +315,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -380,72 +341,50 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -459,16 +398,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -483,16 +420,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -505,16 +440,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -527,60 +460,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -593,38 +508,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -637,52 +542,40 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### interactive > **interactive**: `boolean` +Defined in: [src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L56) + #### Inherited from [`GroupOwnProps`](/api/interfaces/groupownprops/).[`interactive`](/api/interfaces/groupownprops/#interactive) -#### Defined in - -[src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L56) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -697,19 +590,13 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### layoutManager > **layoutManager**: [`LayoutManager`](/api/classes/layoutmanager/) -#### Defined in - -[src/shapes/Group.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L67) +Defined in: [src/shapes/Group.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L67) *** @@ -717,9 +604,11 @@ false > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -731,192 +620,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -#### Default - -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -929,16 +752,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -951,16 +772,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -977,16 +796,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1005,16 +822,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1027,38 +842,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1066,28 +875,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1095,6 +902,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1107,60 +916,42 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1173,16 +964,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1195,48 +984,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1245,16 +1018,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1267,16 +1038,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1289,16 +1058,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1311,32 +1078,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1344,16 +1107,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1367,16 +1128,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1389,16 +1148,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1411,16 +1168,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1433,38 +1188,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1477,16 +1222,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1512,16 +1255,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1534,33 +1275,29 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### subTargetCheck > **subTargetCheck**: `boolean` +Defined in: [src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L55) + #### Inherited from [`GroupOwnProps`](/api/interfaces/groupownprops/).[`subTargetCheck`](/api/interfaces/groupownprops/#subtargetcheck) -#### Defined in - -[src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L55) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1572,16 +1309,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1594,16 +1329,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1616,50 +1349,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/ITextProps.md b/src/content/docs/api/interfaces/ITextProps.md index e123b75bf..54ec56531 100644 --- a/src/content/docs/api/interfaces/ITextProps.md +++ b/src/content/docs/api/interfaces/ITextProps.md @@ -5,6 +5,8 @@ prev: false title: "ITextProps" --- +Defined in: [src/shapes/IText/IText.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L78) + ## Extends - [`TextProps`](/api/interfaces/textprops/).`UniqueITextProps` @@ -19,6 +21,8 @@ title: "ITextProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -36,16 +40,14 @@ false [`TextProps`](/api/interfaces/textprops/).[`absolutePositioned`](/api/interfaces/textprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -58,39 +60,29 @@ Angle of rotation of an object (in degrees) [`TextProps`](/api/interfaces/textprops/).[`angle`](/api/interfaces/textprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`backgroundColor`](/api/interfaces/textprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -103,16 +95,14 @@ rgb(178,204,255) [`TextProps`](/api/interfaces/textprops/).[`borderColor`](/api/interfaces/textprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -123,16 +113,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`TextProps`](/api/interfaces/textprops/).[`borderDashArray`](/api/interfaces/textprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -145,20 +133,19 @@ Opacity of object's controlling borders when object is active and moving [`TextProps`](/api/interfaces/textprops/).[`borderOpacityWhenMoving`](/api/interfaces/textprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -170,30 +157,26 @@ since there is no way to change the border itself. [`TextProps`](/api/interfaces/textprops/).[`borderScaleFactor`](/api/interfaces/textprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`canvas`](/api/interfaces/textprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -204,26 +187,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`centeredRotation`](/api/interfaces/textprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -231,40 +206,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`centeredScaling`](/api/interfaces/textprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -[`TextProps`](/api/interfaces/textprops/).[`charSpacing`](/api/interfaces/textprops/#charspacing) - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -274,16 +227,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`TextProps`](/api/interfaces/textprops/).[`clipPath`](/api/interfaces/textprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -296,16 +247,14 @@ rgb(178,204,255) [`TextProps`](/api/interfaces/textprops/).[`cornerColor`](/api/interfaces/textprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -322,16 +271,14 @@ null [`TextProps`](/api/interfaces/textprops/).[`cornerDashArray`](/api/interfaces/textprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -344,16 +291,14 @@ Size of object's controlling corners (in pixels) [`TextProps`](/api/interfaces/textprops/).[`cornerSize`](/api/interfaces/textprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -370,20 +315,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`TextProps`](/api/interfaces/textprops/).[`cornerStrokeColor`](/api/interfaces/textprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -394,86 +341,62 @@ 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 [`TextProps`](/api/interfaces/textprops/).[`cornerStyle`](/api/interfaces/textprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`direction`](/api/interfaces/textprops/#direction) -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### 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/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -``` +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 [`TextProps`](/api/interfaces/textprops/).[`evented`](/api/interfaces/textprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`excludeFromExport`](/api/interfaces/textprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -487,16 +410,14 @@ rgb(0,0,0) [`TextProps`](/api/interfaces/textprops/).[`fill`](/api/interfaces/textprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -511,16 +432,14 @@ nonzero [`TextProps`](/api/interfaces/textprops/).[`fillRule`](/api/interfaces/textprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -533,16 +452,14 @@ false [`TextProps`](/api/interfaces/textprops/).[`flipX`](/api/interfaces/textprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -555,116 +472,90 @@ false [`TextProps`](/api/interfaces/textprops/).[`flipY`](/api/interfaces/textprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`fontFamily`](/api/interfaces/textprops/#fontfamily) -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`fontSize`](/api/interfaces/textprops/#fontsize) -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`fontStyle`](/api/interfaces/textprops/#fontstyle) -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`fontWeight`](/api/interfaces/textprops/#fontweight) -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`globalCompositeOperation`](/api/interfaces/textprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -```ts - -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`hasBorders`](/api/interfaces/textprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -677,38 +568,28 @@ true [`TextProps`](/api/interfaces/textprops/).[`hasControls`](/api/interfaces/textprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`height`](/api/interfaces/textprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -721,9 +602,17 @@ null [`TextProps`](/api/interfaces/textprops/).[`hoverCursor`](/api/interfaces/textprops/#hovercursor) -#### Defined in +*** + +### charSpacing + +> **charSpacing**: `number` + +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) +#### Inherited from + +[`TextProps`](/api/interfaces/textprops/).[`charSpacing`](/api/interfaces/textprops/#charspacing) *** @@ -731,28 +620,22 @@ null > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`includeDefaultValues`](/api/interfaces/textprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -767,19 +650,17 @@ false [`TextProps`](/api/interfaces/textprops/).[`inverted`](/api/interfaces/textprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -791,220 +672,150 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`TextProps`](/api/interfaces/textprops/).[`left`](/api/interfaces/textprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lineHeight`](/api/interfaces/textprops/#lineheight) -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`linethrough`](/api/interfaces/textprops/#linethrough) -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -``` +When `true`, object horizontal movement is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockMovementX`](/api/interfaces/textprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -```ts - -``` +When `true`, object vertical movement is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockMovementY`](/api/interfaces/textprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockRotation`](/api/interfaces/textprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockScalingFlip`](/api/interfaces/textprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockScalingX`](/api/interfaces/textprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockScalingY`](/api/interfaces/textprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -``` +When `true`, object horizontal skewing is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockSkewingX`](/api/interfaces/textprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -``` +When `true`, object vertical skewing is locked #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`lockSkewingY`](/api/interfaces/textprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -1017,16 +828,14 @@ Minimum allowed scale value of an object [`TextProps`](/api/interfaces/textprops/).[`minScaleLimit`](/api/interfaces/textprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -1039,16 +848,14 @@ null [`TextProps`](/api/interfaces/textprops/).[`moveCursor`](/api/interfaces/textprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -1065,16 +872,14 @@ true [`TextProps`](/api/interfaces/textprops/).[`noScaleCache`](/api/interfaces/textprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1093,16 +898,14 @@ true [`TextProps`](/api/interfaces/textprops/).[`objectCaching`](/api/interfaces/textprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1115,38 +918,32 @@ Opacity of an object [`TextProps`](/api/interfaces/textprops/).[`opacity`](/api/interfaces/textprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`TextProps`](/api/interfaces/textprops/).[`originX`](/api/interfaces/textprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`TextProps`](/api/interfaces/textprops/).[`originX`](/api/interfaces/textprops/#originx) *** @@ -1154,28 +951,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`TextProps`](/api/interfaces/textprops/).[`originY`](/api/interfaces/textprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`TextProps`](/api/interfaces/textprops/).[`originY`](/api/interfaces/textprops/#originy) *** @@ -1183,20 +978,20 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`overline`](/api/interfaces/textprops/#overline) -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### padding > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1209,102 +1004,78 @@ Padding between object and its controlling borders (in pixels) [`TextProps`](/api/interfaces/textprops/).[`padding`](/api/interfaces/textprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`paintFirst`](/api/interfaces/textprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`path`](/api/interfaces/textprops/#path) -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`pathAlign`](/api/interfaces/textprops/#pathalign) -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`pathSide`](/api/interfaces/textprops/#pathside) -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`perPixelTargetFind`](/api/interfaces/textprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1317,16 +1088,14 @@ Object scale factor (horizontal) [`TextProps`](/api/interfaces/textprops/).[`scaleX`](/api/interfaces/textprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1339,48 +1108,32 @@ Object scale factor (vertical) [`TextProps`](/api/interfaces/textprops/).[`scaleY`](/api/interfaces/textprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`TextProps`](/api/interfaces/textprops/).[`selectable`](/api/interfaces/textprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1389,44 +1142,38 @@ This API is no longer supported and may be removed in a future release. [`TextProps`](/api/interfaces/textprops/).[`selectionBackgroundColor`](/api/interfaces/textprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### selectionEnd > **selectionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L71) + #### Inherited from `UniqueITextProps.selectionEnd` -#### Defined in - -[src/shapes/IText/IText.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L68) - *** ### selectionStart > **selectionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L70) + #### Inherited from `UniqueITextProps.selectionStart` -#### Defined in - -[src/shapes/IText/IText.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L67) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1439,16 +1186,14 @@ null [`TextProps`](/api/interfaces/textprops/).[`shadow`](/api/interfaces/textprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1461,16 +1206,14 @@ Angle of skew on x axes of an object (in degrees) [`TextProps`](/api/interfaces/textprops/).[`skewX`](/api/interfaces/textprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1483,32 +1226,28 @@ Angle of skew on y axes of an object (in degrees) [`TextProps`](/api/interfaces/textprops/).[`skewY`](/api/interfaces/textprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`snapAngle`](/api/interfaces/textprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1516,16 +1255,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`TextProps`](/api/interfaces/textprops/).[`snapThreshold`](/api/interfaces/textprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1539,16 +1276,14 @@ null [`TextProps`](/api/interfaces/textprops/).[`stroke`](/api/interfaces/textprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1561,16 +1296,14 @@ null; [`TextProps`](/api/interfaces/textprops/).[`strokeDashArray`](/api/interfaces/textprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1583,16 +1316,14 @@ Line offset of an object's stroke [`TextProps`](/api/interfaces/textprops/).[`strokeDashOffset`](/api/interfaces/textprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1605,38 +1336,28 @@ butt [`TextProps`](/api/interfaces/textprops/).[`strokeLineCap`](/api/interfaces/textprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`strokeLineJoin`](/api/interfaces/textprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1649,16 +1370,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`TextProps`](/api/interfaces/textprops/).[`strokeMiterLimit`](/api/interfaces/textprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1684,16 +1403,14 @@ false [`TextProps`](/api/interfaces/textprops/).[`strokeUniform`](/api/interfaces/textprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1706,37 +1423,41 @@ Width of a stroke used to render this object [`TextProps`](/api/interfaces/textprops/).[`strokeWidth`](/api/interfaces/textprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles > **styles**: [`TextStyle`](/api/type-aliases/textstyle/) +Defined in: [src/shapes/Text/Text.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L122) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`styles`](/api/interfaces/textprops/#styles) -#### Defined in - -[src/shapes/Text/Text.ts:119](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L119) - *** ### textAlign > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`textAlign`](/api/interfaces/textprops/#textalign) -#### Defined in +*** + +### textDecorationThickness + +> **textDecorationThickness**: `number` -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from + +[`TextProps`](/api/interfaces/textprops/).[`textDecorationThickness`](/api/interfaces/textprops/#textdecorationthickness) *** @@ -1744,9 +1465,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1758,16 +1481,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`TextProps`](/api/interfaces/textprops/).[`top`](/api/interfaces/textprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1780,16 +1501,14 @@ Size of object's controlling corners when touch interaction is detected [`TextProps`](/api/interfaces/textprops/).[`touchCornerSize`](/api/interfaces/textprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1802,64 +1521,42 @@ true [`TextProps`](/api/interfaces/textprops/).[`transparentCorners`](/api/interfaces/textprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`underline`](/api/interfaces/textprops/#underline) -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`visible`](/api/interfaces/textprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`TextProps`](/api/interfaces/textprops/).[`width`](/api/interfaces/textprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/ImageProps.md b/src/content/docs/api/interfaces/ImageProps.md index f52c8d006..68f085f8a 100644 --- a/src/content/docs/api/interfaces/ImageProps.md +++ b/src/content/docs/api/interfaces/ImageProps.md @@ -5,6 +5,8 @@ prev: false title: "ImageProps" --- +Defined in: [src/shapes/Image.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L70) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniqueImageProps` @@ -15,6 +17,8 @@ title: "ImageProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,100 +337,74 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### cropX > **cropX**: `number` +Defined in: [src/shapes/Image.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L45) + #### Inherited from `UniqueImageProps.cropX` -#### Defined in - -[src/shapes/Image.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L45) - *** ### cropY > **cropY**: `number` +Defined in: [src/shapes/Image.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L46) + #### Inherited from `UniqueImageProps.cropY` -#### Defined in - -[src/shapes/Image.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L46) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -483,16 +418,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -507,30 +440,26 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### 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:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L48) #### Inherited from `UniqueImageProps.filters` -#### Defined in - -[src/shapes/Image.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L48) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -543,16 +472,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -565,60 +492,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -#### Default - -```ts - -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -631,38 +540,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -675,52 +574,40 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### imageSmoothing > **imageSmoothing**: `boolean` +Defined in: [src/shapes/Image.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L47) + #### Inherited from `UniqueImageProps.imageSmoothing` -#### Defined in - -[src/shapes/Image.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L47) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -```ts - -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -735,19 +622,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -759,185 +644,129 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -#### Default - -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -```ts - -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -#### Default - -```ts - -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) + When `true`, object vertical skewing is locked -#### Default +#### Inherited from -```ts +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -``` +*** -#### Inherited from +### minimumScaleTrigger -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) +> **minimumScaleTrigger**: `number` + +Defined in: [src/shapes/Image.ts:44](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L44) -#### Defined in +#### Inherited from -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) +`UniqueImageProps.minimumScaleTrigger` *** @@ -945,6 +774,8 @@ When `true`, object vertical skewing is locked > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -957,30 +788,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - -*** - -### minimumScaleTrigger - -> **minimumScaleTrigger**: `number` - -#### Inherited from - -`UniqueImageProps.minimumScaleTrigger` - -#### Defined in - -[src/shapes/Image.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L44) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -993,16 +808,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -1019,16 +832,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1047,16 +858,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1069,38 +878,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1108,28 +911,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1137,6 +938,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1149,74 +952,54 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### perPixelTargetFind > **perPixelTargetFind**: `boolean` -When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box - -#### Default +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -```ts - -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### resizeFilter? -> `optional` **resizeFilter**: [`Resize`](/api/namespaces/filters/classes/resize/) +> `optional` **resizeFilter**: [`Resize`](/api/fabric/namespaces/filters/classes/resize/) + +Defined in: [src/shapes/Image.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L49) #### Inherited from `UniqueImageProps.resizeFilter` -#### Defined in - -[src/shapes/Image.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L49) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1229,16 +1012,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1251,48 +1032,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1301,16 +1066,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1323,16 +1086,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1345,16 +1106,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1367,32 +1126,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1400,30 +1155,26 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### srcFromAttribute > **srcFromAttribute**: `boolean` +Defined in: [src/shapes/Image.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L43) + #### Inherited from `UniqueImageProps.srcFromAttribute` -#### Defined in - -[src/shapes/Image.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L43) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1437,16 +1188,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1459,16 +1208,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1481,16 +1228,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1503,38 +1248,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1547,16 +1282,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1582,16 +1315,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1604,19 +1335,17 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1628,16 +1357,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1650,16 +1377,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1672,50 +1397,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -```ts - -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/MiscEvents.md b/src/content/docs/api/interfaces/MiscEvents.md index 549a5b219..3246ece7e 100644 --- a/src/content/docs/api/interfaces/MiscEvents.md +++ b/src/content/docs/api/interfaces/MiscEvents.md @@ -5,6 +5,8 @@ prev: false title: "MiscEvents" --- +Defined in: [src/EventTypeDefs.ts:281](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L281) + ## Extended by - [`ObjectEvents`](/api/interfaces/objectevents/) @@ -16,9 +18,7 @@ title: "MiscEvents" > **contextmenu**: `SimpleEventHandler`\<`Event`\> -#### Defined in - -[src/EventTypeDefs.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L288) +Defined in: [src/EventTypeDefs.ts:283](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L283) *** @@ -26,6 +26,4 @@ title: "MiscEvents" > **contextmenu:before**: `SimpleEventHandler`\<`Event`\> -#### Defined in - -[src/EventTypeDefs.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L287) +Defined in: [src/EventTypeDefs.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L282) diff --git a/src/content/docs/api/interfaces/ModifiedEvent.md b/src/content/docs/api/interfaces/ModifiedEvent.md index 867f351e2..f620d729c 100644 --- a/src/content/docs/api/interfaces/ModifiedEvent.md +++ b/src/content/docs/api/interfaces/ModifiedEvent.md @@ -5,9 +5,13 @@ prev: false title: "ModifiedEvent" --- +Defined in: [src/EventTypeDefs.ts:127](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L127) + ## Type Parameters -• **E** *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### E + +`E` *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) ## Properties @@ -15,9 +19,7 @@ title: "ModifiedEvent" > `optional` **action**: `string` -#### Defined in - -[src/EventTypeDefs.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L122) +Defined in: [src/EventTypeDefs.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L131) *** @@ -25,19 +27,15 @@ title: "ModifiedEvent" > `optional` **e**: `E` -#### Defined in - -[src/EventTypeDefs.ts:119](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L119) +Defined in: [src/EventTypeDefs.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L128) *** ### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -#### Defined in +> **target**: [`FabricObject`](/api/classes/fabricobject/) -[src/EventTypeDefs.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L121) +Defined in: [src/EventTypeDefs.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L130) *** @@ -45,6 +43,4 @@ title: "ModifiedEvent" > `optional` **transform**: [`Transform`](/api/type-aliases/transform/) -#### Defined in - -[src/EventTypeDefs.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L120) +Defined in: [src/EventTypeDefs.ts:129](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L129) diff --git a/src/content/docs/api/interfaces/ModifyPathEvent.md b/src/content/docs/api/interfaces/ModifyPathEvent.md index 51e77471c..ec172a515 100644 --- a/src/content/docs/api/interfaces/ModifyPathEvent.md +++ b/src/content/docs/api/interfaces/ModifyPathEvent.md @@ -5,15 +5,15 @@ prev: false title: "ModifyPathEvent" --- +Defined in: [src/EventTypeDefs.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L134) + ## Properties ### commandIndex > **commandIndex**: `number` -#### Defined in - -[src/EventTypeDefs.ts:126](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L126) +Defined in: [src/EventTypeDefs.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L135) *** @@ -21,6 +21,4 @@ title: "ModifyPathEvent" > **pointIndex**: `number` -#### Defined in - -[src/EventTypeDefs.ts:127](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L127) +Defined in: [src/EventTypeDefs.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L136) diff --git a/src/content/docs/api/interfaces/ObjectEvents.md b/src/content/docs/api/interfaces/ObjectEvents.md index c38b564eb..b405a5fdf 100644 --- a/src/content/docs/api/interfaces/ObjectEvents.md +++ b/src/content/docs/api/interfaces/ObjectEvents.md @@ -5,6 +5,8 @@ prev: false title: "ObjectEvents" --- +Defined in: [src/EventTypeDefs.ts:286](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L286) + ## Extends - [`ObjectPointerEvents`](/api/type-aliases/objectpointerevents/).`DnDEvents`.[`MiscEvents`](/api/interfaces/miscevents/).[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/) @@ -19,41 +21,35 @@ title: "ObjectEvents" > **added**: `object` +Defined in: [src/EventTypeDefs.ts:300](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L300) + #### target > **target**: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:305](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L305) - *** ### contextmenu > **contextmenu**: `SimpleEventHandler`\<`Event`\> +Defined in: [src/EventTypeDefs.ts:283](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L283) + #### Inherited from [`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu`](/api/interfaces/miscevents/#contextmenu) -#### Defined in - -[src/EventTypeDefs.ts:288](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L288) - *** ### contextmenu:before > **contextmenu:before**: `SimpleEventHandler`\<`Event`\> -#### Inherited from - -[`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu:before`](/api/interfaces/miscevents/#contextmenu:before) +Defined in: [src/EventTypeDefs.ts:282](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L282) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L287) +[`MiscEvents`](/api/interfaces/miscevents/).[`contextmenu:before`](/api/interfaces/miscevents/#contextmenubefore) *** @@ -61,15 +57,13 @@ title: "ObjectEvents" > **deselected**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration - -##### target +Defined in: [src/EventTypeDefs.ts:295](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L295) -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +#### Type Declaration -#### Defined in +##### target -[src/EventTypeDefs.ts:300](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L300) +> **target**: [`FabricObject`](/api/classes/fabricobject/) *** @@ -77,153 +71,131 @@ title: "ObjectEvents" > **drag**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:203](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L203) + #### Inherited from `DnDEvents.drag` -#### Defined in - -[src/EventTypeDefs.ts:218](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L218) - *** ### dragend > **dragend**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:207](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L207) + #### Inherited from `DnDEvents.dragend` -#### Defined in - -[src/EventTypeDefs.ts:222](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L222) - *** ### dragenter > **dragenter**: [`DragEventData`](/api/interfaces/drageventdata/) & `InEvent` +Defined in: [src/EventTypeDefs.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L205) + #### Inherited from `DnDEvents.dragenter` -#### Defined in - -[src/EventTypeDefs.ts:220](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L220) - *** ### dragleave > **dragleave**: [`DragEventData`](/api/interfaces/drageventdata/) & `OutEvent` +Defined in: [src/EventTypeDefs.ts:206](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L206) + #### Inherited from `DnDEvents.dragleave` -#### Defined in - -[src/EventTypeDefs.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L221) - *** ### dragover > **dragover**: [`DragEventData`](/api/interfaces/drageventdata/) +Defined in: [src/EventTypeDefs.ts:204](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L204) + #### Inherited from `DnDEvents.dragover` -#### Defined in - -[src/EventTypeDefs.ts:219](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L219) - *** ### dragstart > **dragstart**: `TEventWithTarget`\<`DragEvent`\> +Defined in: [src/EventTypeDefs.ts:202](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L202) + #### Inherited from `DnDEvents.dragstart` -#### Defined in - -[src/EventTypeDefs.ts:217](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L217) - *** ### drop > **drop**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L209) + #### Inherited from `DnDEvents.drop` -#### Defined in - -[src/EventTypeDefs.ts:224](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L224) - *** ### drop:after > **drop:after**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:210](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L210) + #### Inherited from `DnDEvents.drop:after` -#### Defined in - -[src/EventTypeDefs.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L225) - *** ### drop:before > **drop:before**: [`DropEventData`](/api/interfaces/dropeventdata/) +Defined in: [src/EventTypeDefs.ts:208](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L208) + #### Inherited from `DnDEvents.drop:before` -#### Defined in - -[src/EventTypeDefs.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L223) - *** ### erasing:end > **erasing:end**: `object` -#### path - -> **path**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/EventTypeDefs.ts:304](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L304) -#### Defined in +#### path -[src/EventTypeDefs.ts:309](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L309) +> **path**: [`FabricObject`](/api/classes/fabricobject/) *** ### modified -> **modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Inherited from +> **modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/) -`ObjectModificationEvents.modified` +Defined in: [src/EventTypeDefs.ts:147](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L147) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L138) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`modified`](/api/type-aliases/objectmodificationevents/#modified) *** @@ -231,27 +203,23 @@ title: "ObjectEvents" > **modifyPath**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) -#### Inherited from - -`ObjectModificationEvents.modifyPath` +Defined in: [src/EventTypeDefs.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L146) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:137](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L137) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`modifyPath`](/api/type-aliases/objectmodificationevents/#modifypath) *** ### modifyPoly -> **modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -#### Inherited from +Defined in: [src/EventTypeDefs.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L145) -`ObjectModificationEvents.modifyPoly` - -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L136) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`modifyPoly`](/api/type-aliases/objectmodificationevents/#modifypoly) *** @@ -267,11 +235,20 @@ title: "ObjectEvents" ### mousedown -> **mousedown**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **mousedown**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` + +#### Type Declaration + +##### alreadySelected + +> **alreadySelected**: `boolean` + +Indicates if the target or current target where already selected +before the cycle of mouse down -> mouse up started #### Inherited from -`ObjectPointerEvents.mousedown` +[`ObjectEvents`](/api/interfaces/objectevents/).[`mousedown`](/api/interfaces/objectevents/#mousedown) *** @@ -325,19 +302,21 @@ title: "ObjectEvents" *** -### mouseup +### mousetripleclick -> **mouseup**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` +> **mousetripleclick**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> -#### Type declaration +#### Inherited from -##### currentSubTargets +`ObjectPointerEvents.mousetripleclick` -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] +*** -##### currentTarget? +### mouseup -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **mouseup**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` + +#### Type Declaration ##### isClick @@ -353,15 +332,7 @@ title: "ObjectEvents" > **mouseup:before**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> & `object` -#### Type declaration - -##### currentSubTargets - -> **currentSubTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] - -##### currentTarget? - -> `optional` **currentTarget**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +#### Type Declaration ##### isClick @@ -385,15 +356,13 @@ title: "ObjectEvents" ### moving -> **moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Inherited from +> **moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -`ObjectModificationEvents.moving` +Defined in: [src/EventTypeDefs.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L140) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L131) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`moving`](/api/type-aliases/objectmodificationevents/#moving) *** @@ -401,55 +370,47 @@ title: "ObjectEvents" > **removed**: `object` +Defined in: [src/EventTypeDefs.ts:301](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L301) + #### target > **target**: [`Canvas`](/api/classes/canvas/) \| [`Group`](/api/classes/group/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:306](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L306) - *** ### resizing -> **resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Inherited from +> **resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -`ObjectModificationEvents.resizing` +Defined in: [src/EventTypeDefs.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L144) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:135](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L135) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`resizing`](/api/type-aliases/objectmodificationevents/#resizing) *** ### rotating -> **rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Inherited from +> **rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -`ObjectModificationEvents.rotating` +Defined in: [src/EventTypeDefs.ts:142](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L142) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:133](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L133) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`rotating`](/api/type-aliases/objectmodificationevents/#rotating) *** ### scaling -> **scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> - -#### Inherited from +> **scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -`ObjectModificationEvents.scaling` +Defined in: [src/EventTypeDefs.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L141) -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L132) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`scaling`](/api/type-aliases/objectmodificationevents/#scaling) *** @@ -457,26 +418,22 @@ title: "ObjectEvents" > **selected**: `Partial`\<[`TEvent`](/api/interfaces/tevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\>\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:292](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L292) -##### target +#### Type Declaration -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -#### Defined in +##### target -[src/EventTypeDefs.ts:297](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L297) +> **target**: [`FabricObject`](/api/classes/fabricobject/) *** ### skewing -> **skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/)\<[`TPointerEvent`](/api/type-aliases/tpointerevent/)\> +> **skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -#### Inherited from +Defined in: [src/EventTypeDefs.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L143) -`ObjectModificationEvents.skewing` - -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L134) +[`ObjectModificationEvents`](/api/type-aliases/objectmodificationevents/).[`skewing`](/api/type-aliases/objectmodificationevents/#skewing) diff --git a/src/content/docs/api/interfaces/PathProps.md b/src/content/docs/api/interfaces/PathProps.md index 8b0915c44..9dd281f65 100644 --- a/src/content/docs/api/interfaces/PathProps.md +++ b/src/content/docs/api/interfaces/PathProps.md @@ -5,6 +5,8 @@ prev: false title: "PathProps" --- +Defined in: [src/shapes/Path.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L41) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniquePathProps` @@ -15,6 +17,8 @@ title: "PathProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,72 +337,50 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -455,16 +394,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -479,16 +416,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -501,16 +436,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -523,60 +456,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -589,38 +504,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -633,38 +538,28 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -679,19 +574,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -703,192 +596,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -#### Default - -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -#### Default - -```ts - -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -```ts - -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -901,16 +728,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -923,16 +748,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -949,16 +772,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -977,16 +798,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -999,38 +818,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1038,28 +851,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1067,6 +878,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1079,74 +892,54 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### path? -> `optional` **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +> `optional` **path**: [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/shapes/Path.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L34) #### Inherited from `UniquePathProps.path` -#### Defined in - -[src/shapes/Path.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L34) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1159,16 +952,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1181,48 +972,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1231,16 +1006,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1253,16 +1026,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1275,16 +1046,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1297,32 +1066,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1330,30 +1095,26 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### sourcePath? > `optional` **sourcePath**: `string` +Defined in: [src/shapes/Path.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L33) + #### Inherited from `UniquePathProps.sourcePath` -#### Defined in - -[src/shapes/Path.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L33) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1367,16 +1128,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1389,16 +1148,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1411,16 +1168,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1433,38 +1188,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1477,16 +1222,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1512,16 +1255,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1534,19 +1275,17 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1558,16 +1297,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1580,16 +1317,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1602,50 +1337,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/RectProps.md b/src/content/docs/api/interfaces/RectProps.md index 60847adc2..b0a4dabeb 100644 --- a/src/content/docs/api/interfaces/RectProps.md +++ b/src/content/docs/api/interfaces/RectProps.md @@ -5,6 +5,8 @@ prev: false title: "RectProps" --- +Defined in: [src/shapes/Rect.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L25) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniqueRectProps` @@ -15,6 +17,8 @@ title: "RectProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -32,16 +36,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -54,39 +56,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -99,16 +91,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -119,16 +109,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -141,20 +129,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -166,30 +153,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -200,26 +183,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -227,26 +202,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -256,16 +223,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -278,16 +243,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -304,16 +267,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -326,16 +287,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -352,20 +311,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -376,72 +337,50 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -```ts - -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -455,16 +394,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -479,16 +416,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -501,16 +436,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -523,60 +456,42 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -589,38 +504,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -633,38 +538,28 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -679,19 +574,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -703,192 +596,126 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -#### Default - -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -#### Default - -```ts - -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -```ts - -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -901,16 +728,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -923,16 +748,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -949,16 +772,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -977,16 +798,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -999,38 +818,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1038,28 +851,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1067,6 +878,8 @@ To set the default value to 'center' import BaseFabricObject and set the static > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1079,88 +892,66 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### rx > **rx**: `number` +Defined in: [src/shapes/Rect.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L17) + #### Inherited from `UniqueRectProps.rx` -#### Defined in - -[src/shapes/Rect.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L17) - *** ### ry > **ry**: `number` +Defined in: [src/shapes/Rect.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L18) + #### Inherited from `UniqueRectProps.ry` -#### Defined in - -[src/shapes/Rect.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L18) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1173,16 +964,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1195,48 +984,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1245,16 +1018,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1267,16 +1038,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1289,16 +1058,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1311,32 +1078,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1344,16 +1107,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1367,16 +1128,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1389,16 +1148,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1411,16 +1168,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1433,38 +1188,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1477,16 +1222,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1512,16 +1255,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1534,19 +1275,17 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1558,16 +1297,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1580,16 +1317,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1602,50 +1337,30 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedCircleProps.md b/src/content/docs/api/interfaces/SerializedCircleProps.md index 9e4b3971a..a122900c2 100644 --- a/src/content/docs/api/interfaces/SerializedCircleProps.md +++ b/src/content/docs/api/interfaces/SerializedCircleProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedCircleProps" --- +Defined in: [src/shapes/Circle.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L45) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniqueCircleProps` @@ -15,6 +17,8 @@ title: "SerializedCircleProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,16 +63,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### counterClockwise > **counterClockwise**: `boolean` +Defined in: [src/shapes/Circle.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L42) + 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. @@ -93,16 +85,14 @@ false `UniqueCircleProps.counterClockwise` -#### Defined in - -[src/shapes/Circle.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L42) - *** ### endAngle > **endAngle**: `number` +Defined in: [src/shapes/Circle.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L34) + Angle for the end of the circle, in degrees #### Default @@ -115,15 +105,13 @@ Angle for the end of the circle, in degrees `UniqueCircleProps.endAngle` -#### Defined in - -[src/shapes/Circle.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L34) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -138,16 +126,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -162,16 +148,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -184,16 +168,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -206,63 +188,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -274,16 +238,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -296,38 +258,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -335,28 +291,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -364,28 +318,22 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### radius > **radius**: `number` +Defined in: [src/shapes/Circle.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L20) + Radius of this circle #### Default @@ -398,16 +346,14 @@ Radius of this circle `UniqueCircleProps.radius` -#### Defined in - -[src/shapes/Circle.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L20) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -420,16 +366,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -442,16 +386,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -464,16 +406,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -486,16 +426,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -508,16 +446,14 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### startAngle > **startAngle**: `number` +Defined in: [src/shapes/Circle.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Circle.ts#L27) + Angle for the start of the circle, in degrees. #### Default @@ -530,15 +466,13 @@ Angle for the start of the circle, in degrees. `UniqueCircleProps.startAngle` -#### Defined in - -[src/shapes/Circle.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Circle.ts#L27) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -553,16 +487,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -575,16 +507,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -597,16 +527,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -619,38 +547,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -663,16 +581,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -698,16 +614,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -720,19 +634,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -744,50 +656,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedEllipseProps.md b/src/content/docs/api/interfaces/SerializedEllipseProps.md index 74844dc8b..c5d3b51d3 100644 --- a/src/content/docs/api/interfaces/SerializedEllipseProps.md +++ b/src/content/docs/api/interfaces/SerializedEllipseProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedEllipseProps" --- +Defined in: [src/shapes/Ellipse.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L21) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniqueEllipseProps` @@ -15,6 +17,8 @@ title: "SerializedEllipseProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,63 +146,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -250,38 +216,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -289,28 +249,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -318,56 +276,46 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### rx > **rx**: `number` +Defined in: [src/shapes/Ellipse.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L17) + #### Inherited from `UniqueEllipseProps.rx` -#### Defined in - -[src/shapes/Ellipse.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L17) - *** ### ry > **ry**: `number` +Defined in: [src/shapes/Ellipse.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Ellipse.ts#L18) + #### Inherited from `UniqueEllipseProps.ry` -#### Defined in - -[src/shapes/Ellipse.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Ellipse.ts#L18) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -380,16 +328,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -402,16 +348,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -424,16 +368,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -446,16 +388,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -468,15 +408,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -491,16 +429,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -513,16 +449,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -535,16 +469,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -557,38 +489,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -601,16 +523,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -636,16 +556,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -658,19 +576,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -682,50 +598,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedGroupProps.md b/src/content/docs/api/interfaces/SerializedGroupProps.md index 004d0c3fa..4e175ce05 100644 --- a/src/content/docs/api/interfaces/SerializedGroupProps.md +++ b/src/content/docs/api/interfaces/SerializedGroupProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedGroupProps" --- +Defined in: [src/shapes/Group.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L59) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`GroupOwnProps`](/api/interfaces/groupownprops/) @@ -15,6 +17,8 @@ title: "SerializedGroupProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,77 +146,53 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### interactive > **interactive**: `boolean` +Defined in: [src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L56) + #### Inherited from [`GroupOwnProps`](/api/interfaces/groupownprops/).[`interactive`](/api/interfaces/groupownprops/#interactive) -#### Defined in - -[src/shapes/Group.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L56) - *** ### layoutManager > **layoutManager**: [`SerializedLayoutManager`](/api/type-aliases/serializedlayoutmanager/) -#### Defined in - -[src/shapes/Group.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L63) +Defined in: [src/shapes/Group.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L63) *** @@ -238,9 +200,11 @@ Object height > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -252,19 +216,13 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### objects > **objects**: [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/)[] -#### Defined in - -[src/shapes/Group.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L62) +Defined in: [src/shapes/Group.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L62) *** @@ -272,6 +230,8 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -284,38 +244,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -323,28 +277,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -352,28 +304,22 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -#### Default - -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -386,16 +332,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -408,16 +352,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -430,16 +372,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -452,16 +392,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -474,15 +412,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -497,16 +433,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -519,16 +453,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -541,16 +473,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -563,38 +493,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -607,16 +527,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -642,16 +560,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -664,33 +580,29 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### subTargetCheck > **subTargetCheck**: `boolean` +Defined in: [src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Group.ts#L55) + #### Inherited from [`GroupOwnProps`](/api/interfaces/groupownprops/).[`subTargetCheck`](/api/interfaces/groupownprops/#subtargetcheck) -#### Defined in - -[src/shapes/Group.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Group.ts#L55) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -702,50 +614,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedITextProps.md b/src/content/docs/api/interfaces/SerializedITextProps.md index eef9268b5..b6f598e2b 100644 --- a/src/content/docs/api/interfaces/SerializedITextProps.md +++ b/src/content/docs/api/interfaces/SerializedITextProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedITextProps" --- +Defined in: [src/shapes/IText/IText.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L74) + ## Extends - [`SerializedTextProps`](/api/interfaces/serializedtextprops/).`UniqueITextProps` @@ -19,6 +21,8 @@ title: "SerializedITextProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -31,53 +35,29 @@ Angle of rotation of an object (in degrees) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`angle`](/api/interfaces/serializedtextprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`backgroundColor`](/api/interfaces/serializedtextprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`charSpacing`](/api/interfaces/serializedtextprops/#charspacing) - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -87,29 +67,25 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`clipPath`](/api/interfaces/serializedtextprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`direction`](/api/interfaces/serializedtextprops/#direction) -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -124,16 +100,14 @@ rgb(0,0,0) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fill`](/api/interfaces/serializedtextprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -148,16 +122,14 @@ nonzero [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fillRule`](/api/interfaces/serializedtextprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -170,16 +142,14 @@ false [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`flipX`](/api/interfaces/serializedtextprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -192,109 +162,93 @@ false [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`flipY`](/api/interfaces/serializedtextprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fontFamily`](/api/interfaces/serializedtextprops/#fontfamily) -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fontSize`](/api/interfaces/serializedtextprops/#fontsize) -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fontStyle`](/api/interfaces/serializedtextprops/#fontstyle) -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`fontWeight`](/api/interfaces/serializedtextprops/#fontweight) -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Default - -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`globalCompositeOperation`](/api/interfaces/serializedtextprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) + Object height -#### Default +#### Inherited from -```ts +[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`height`](/api/interfaces/serializedtextprops/#height) -``` +*** -#### Inherited from +### charSpacing -[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`height`](/api/interfaces/serializedtextprops/#height) +> **charSpacing**: `number` -#### Defined in +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) +#### Inherited from + +[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`charSpacing`](/api/interfaces/serializedtextprops/#charspacing) *** @@ -302,9 +256,11 @@ Object height > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -316,44 +272,38 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`left`](/api/interfaces/serializedtextprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`lineHeight`](/api/interfaces/serializedtextprops/#lineheight) -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`linethrough`](/api/interfaces/serializedtextprops/#linethrough) -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -366,38 +316,32 @@ Opacity of an object [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`opacity`](/api/interfaces/serializedtextprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`originX`](/api/interfaces/serializedtextprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`originX`](/api/interfaces/serializedtextprops/#originx) *** @@ -405,28 +349,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`originY`](/api/interfaces/serializedtextprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`originY`](/api/interfaces/serializedtextprops/#originy) *** @@ -434,84 +376,70 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`overline`](/api/interfaces/serializedtextprops/#overline) -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`paintFirst`](/api/interfaces/serializedtextprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`path`](/api/interfaces/serializedtextprops/#path) -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`pathAlign`](/api/interfaces/serializedtextprops/#pathalign) -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`pathSide`](/api/interfaces/serializedtextprops/#pathside) -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -524,16 +452,14 @@ Object scale factor (horizontal) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`scaleX`](/api/interfaces/serializedtextprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -546,44 +472,38 @@ Object scale factor (vertical) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`scaleY`](/api/interfaces/serializedtextprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectionEnd > **selectionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L71) + #### Inherited from `UniqueITextProps.selectionEnd` -#### Defined in - -[src/shapes/IText/IText.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L68) - *** ### selectionStart > **selectionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L70) + #### Inherited from `UniqueITextProps.selectionStart` -#### Defined in - -[src/shapes/IText/IText.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L67) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -596,16 +516,14 @@ null [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`shadow`](/api/interfaces/serializedtextprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -618,16 +536,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`skewX`](/api/interfaces/serializedtextprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -640,15 +556,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`skewY`](/api/interfaces/serializedtextprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -663,16 +577,14 @@ null [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`stroke`](/api/interfaces/serializedtextprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -685,16 +597,14 @@ null; [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeDashArray`](/api/interfaces/serializedtextprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -707,16 +617,14 @@ Line offset of an object's stroke [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeDashOffset`](/api/interfaces/serializedtextprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -729,38 +637,28 @@ butt [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeLineCap`](/api/interfaces/serializedtextprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeLineJoin`](/api/interfaces/serializedtextprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -773,16 +671,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeMiterLimit`](/api/interfaces/serializedtextprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -808,16 +704,14 @@ false [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeUniform`](/api/interfaces/serializedtextprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -830,37 +724,41 @@ Width of a stroke used to render this object [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`strokeWidth`](/api/interfaces/serializedtextprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles -> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) +> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) + +Defined in: [src/shapes/Text/Text.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L118) #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`styles`](/api/interfaces/serializedtextprops/#styles) -#### Defined in - -[src/shapes/Text/Text.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L115) - *** ### textAlign > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`textAlign`](/api/interfaces/serializedtextprops/#textalign) -#### Defined in +*** + +### textDecorationThickness -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +> **textDecorationThickness**: `number` + +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from + +[`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`textDecorationThickness`](/api/interfaces/serializedtextprops/#textdecorationthickness) *** @@ -868,9 +766,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -882,64 +782,42 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`top`](/api/interfaces/serializedtextprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`underline`](/api/interfaces/serializedtextprops/#underline) -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`visible`](/api/interfaces/serializedtextprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedTextProps`](/api/interfaces/serializedtextprops/).[`width`](/api/interfaces/serializedtextprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedImageProps.md b/src/content/docs/api/interfaces/SerializedImageProps.md index 67e4b1ec9..14d278559 100644 --- a/src/content/docs/api/interfaces/SerializedImageProps.md +++ b/src/content/docs/api/interfaces/SerializedImageProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedImageProps" --- +Defined in: [src/shapes/Image.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L61) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) @@ -15,6 +17,8 @@ title: "SerializedImageProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,19 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### cropX > **cropX**: `number` -#### Defined in - -[src/shapes/Image.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L66) +Defined in: [src/shapes/Image.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L66) *** @@ -89,9 +77,7 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi > **cropY**: `number` -#### Defined in - -[src/shapes/Image.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L67) +Defined in: [src/shapes/Image.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L67) *** @@ -99,15 +85,15 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi > **crossOrigin**: [`TCrossOrigin`](/api/type-aliases/tcrossorigin/) -#### Defined in - -[src/shapes/Image.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L63) +Defined in: [src/shapes/Image.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L63) *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -122,16 +108,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -146,19 +130,13 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### filters > **filters**: `any`[] -#### Defined in - -[src/shapes/Image.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L64) +Defined in: [src/shapes/Image.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L64) *** @@ -166,6 +144,8 @@ nonzero > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -178,16 +158,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -200,63 +178,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -268,16 +228,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -290,38 +248,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -329,28 +281,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -358,31 +308,21 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -#### Default - -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### resizeFilter? -> `optional` **resizeFilter**: `any` - -#### Defined in +> `optional` **resizeFilter**: `ResizeOwnProps` -[src/shapes/Image.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L65) +Defined in: [src/shapes/Image.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L65) *** @@ -390,6 +330,8 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -402,16 +344,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -424,16 +364,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -446,16 +384,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -468,16 +404,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -490,25 +424,21 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### src > **src**: `string` -#### Defined in - -[src/shapes/Image.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L62) +Defined in: [src/shapes/Image.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L62) *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -523,16 +453,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -545,16 +473,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -567,16 +493,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -589,38 +513,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -633,16 +547,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -668,16 +580,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -690,19 +600,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -714,50 +622,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedLineProps.md b/src/content/docs/api/interfaces/SerializedLineProps.md index 78cbbddd4..0d40e08bc 100644 --- a/src/content/docs/api/interfaces/SerializedLineProps.md +++ b/src/content/docs/api/interfaces/SerializedLineProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedLineProps" --- +Defined in: [src/shapes/Line.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L25) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniqueLineProps` @@ -15,6 +17,8 @@ title: "SerializedLineProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,63 +146,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -250,38 +216,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -289,28 +249,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -318,28 +276,22 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -352,16 +304,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -374,16 +324,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -396,16 +344,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -418,16 +364,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -440,15 +384,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -463,16 +405,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -485,16 +425,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -507,16 +445,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -529,38 +465,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -573,16 +499,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -608,16 +532,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -630,19 +552,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -654,106 +574,78 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -```ts - -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) - *** ### x1 > **x1**: `number` +Defined in: [src/shapes/Line.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L19) + #### Inherited from `UniqueLineProps.x1` -#### Defined in - -[src/shapes/Line.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L19) - *** ### x2 > **x2**: `number` +Defined in: [src/shapes/Line.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L20) + #### Inherited from `UniqueLineProps.x2` -#### Defined in - -[src/shapes/Line.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L20) - *** ### y1 > **y1**: `number` +Defined in: [src/shapes/Line.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L21) + #### Inherited from `UniqueLineProps.y1` -#### Defined in - -[src/shapes/Line.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L21) - *** ### y2 > **y2**: `number` +Defined in: [src/shapes/Line.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Line.ts#L22) + #### Inherited from `UniqueLineProps.y2` - -#### Defined in - -[src/shapes/Line.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Line.ts#L22) diff --git a/src/content/docs/api/interfaces/SerializedObjectProps.md b/src/content/docs/api/interfaces/SerializedObjectProps.md index 8cf790cb3..2f891338a 100644 --- a/src/content/docs/api/interfaces/SerializedObjectProps.md +++ b/src/content/docs/api/interfaces/SerializedObjectProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedObjectProps" --- +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L5) + ## Extends - `BaseProps`.`FillStrokeProps` @@ -27,6 +29,8 @@ title: "SerializedObjectProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -39,49 +43,37 @@ Angle of rotation of an object (in degrees) `BaseProps.angle` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? -> `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +> `optional` **clipPath**: `Partial`\<`SerializedObjectProps` & `ClipPathProps`\> + +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) 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. If you want 0,0 of a clipPath to align with an object center, use clipPath.originX/Y to 'center' -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -96,16 +88,14 @@ rgb(0,0,0) `FillStrokeProps.fill` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -120,16 +110,14 @@ nonzero `FillStrokeProps.fillRule` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -142,16 +130,14 @@ false `BaseProps.flipX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -164,27 +150,15 @@ false `BaseProps.flipY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts - -``` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) +Composite rule used for canvas globalCompositeOperation *** @@ -192,31 +166,25 @@ Composite rule used for canvas globalCompositeOperation > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from `BaseProps.height` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject `BaseProps.left` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -246,38 +212,32 @@ Opacity of an object 1 ``` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -`BaseProps.originX` +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +`BaseProps.originX` *** @@ -285,28 +245,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -`BaseProps.originY` +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +`BaseProps.originY` *** @@ -314,28 +272,22 @@ To set the default value to 'center' import BaseFabricObject and set the static > **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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from `FillStrokeProps.paintFirst` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -348,16 +300,14 @@ Object scale factor (horizontal) `BaseProps.scaleX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -370,16 +320,14 @@ Object scale factor (vertical) `BaseProps.scaleY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -388,16 +336,14 @@ Shadow object representing shadow of this shape null ``` -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -410,16 +356,14 @@ Angle of skew on x axes of an object (in degrees) `BaseProps.skewX` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -432,15 +376,13 @@ Angle of skew on y axes of an object (in degrees) `BaseProps.skewY` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -455,16 +397,14 @@ null `FillStrokeProps.stroke` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -477,16 +417,14 @@ null; `FillStrokeProps.strokeDashArray` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -499,16 +437,14 @@ Line offset of an object's stroke `FillStrokeProps.strokeDashOffset` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -521,38 +457,28 @@ butt `FillStrokeProps.strokeLineCap` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from `FillStrokeProps.strokeLineJoin` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -565,16 +491,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke `FillStrokeProps.strokeMiterLimit` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -600,16 +524,14 @@ false `FillStrokeProps.strokeUniform` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -622,19 +544,17 @@ Width of a stroke used to render this object `FillStrokeProps.strokeWidth` -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -646,27 +566,15 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject `BaseProps.top` -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts - -``` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) +When set to `false`, an object is not rendered on canvas *** @@ -674,18 +582,10 @@ When set to `false`, an object is not rendered on canvas > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from `BaseProps.width` - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedPathProps.md b/src/content/docs/api/interfaces/SerializedPathProps.md index ddc19c6ad..0e5dd5eda 100644 --- a/src/content/docs/api/interfaces/SerializedPathProps.md +++ b/src/content/docs/api/interfaces/SerializedPathProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedPathProps" --- +Defined in: [src/shapes/Path.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L37) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniquePathProps` @@ -15,6 +17,8 @@ title: "SerializedPathProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,63 +146,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -250,38 +216,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -289,28 +249,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -318,42 +276,34 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### path? -> `optional` **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) +> `optional` **path**: [`TSimplePathData`](/api/type-aliases/tsimplepathdata/) + +Defined in: [src/shapes/Path.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L34) #### Inherited from `UniquePathProps.path` -#### Defined in - -[src/shapes/Path.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L34) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -366,16 +316,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -388,16 +336,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -410,16 +356,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -432,16 +376,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -454,29 +396,25 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### sourcePath? > `optional` **sourcePath**: `string` +Defined in: [src/shapes/Path.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Path.ts#L33) + #### Inherited from `UniquePathProps.sourcePath` -#### Defined in - -[src/shapes/Path.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Path.ts#L33) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -491,16 +429,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -513,16 +449,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -535,16 +469,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -557,38 +489,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -601,16 +523,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -636,16 +556,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -658,19 +576,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -682,50 +598,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedPolylineProps.md b/src/content/docs/api/interfaces/SerializedPolylineProps.md index 4c40b4f61..efac4fafd 100644 --- a/src/content/docs/api/interfaces/SerializedPolylineProps.md +++ b/src/content/docs/api/interfaces/SerializedPolylineProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedPolylineProps" --- +Defined in: [src/shapes/Polyline.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L36) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) @@ -15,6 +17,8 @@ title: "SerializedPolylineProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,63 +146,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -```ts - -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -250,38 +216,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -289,28 +249,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -318,31 +276,21 @@ To set the default value to 'center' import BaseFabricObject and set the static > **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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### points > **points**: [`XY`](/api/interfaces/xy/)[] -#### Defined in - -[src/shapes/Polyline.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Polyline.ts#L37) +Defined in: [src/shapes/Polyline.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Polyline.ts#L37) *** @@ -350,6 +298,8 @@ Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -362,16 +312,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -384,16 +332,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -406,16 +352,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -428,16 +372,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -450,15 +392,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -473,16 +413,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -495,16 +433,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -517,16 +453,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -539,38 +473,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -583,16 +507,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -618,16 +540,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -640,19 +560,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -664,50 +582,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedRectProps.md b/src/content/docs/api/interfaces/SerializedRectProps.md index 796a07c83..2daf52315 100644 --- a/src/content/docs/api/interfaces/SerializedRectProps.md +++ b/src/content/docs/api/interfaces/SerializedRectProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedRectProps" --- +Defined in: [src/shapes/Rect.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L21) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniqueRectProps` @@ -15,6 +17,8 @@ title: "SerializedRectProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,39 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -69,15 +63,13 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -92,16 +84,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -116,16 +106,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -138,16 +126,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -160,63 +146,45 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -228,16 +196,14 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -250,38 +216,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -289,28 +249,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -318,56 +276,46 @@ To set the default value to 'center' import BaseFabricObject and set the static > **paintFirst**: `"fill"` \| `"stroke"` -Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### rx > **rx**: `number` +Defined in: [src/shapes/Rect.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L17) + #### Inherited from `UniqueRectProps.rx` -#### Defined in - -[src/shapes/Rect.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L17) - *** ### ry > **ry**: `number` +Defined in: [src/shapes/Rect.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Rect.ts#L18) + #### Inherited from `UniqueRectProps.ry` -#### Defined in - -[src/shapes/Rect.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Rect.ts#L18) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -380,16 +328,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -402,16 +348,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -424,16 +368,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -446,16 +388,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -468,15 +408,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -491,16 +429,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -513,16 +449,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -535,16 +469,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -557,38 +489,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -601,16 +523,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -636,16 +556,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -658,19 +576,17 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### top > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -682,50 +598,30 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedTextProps.md b/src/content/docs/api/interfaces/SerializedTextProps.md index fe0c87fcd..5f30aba8c 100644 --- a/src/content/docs/api/interfaces/SerializedTextProps.md +++ b/src/content/docs/api/interfaces/SerializedTextProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedTextProps" --- +Defined in: [src/shapes/Text/Text.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L115) + ## Extends - [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).`UniqueTextProps` @@ -19,6 +21,8 @@ title: "SerializedTextProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -31,53 +35,29 @@ Angle of rotation of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`angle`](/api/interfaces/serializedobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`backgroundColor`](/api/interfaces/serializedobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -`UniqueTextProps.charSpacing` - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -87,29 +67,25 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`clipPath`](/api/interfaces/serializedobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from `UniqueTextProps.direction` -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -124,16 +100,14 @@ rgb(0,0,0) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fill`](/api/interfaces/serializedobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -148,16 +122,14 @@ nonzero [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`fillRule`](/api/interfaces/serializedobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -170,16 +142,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipX`](/api/interfaces/serializedobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -192,109 +162,93 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`flipY`](/api/interfaces/serializedobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from `UniqueTextProps.fontFamily` -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from `UniqueTextProps.fontSize` -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from `UniqueTextProps.fontStyle` -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from `UniqueTextProps.fontWeight` -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`globalCompositeOperation`](/api/interfaces/serializedobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) + Object height -#### Default +#### Inherited from -```ts +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) -``` +*** -#### Inherited from +### charSpacing -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`height`](/api/interfaces/serializedobjectprops/#height) +> **charSpacing**: `number` -#### Defined in +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) +#### Inherited from + +`UniqueTextProps.charSpacing` *** @@ -302,9 +256,11 @@ Object height > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -316,44 +272,38 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`left`](/api/interfaces/serializedobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from `UniqueTextProps.lineHeight` -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from `UniqueTextProps.linethrough` -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -366,38 +316,32 @@ Opacity of an object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`opacity`](/api/interfaces/serializedobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originX`](/api/interfaces/serializedobjectprops/#originx) *** @@ -405,28 +349,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`originY`](/api/interfaces/serializedobjectprops/#originy) *** @@ -434,84 +376,70 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from `UniqueTextProps.overline` -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -```ts - -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`paintFirst`](/api/interfaces/serializedobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from `UniqueTextProps.path` -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from `UniqueTextProps.pathAlign` -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from `UniqueTextProps.pathSide` -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -524,16 +452,14 @@ Object scale factor (horizontal) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleX`](/api/interfaces/serializedobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -546,16 +472,14 @@ Object scale factor (vertical) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`scaleY`](/api/interfaces/serializedobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -568,16 +492,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`shadow`](/api/interfaces/serializedobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -590,16 +512,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewX`](/api/interfaces/serializedobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -612,15 +532,13 @@ Angle of skew on y axes of an object (in degrees) [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`skewY`](/api/interfaces/serializedobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -635,16 +553,14 @@ null [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`stroke`](/api/interfaces/serializedobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -657,16 +573,14 @@ null; [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashArray`](/api/interfaces/serializedobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -679,16 +593,14 @@ Line offset of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeDashOffset`](/api/interfaces/serializedobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -701,38 +613,28 @@ butt [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineCap`](/api/interfaces/serializedobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeLineJoin`](/api/interfaces/serializedobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -745,16 +647,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeMiterLimit`](/api/interfaces/serializedobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -780,16 +680,14 @@ false [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeUniform`](/api/interfaces/serializedobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -802,19 +700,13 @@ Width of a stroke used to render this object [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`strokeWidth`](/api/interfaces/serializedobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles -> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) - -#### Defined in +> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) -[src/shapes/Text/Text.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L115) +Defined in: [src/shapes/Text/Text.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L118) *** @@ -822,13 +714,23 @@ Width of a stroke used to render this object > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from `UniqueTextProps.textAlign` -#### Defined in +*** + +### textDecorationThickness + +> **textDecorationThickness**: `number` -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from + +`UniqueTextProps.textDecorationThickness` *** @@ -836,9 +738,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -850,64 +754,42 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`top`](/api/interfaces/serializedobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from `UniqueTextProps.underline` -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`visible`](/api/interfaces/serializedobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -```ts - -``` +Object width #### Inherited from [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/).[`width`](/api/interfaces/serializedobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/SerializedTextboxProps.md b/src/content/docs/api/interfaces/SerializedTextboxProps.md index 2580b8672..2e672d411 100644 --- a/src/content/docs/api/interfaces/SerializedTextboxProps.md +++ b/src/content/docs/api/interfaces/SerializedTextboxProps.md @@ -5,6 +5,8 @@ prev: false title: "SerializedTextboxProps" --- +Defined in: [src/shapes/Textbox.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L42) + ## Extends - [`SerializedITextProps`](/api/interfaces/serializeditextprops/).`Pick`\<`UniqueTextboxProps`, `"minWidth"` \| `"splitByGrapheme"`\> @@ -15,6 +17,8 @@ title: "SerializedTextboxProps" > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -27,53 +31,29 @@ Angle of rotation of an object (in degrees) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`angle`](/api/interfaces/serializeditextprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`backgroundColor`](/api/interfaces/serializeditextprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`charSpacing`](/api/interfaces/serializeditextprops/#charspacing) - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: `Partial`\<[`SerializedObjectProps`](/api/interfaces/serializedobjectprops/) & `ClipPathProps`\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L46) + 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. @@ -83,29 +63,25 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`clipPath`](/api/interfaces/serializeditextprops/#clippath) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L49) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`direction`](/api/interfaces/serializeditextprops/#direction) -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### fill -> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **fill**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L16) Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -120,16 +96,14 @@ rgb(0,0,0) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fill`](/api/interfaces/serializeditextprops/#fill) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -144,16 +118,14 @@ nonzero [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fillRule`](/api/interfaces/serializeditextprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -166,16 +138,14 @@ false [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`flipX`](/api/interfaces/serializeditextprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -188,109 +158,93 @@ false [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`flipY`](/api/interfaces/serializeditextprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fontFamily`](/api/interfaces/serializeditextprops/#fontfamily) -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fontSize`](/api/interfaces/serializeditextprops/#fontsize) -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fontStyle`](/api/interfaces/serializeditextprops/#fontstyle) -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`fontWeight`](/api/interfaces/serializeditextprops/#fontweight) -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`globalCompositeOperation`](/api/interfaces/serializeditextprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### height > **height**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) + Object height -#### Default +#### Inherited from -```ts +[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`height`](/api/interfaces/serializeditextprops/#height) -``` +*** -#### Inherited from +### charSpacing -[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`height`](/api/interfaces/serializeditextprops/#height) +> **charSpacing**: `number` -#### Defined in +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) +#### Inherited from + +[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`charSpacing`](/api/interfaces/serializeditextprops/#charspacing) *** @@ -298,9 +252,11 @@ Object height > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -312,51 +268,41 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`left`](/api/interfaces/serializeditextprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`lineHeight`](/api/interfaces/serializeditextprops/#lineheight) -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`linethrough`](/api/interfaces/serializeditextprops/#linethrough) -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### minWidth > **minWidth**: `number` -#### Inherited from - -`Pick.minWidth` +Defined in: [src/shapes/Textbox.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L36) -#### Defined in +#### Inherited from -[src/shapes/Textbox.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L36) +[`TextboxProps`](/api/interfaces/textboxprops/).[`minWidth`](/api/interfaces/textboxprops/#minwidth) *** @@ -364,6 +310,8 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -376,38 +324,32 @@ Opacity of an object [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`opacity`](/api/interfaces/serializeditextprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`originX`](/api/interfaces/serializeditextprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`originX`](/api/interfaces/serializeditextprops/#originx) *** @@ -415,28 +357,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`originY`](/api/interfaces/serializeditextprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`originY`](/api/interfaces/serializeditextprops/#originy) *** @@ -444,84 +384,70 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`overline`](/api/interfaces/serializeditextprops/#overline) -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`paintFirst`](/api/interfaces/serializeditextprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`path`](/api/interfaces/serializeditextprops/#path) -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`pathAlign`](/api/interfaces/serializeditextprops/#pathalign) -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`pathSide`](/api/interfaces/serializeditextprops/#pathside) -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -534,16 +460,14 @@ Object scale factor (horizontal) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`scaleX`](/api/interfaces/serializeditextprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -556,44 +480,38 @@ Object scale factor (vertical) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`scaleY`](/api/interfaces/serializeditextprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectionEnd > **selectionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L71) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`selectionEnd`](/api/interfaces/serializeditextprops/#selectionend) -#### Defined in - -[src/shapes/IText/IText.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L68) - *** ### selectionStart > **selectionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L70) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`selectionStart`](/api/interfaces/serializeditextprops/#selectionstart) -#### Defined in - -[src/shapes/IText/IText.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L67) - *** ### shadow > **shadow**: `null` \| `Partial`\<[`SerializedShadowOptions`](/api/type-aliases/serializedshadowoptions/)\> +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L31) + Shadow object representing shadow of this shape #### Default @@ -606,16 +524,14 @@ null [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`shadow`](/api/interfaces/serializeditextprops/#shadow) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L33) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -628,16 +544,14 @@ Angle of skew on x axes of an object (in degrees) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`skewX`](/api/interfaces/serializeditextprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -650,29 +564,25 @@ Angle of skew on y axes of an object (in degrees) [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`skewY`](/api/interfaces/serializeditextprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### splitByGrapheme > **splitByGrapheme**: `boolean` -#### Inherited from - -`Pick.splitByGrapheme` +Defined in: [src/shapes/Textbox.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L37) -#### Defined in +#### Inherited from -[src/shapes/Textbox.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L37) +[`TextboxProps`](/api/interfaces/textboxprops/).[`splitByGrapheme`](/api/interfaces/textboxprops/#splitbygrapheme) *** ### stroke -> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"linear"`, `"linear"`\>\> & `object` \| `Partial`\<[`Gradient`](/api/classes/gradient/)\<`"radial"`, `"radial"`\>\> & `object` +> **stroke**: `null` \| `string` \| `Record`\<`string`, `any`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"linear"`\> \| [`SerializedGradientProps`](/api/type-aliases/serializedgradientprops/)\<`"radial"`\> + +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L33) 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/ @@ -687,16 +597,14 @@ null [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`stroke`](/api/interfaces/serializeditextprops/#stroke) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L34) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -709,16 +617,14 @@ null; [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeDashArray`](/api/interfaces/serializeditextprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -731,16 +637,14 @@ Line offset of an object's stroke [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeDashOffset`](/api/interfaces/serializeditextprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -753,38 +657,28 @@ butt [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeLineCap`](/api/interfaces/serializeditextprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -#### Default - -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeLineJoin`](/api/interfaces/serializeditextprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -797,16 +691,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeMiterLimit`](/api/interfaces/serializeditextprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -832,16 +724,14 @@ false [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeUniform`](/api/interfaces/serializeditextprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -854,37 +744,41 @@ Width of a stroke used to render this object [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`strokeWidth`](/api/interfaces/serializeditextprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles -> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) +> **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/fabric/namespaces/util/type-aliases/textstylearray/) + +Defined in: [src/shapes/Text/Text.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L118) #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`styles`](/api/interfaces/serializeditextprops/#styles) -#### Defined in - -[src/shapes/Text/Text.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L115) - *** ### textAlign > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`textAlign`](/api/interfaces/serializeditextprops/#textalign) -#### Defined in +*** + +### textDecorationThickness + +> **textDecorationThickness**: `number` + +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +[`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`textDecorationThickness`](/api/interfaces/serializeditextprops/#textdecorationthickness) *** @@ -892,9 +786,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -906,64 +802,42 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`top`](/api/interfaces/serializeditextprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`underline`](/api/interfaces/serializeditextprops/#underline) -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -#### Default - -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`visible`](/api/interfaces/serializeditextprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`SerializedITextProps`](/api/interfaces/serializeditextprops/).[`width`](/api/interfaces/serializeditextprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/StaticCanvasEvents.md b/src/content/docs/api/interfaces/StaticCanvasEvents.md index b7e099716..fc4fc6594 100644 --- a/src/content/docs/api/interfaces/StaticCanvasEvents.md +++ b/src/content/docs/api/interfaces/StaticCanvasEvents.md @@ -5,6 +5,8 @@ prev: false title: "StaticCanvasEvents" --- +Defined in: [src/EventTypeDefs.ts:307](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L307) + ## Extends - [`CollectionEvents`](/api/interfaces/collectionevents/) @@ -19,37 +21,31 @@ title: "StaticCanvasEvents" > **after:render**: `object` +Defined in: [src/EventTypeDefs.ts:313](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L313) + #### ctx > **ctx**: `CanvasRenderingContext2D` -#### Defined in - -[src/EventTypeDefs.ts:318](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L318) - *** ### before:render > **before:render**: `object` +Defined in: [src/EventTypeDefs.ts:312](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L312) + #### ctx > **ctx**: `CanvasRenderingContext2D` -#### Defined in - -[src/EventTypeDefs.ts:317](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L317) - *** ### canvas:cleared > **canvas:cleared**: `never` -#### Defined in - -[src/EventTypeDefs.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L314) +Defined in: [src/EventTypeDefs.ts:309](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L309) *** @@ -57,17 +53,15 @@ title: "StaticCanvasEvents" > **object:added**: `object` +Defined in: [src/EventTypeDefs.ts:235](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L235) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:added`](/api/interfaces/collectionevents/#object:added) - -#### Defined in - -[src/EventTypeDefs.ts:250](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L250) +[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:added`](/api/interfaces/collectionevents/#objectadded) *** @@ -75,46 +69,40 @@ title: "StaticCanvasEvents" > **object:layout:after**: [`LayoutAfterEvent`](/api/type-aliases/layoutafterevent/) & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:315](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L315) + +#### Type Declaration ##### target > **target**: [`Group`](/api/classes/group/) -#### Defined in - -[src/EventTypeDefs.ts:320](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L320) - *** ### object:layout:before > **object:layout:before**: [`LayoutBeforeEvent`](/api/type-aliases/layoutbeforeevent/) & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:314](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L314) + +#### Type Declaration ##### target > **target**: [`Group`](/api/classes/group/) -#### Defined in - -[src/EventTypeDefs.ts:319](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L319) - *** ### object:removed > **object:removed**: `object` +Defined in: [src/EventTypeDefs.ts:236](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L236) + #### target -> **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +> **target**: [`FabricObject`](/api/classes/fabricobject/) #### Inherited from -[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:removed`](/api/interfaces/collectionevents/#object:removed) - -#### Defined in - -[src/EventTypeDefs.ts:251](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L251) +[`CollectionEvents`](/api/interfaces/collectionevents/).[`object:removed`](/api/interfaces/collectionevents/#objectremoved) diff --git a/src/content/docs/api/interfaces/StaticCanvasOptions.md b/src/content/docs/api/interfaces/StaticCanvasOptions.md index faac7a33d..334155def 100644 --- a/src/content/docs/api/interfaces/StaticCanvasOptions.md +++ b/src/content/docs/api/interfaces/StaticCanvasOptions.md @@ -5,6 +5,8 @@ prev: false title: "StaticCanvasOptions" --- +Defined in: [src/canvas/StaticCanvasOptions.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L115) + ## Extends - `CanvasDrawableOptions`.`CanvasRenderingOptions`.`CanvasExportOptions` @@ -19,78 +21,56 @@ title: "StaticCanvasOptions" > **allowTouchScrolling**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:150](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L150) + Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas It gives PRIORITY to DOM scrolling, it doesn't make it always possible. If is true, when using a touch event on the canvas, the canvas will scroll if scroll is possible. If we are in drawing mode or if we are selecting an object the canvas preventDefault and so it won't scroll -#### Default - -```ts - -``` - #### Todo move to Canvas -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L163) - *** ### backgroundColor > **backgroundColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/) -Background color of canvas instance. +Defined in: [src/canvas/StaticCanvasOptions.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L18) -#### Default - -```ts - -``` +Background color of canvas instance. #### Inherited from `CanvasDrawableOptions.backgroundColor` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L20) - *** ### backgroundImage? > `optional` **backgroundImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L27) + 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 - -``` - #### Inherited from `CanvasDrawableOptions.backgroundImage` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L30) - *** ### backgroundVpt > **backgroundVpt**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L12) + if set to false background image is not affected by viewport transform #### Since @@ -101,26 +81,18 @@ if set to false background image is not affected by viewport transform we should really find a different way to do this -#### Default - -```ts - -``` - #### Inherited from `CanvasDrawableOptions.backgroundVpt` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L13) - *** ### clipPath? > `optional` **clipPath**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L96) + 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. @@ -130,169 +102,117 @@ clipPath will clip away controls, if you do not want this to happen use controls `CanvasRenderingOptions.clipPath` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L105) - *** ### controlsAboveOverlay > **controlsAboveOverlay**: `boolean` -Indicates whether object controls (borders/controls) are rendered above overlay image - -#### Default - -```ts +Defined in: [src/canvas/StaticCanvasOptions.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L139) -``` +Indicates whether object controls (borders/controls) are rendered above overlay image #### Todo move to Canvas -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:151](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L151) - *** ### enableRetinaScaling > **enableRetinaScaling**: `boolean` -When true, canvas is scaled by devicePixelRatio for better rendering on retina screens - -#### Default +Defined in: [src/canvas/StaticCanvasOptions.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L81) -```ts - -``` +When true, canvas is scaled by devicePixelRatio for better rendering on retina screens #### Inherited from `CanvasRenderingOptions.enableRetinaScaling` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L89) - *** ### height > **height**: `number` +Defined in: [src/canvas/StaticCanvasOptions.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L131) + Height in virtual/logical pixels of the canvas. The canvas can be taller than width if retina scaling is active -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L142) - *** ### imageSmoothingEnabled > **imageSmoothingEnabled**: `boolean` -Indicates whether this canvas will use image smoothing, this is on by default in browsers +Defined in: [src/canvas/StaticCanvasOptions.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L87) -#### Default - -```ts - -``` +Indicates whether this canvas will use image smoothing, this is on by default in browsers #### Inherited from `CanvasRenderingOptions.imageSmoothingEnabled` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L96) - *** ### includeDefaultValues > **includeDefaultValues**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L105) + Indicates whether toObject/toDatalessObject should include default values if set to false, takes precedence over the object value. -#### Default - -```ts - -``` - #### Inherited from `CanvasExportOptions.includeDefaultValues` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L115) - *** ### overlayColor > **overlayColor**: `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/canvas/StaticCanvasOptions.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L42) + Overlay color of canvas instance. #### Since 1.3.9 -#### Default - -```ts - -``` - #### Inherited from `CanvasDrawableOptions.overlayColor` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L47) - *** ### overlayImage? > `optional` **overlayImage**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/canvas/StaticCanvasOptions.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L51) + 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 - -``` - #### Inherited from `CanvasDrawableOptions.overlayImage` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:57](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L57) - *** ### overlayVpt > **overlayVpt**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L35) + if set to false overlay image is not affected by viewport transform #### Since @@ -303,53 +223,37 @@ if set to false overlay image is not affected by viewport transform we should really find a different way to do this -#### Default - -```ts - -``` - #### Inherited from `CanvasDrawableOptions.overlayVpt` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L39) - *** ### 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/StaticCanvasOptions.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L64) + +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 - -``` - #### Inherited from `CanvasRenderingOptions.renderOnAddRemove` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L71) - *** ### skipOffscreen > **skipOffscreen**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L75) + 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 @@ -366,39 +270,29 @@ true `CanvasRenderingOptions.skipOffscreen` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L82) - *** ### svgViewportTransformation > **svgViewportTransformation**: `boolean` +Defined in: [src/canvas/StaticCanvasOptions.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L112) + 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 - -``` - #### Inherited from `CanvasExportOptions.svgViewportTransformation` -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L123) - *** ### viewportTransform > **viewportTransform**: [`TMat2D`](/api/type-aliases/tmat2d/) +Defined in: [src/canvas/StaticCanvasOptions.ts:160](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L160) + The transformation (a Canvas 2D API transform matrix) which focuses the viewport #### Examples @@ -411,25 +305,13 @@ canvas.viewportTransform = [1, 0, 0, 1, 0, 0]; canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50]; ``` -#### Default - -```ts - -``` - -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:174](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L174) - *** ### width > **width**: `number` +Defined in: [src/canvas/StaticCanvasOptions.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvasOptions.ts#L124) + Width in virtual/logical pixels of the canvas. The canvas can be larger than width if retina scaling is active - -#### Defined in - -[src/canvas/StaticCanvasOptions.ts:135](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvasOptions.ts#L135) diff --git a/src/content/docs/api/interfaces/TEvent.md b/src/content/docs/api/interfaces/TEvent.md index aeb902be4..214be06db 100644 --- a/src/content/docs/api/interfaces/TEvent.md +++ b/src/content/docs/api/interfaces/TEvent.md @@ -5,6 +5,8 @@ prev: false title: "TEvent" --- +Defined in: [src/EventTypeDefs.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L101) + ## Extended by - [`BasicTransformEvent`](/api/interfaces/basictransformevent/) @@ -13,7 +15,9 @@ title: "TEvent" ## Type Parameters -• **E** *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### E + +`E` *extends* `Event` = [`TPointerEvent`](/api/type-aliases/tpointerevent/) ## Properties @@ -21,6 +25,4 @@ title: "TEvent" > **e**: `E` -#### Defined in - -[src/EventTypeDefs.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L96) +Defined in: [src/EventTypeDefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L102) diff --git a/src/content/docs/api/interfaces/TPointerEventInfo.md b/src/content/docs/api/interfaces/TPointerEventInfo.md index 0e80ec58f..84bd6bd77 100644 --- a/src/content/docs/api/interfaces/TPointerEventInfo.md +++ b/src/content/docs/api/interfaces/TPointerEventInfo.md @@ -5,57 +5,29 @@ prev: false title: "TPointerEventInfo" --- +Defined in: [src/EventTypeDefs.ts:164](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L164) + ## Extends - [`TEvent`](/api/interfaces/tevent/)\<`E`\> ## Type Parameters -• **E** *extends* [`TPointerEvent`](/api/type-aliases/tpointerevent/) = [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -## Properties - -### ~~absolutePointer~~ - -> **absolutePointer**: [`Point`](/api/classes/point/) - -:::caution[Deprecated] -use scenePoint instead. -Kept for compatibility -::: +### E -#### Defined in +`E` *extends* [`TPointerEvent`](/api/type-aliases/tpointerevent/) = [`TPointerEvent`](/api/type-aliases/tpointerevent/) -[src/EventTypeDefs.ts:171](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L171) - -*** +## Properties ### e > **e**: `E` -#### Inherited from - -[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e) - -#### Defined in +Defined in: [src/EventTypeDefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L102) -[src/EventTypeDefs.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L96) - -*** - -### ~~pointer~~ - -> **pointer**: [`Point`](/api/classes/point/) - -:::caution[Deprecated] -use viewportPoint instead. -Kept for compatibility -::: - -#### Defined in +#### Inherited from -[src/EventTypeDefs.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L165) +[`TEvent`](/api/interfaces/tevent/).[`e`](/api/interfaces/tevent/#e-1) *** @@ -63,9 +35,7 @@ Kept for compatibility > **scenePoint**: [`Point`](/api/classes/point/) -#### Defined in - -[src/EventTypeDefs.ts:172](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L172) +Defined in: [src/EventTypeDefs.ts:169](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L169) *** @@ -73,9 +43,7 @@ Kept for compatibility > `optional` **subTargets**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] -#### Defined in - -[src/EventTypeDefs.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L158) +Defined in: [src/EventTypeDefs.ts:167](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L167) *** @@ -83,9 +51,7 @@ Kept for compatibility > `optional` **target**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> -#### Defined in - -[src/EventTypeDefs.ts:157](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L157) +Defined in: [src/EventTypeDefs.ts:166](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L166) *** @@ -93,9 +59,7 @@ Kept for compatibility > `optional` **transform**: `null` \| [`Transform`](/api/type-aliases/transform/) -#### Defined in - -[src/EventTypeDefs.ts:159](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L159) +Defined in: [src/EventTypeDefs.ts:168](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L168) *** @@ -103,6 +67,4 @@ Kept for compatibility > **viewportPoint**: [`Point`](/api/classes/point/) -#### Defined in - -[src/EventTypeDefs.ts:173](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L173) +Defined in: [src/EventTypeDefs.ts:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L170) diff --git a/src/content/docs/api/interfaces/TextProps.md b/src/content/docs/api/interfaces/TextProps.md index 19e3e9ba1..8dd5a3e2f 100644 --- a/src/content/docs/api/interfaces/TextProps.md +++ b/src/content/docs/api/interfaces/TextProps.md @@ -5,6 +5,8 @@ prev: false title: "TextProps" --- +Defined in: [src/shapes/Text/Text.ts:121](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L121) + ## Extends - [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).`UniqueTextProps` @@ -19,6 +21,8 @@ title: "TextProps" > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -36,16 +40,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`absolutePositioned`](/api/interfaces/fabricobjectprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -58,39 +60,29 @@ Angle of rotation of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`angle`](/api/interfaces/fabricobjectprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`backgroundColor`](/api/interfaces/fabricobjectprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -103,16 +95,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderColor`](/api/interfaces/fabricobjectprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -123,16 +113,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderDashArray`](/api/interfaces/fabricobjectprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -145,20 +133,19 @@ Opacity of object's controlling borders when object is active and moving [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderOpacityWhenMoving`](/api/interfaces/fabricobjectprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -170,30 +157,26 @@ since there is no way to change the border itself. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`borderScaleFactor`](/api/interfaces/fabricobjectprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`canvas`](/api/interfaces/fabricobjectprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -204,26 +187,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredRotation`](/api/interfaces/fabricobjectprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -231,40 +206,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`centeredScaling`](/api/interfaces/fabricobjectprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -`UniqueTextProps.charSpacing` - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -274,16 +227,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`clipPath`](/api/interfaces/fabricobjectprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -296,16 +247,14 @@ rgb(178,204,255) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerColor`](/api/interfaces/fabricobjectprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -322,16 +271,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerDashArray`](/api/interfaces/fabricobjectprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -344,16 +291,14 @@ Size of object's controlling corners (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerSize`](/api/interfaces/fabricobjectprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -370,20 +315,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStrokeColor`](/api/interfaces/fabricobjectprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -394,86 +341,62 @@ 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`cornerStyle`](/api/interfaces/fabricobjectprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from `UniqueTextProps.direction` -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### 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/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -``` +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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`evented`](/api/interfaces/fabricobjectprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`excludeFromExport`](/api/interfaces/fabricobjectprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -487,16 +410,14 @@ rgb(0,0,0) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fill`](/api/interfaces/fabricobjectprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -511,16 +432,14 @@ nonzero [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`fillRule`](/api/interfaces/fabricobjectprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -533,16 +452,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipX`](/api/interfaces/fabricobjectprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -555,116 +472,90 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`flipY`](/api/interfaces/fabricobjectprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from `UniqueTextProps.fontFamily` -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from `UniqueTextProps.fontSize` -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from `UniqueTextProps.fontStyle` -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from `UniqueTextProps.fontWeight` -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`globalCompositeOperation`](/api/interfaces/fabricobjectprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered - -#### Default +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -```ts - -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasBorders`](/api/interfaces/fabricobjectprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -677,38 +568,28 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hasControls`](/api/interfaces/fabricobjectprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -``` +Object height #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`height`](/api/interfaces/fabricobjectprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -721,9 +602,17 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`hoverCursor`](/api/interfaces/fabricobjectprops/#hovercursor) -#### Defined in +*** + +### charSpacing + +> **charSpacing**: `number` + +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) +#### Inherited from + +`UniqueTextProps.charSpacing` *** @@ -731,28 +620,22 @@ null > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`includeDefaultValues`](/api/interfaces/fabricobjectprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -767,19 +650,17 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`inverted`](/api/interfaces/fabricobjectprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -791,220 +672,150 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`left`](/api/interfaces/fabricobjectprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from `UniqueTextProps.lineHeight` -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from `UniqueTextProps.linethrough` -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -``` +When `true`, object horizontal movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementX`](/api/interfaces/fabricobjectprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockMovementY`](/api/interfaces/fabricobjectprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -```ts - -``` +When `true`, object rotation is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockRotation`](/api/interfaces/fabricobjectprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingFlip`](/api/interfaces/fabricobjectprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -```ts - -``` +When `true`, object horizontal scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingX`](/api/interfaces/fabricobjectprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -#### Default - -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockScalingY`](/api/interfaces/fabricobjectprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -```ts - -``` +When `true`, object horizontal skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingX`](/api/interfaces/fabricobjectprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -``` +When `true`, object vertical skewing is locked #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`lockSkewingY`](/api/interfaces/fabricobjectprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -1017,16 +828,14 @@ Minimum allowed scale value of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`minScaleLimit`](/api/interfaces/fabricobjectprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -1039,16 +848,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`moveCursor`](/api/interfaces/fabricobjectprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -1065,16 +872,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`noScaleCache`](/api/interfaces/fabricobjectprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1093,16 +898,14 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`objectCaching`](/api/interfaces/fabricobjectprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1115,38 +918,32 @@ Opacity of an object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`opacity`](/api/interfaces/fabricobjectprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originX`](/api/interfaces/fabricobjectprops/#originx) *** @@ -1154,28 +951,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`originY`](/api/interfaces/fabricobjectprops/#originy) *** @@ -1183,20 +978,20 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from `UniqueTextProps.overline` -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### padding > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1209,102 +1004,78 @@ Padding between object and its controlling borders (in pixels) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`padding`](/api/interfaces/fabricobjectprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`paintFirst`](/api/interfaces/fabricobjectprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from `UniqueTextProps.path` -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from `UniqueTextProps.pathAlign` -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from `UniqueTextProps.pathSide` -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### perPixelTargetFind > **perPixelTargetFind**: `boolean` -When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -#### Default - -```ts - -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`perPixelTargetFind`](/api/interfaces/fabricobjectprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1317,16 +1088,14 @@ Object scale factor (horizontal) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleX`](/api/interfaces/fabricobjectprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1339,48 +1108,32 @@ Object scale factor (vertical) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`scaleY`](/api/interfaces/fabricobjectprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectable`](/api/interfaces/fabricobjectprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1389,16 +1142,14 @@ This API is no longer supported and may be removed in a future release. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`selectionBackgroundColor`](/api/interfaces/fabricobjectprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1411,16 +1162,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`shadow`](/api/interfaces/fabricobjectprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1433,16 +1182,14 @@ Angle of skew on x axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewX`](/api/interfaces/fabricobjectprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1455,32 +1202,28 @@ Angle of skew on y axes of an object (in degrees) [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`skewY`](/api/interfaces/fabricobjectprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapAngle`](/api/interfaces/fabricobjectprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1488,16 +1231,14 @@ When undefined, the snapThreshold will default to the snapAngle. [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`snapThreshold`](/api/interfaces/fabricobjectprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1511,16 +1252,14 @@ null [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`stroke`](/api/interfaces/fabricobjectprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1533,16 +1272,14 @@ null; [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashArray`](/api/interfaces/fabricobjectprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1555,16 +1292,14 @@ Line offset of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeDashOffset`](/api/interfaces/fabricobjectprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1577,38 +1312,28 @@ butt [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineCap`](/api/interfaces/fabricobjectprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -```ts - -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeLineJoin`](/api/interfaces/fabricobjectprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1621,16 +1346,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeMiterLimit`](/api/interfaces/fabricobjectprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1656,16 +1379,14 @@ false [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeUniform`](/api/interfaces/fabricobjectprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1678,19 +1399,13 @@ Width of a stroke used to render this object [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`strokeWidth`](/api/interfaces/fabricobjectprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles > **styles**: [`TextStyle`](/api/type-aliases/textstyle/) -#### Defined in - -[src/shapes/Text/Text.ts:119](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L119) +Defined in: [src/shapes/Text/Text.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L122) *** @@ -1698,13 +1413,23 @@ Width of a stroke used to render this object > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from `UniqueTextProps.textAlign` -#### Defined in +*** + +### textDecorationThickness + +> **textDecorationThickness**: `number` -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from + +`UniqueTextProps.textDecorationThickness` *** @@ -1712,9 +1437,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1726,16 +1453,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`top`](/api/interfaces/fabricobjectprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1748,16 +1473,14 @@ Size of object's controlling corners when touch interaction is detected [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`touchCornerSize`](/api/interfaces/fabricobjectprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1770,64 +1493,42 @@ true [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`transparentCorners`](/api/interfaces/fabricobjectprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from `UniqueTextProps.underline` -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas - -#### Default - -```ts +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`visible`](/api/interfaces/fabricobjectprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`FabricObjectProps`](/api/interfaces/fabricobjectprops/).[`width`](/api/interfaces/fabricobjectprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/TextboxProps.md b/src/content/docs/api/interfaces/TextboxProps.md index 340f3b67e..32647b03f 100644 --- a/src/content/docs/api/interfaces/TextboxProps.md +++ b/src/content/docs/api/interfaces/TextboxProps.md @@ -5,6 +5,8 @@ prev: false title: "TextboxProps" --- +Defined in: [src/shapes/Textbox.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L46) + ## Extends - [`ITextProps`](/api/interfaces/itextprops/).`UniqueTextboxProps` @@ -15,20 +17,20 @@ title: "TextboxProps" > **\_wordJoiners**: `RegExp` +Defined in: [src/shapes/Textbox.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L39) + #### Inherited from `UniqueTextboxProps._wordJoiners` -#### Defined in - -[src/shapes/Textbox.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L39) - *** ### absolutePositioned > **absolutePositioned**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L69) + 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 @@ -46,16 +48,14 @@ false [`ITextProps`](/api/interfaces/itextprops/).[`absolutePositioned`](/api/interfaces/itextprops/#absolutepositioned) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L72) - *** ### angle > **angle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L61) + Angle of rotation of an object (in degrees) #### Default @@ -68,39 +68,29 @@ Angle of rotation of an object (in degrees) [`ITextProps`](/api/interfaces/itextprops/).[`angle`](/api/interfaces/itextprops/#angle) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L63) - *** ### backgroundColor > **backgroundColor**: `string` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L24) + Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ -#### Default - -```ts - -``` - #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`backgroundColor`](/api/interfaces/itextprops/#backgroundcolor) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L26) - *** ### borderColor > **borderColor**: `string` +Defined in: [src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L7) + Color of controlling borders of an object (when it's active) #### Default @@ -113,16 +103,14 @@ rgb(178,204,255) [`ITextProps`](/api/interfaces/itextprops/).[`borderColor`](/api/interfaces/itextprops/#bordercolor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L7) - *** ### borderDashArray > **borderDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L15) + Array specifying dash pattern of an object's borders (hasBorder must be true) #### Since @@ -133,16 +121,14 @@ Array specifying dash pattern of an object's borders (hasBorder must be true) [`ITextProps`](/api/interfaces/itextprops/).[`borderDashArray`](/api/interfaces/itextprops/#borderdasharray) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L15) - *** ### borderOpacityWhenMoving > **borderOpacityWhenMoving**: `number` +Defined in: [src/shapes/Object/types/BorderProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L28) + Opacity of object's controlling borders when object is active and moving #### Default @@ -155,20 +141,19 @@ Opacity of object's controlling borders when object is active and moving [`ITextProps`](/api/interfaces/itextprops/).[`borderOpacityWhenMoving`](/api/interfaces/itextprops/#borderopacitywhenmoving) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L29) - *** ### 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/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L39) + +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 @@ -180,30 +165,26 @@ since there is no way to change the border itself. [`ITextProps`](/api/interfaces/itextprops/).[`borderScaleFactor`](/api/interfaces/itextprops/#borderscalefactor) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L39) - *** ### canvas? > `optional` **canvas**: [`Canvas`](/api/classes/canvas/) \| [`StaticCanvas`](/api/classes/staticcanvas/)\<[`StaticCanvasEvents`](/api/interfaces/staticcanvasevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L20) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`canvas`](/api/interfaces/itextprops/#canvas) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L20) - *** ### centeredRotation > **centeredRotation**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L26) + 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 @@ -214,26 +195,18 @@ The object method `rotate` will always consider this property and never the canv 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`centeredRotation`](/api/interfaces/itextprops/#centeredrotation) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L27) - *** ### centeredScaling > **centeredScaling**: `boolean` +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L34) + When true, this object will use center point as the origin of transformation when being scaled via the controls. @@ -241,40 +214,18 @@ when being scaled via the controls. 1.3.4 -#### Default - -```ts - -``` - #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`centeredScaling`](/api/interfaces/itextprops/#centeredscaling) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L36) - -*** - -### charSpacing - -> **charSpacing**: `number` - -#### Inherited from - -[`ITextProps`](/api/interfaces/itextprops/).[`charSpacing`](/api/interfaces/itextprops/#charspacing) - -#### Defined in - -[src/shapes/Text/Text.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L96) - *** ### clipPath? > `optional` **clipPath**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> +Defined in: [src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L16) + 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. @@ -284,16 +235,14 @@ If you want 0,0 of a clipPath to align with an object center, use clipPath.origi [`ITextProps`](/api/interfaces/itextprops/).[`clipPath`](/api/interfaces/itextprops/#clippath) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L16) - *** ### cornerColor > **cornerColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L28) + Color of controlling corners of an object (when it's active) #### Default @@ -306,16 +255,14 @@ rgb(178,204,255) [`ITextProps`](/api/interfaces/itextprops/).[`cornerColor`](/api/interfaces/itextprops/#cornercolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L28) - *** ### cornerDashArray > **cornerDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L55) + Array specifying dash pattern of an object's control (hasBorder must be true) #### Since @@ -332,16 +279,14 @@ null [`ITextProps`](/api/interfaces/itextprops/).[`cornerDashArray`](/api/interfaces/itextprops/#cornerdasharray) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L55) - *** ### cornerSize > **cornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L7) + Size of object's controlling corners (in pixels) #### Default @@ -354,16 +299,14 @@ Size of object's controlling corners (in pixels) [`ITextProps`](/api/interfaces/itextprops/).[`cornerSize`](/api/interfaces/itextprops/#cornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L7) - *** ### cornerStrokeColor > **cornerStrokeColor**: `string` +Defined in: [src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L36) + Color of controlling corners of an object (when it's active and transparentCorners false) #### Since @@ -380,20 +323,22 @@ Color of controlling corners of an object (when it's active and transparentCorne [`ITextProps`](/api/interfaces/itextprops/).[`cornerStrokeColor`](/api/interfaces/itextprops/#cornerstrokecolor) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L36) - *** ### ~~cornerStyle~~ > **cornerStyle**: `"circle"` \| `"rect"` +Defined in: [src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L47) + 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 @@ -404,100 +349,74 @@ 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 [`ITextProps`](/api/interfaces/itextprops/).[`cornerStyle`](/api/interfaces/itextprops/#cornerstyle) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L47) - *** ### direction > **direction**: `CanvasDirection` +Defined in: [src/shapes/Text/Text.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L110) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`direction`](/api/interfaces/itextprops/#direction) -#### Defined in - -[src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L108) - *** ### dynamicMinWidth > **dynamicMinWidth**: `number` +Defined in: [src/shapes/Textbox.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L38) + #### Inherited from `UniqueTextboxProps.dynamicMinWidth` -#### Defined in - -[src/shapes/Textbox.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L38) - *** ### 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 +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L61) -#### Default - -```ts - -``` +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 [`ITextProps`](/api/interfaces/itextprops/).[`evented`](/api/interfaces/itextprops/#evented) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L65) - *** ### excludeFromExport > **excludeFromExport**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L50) + When `true`, object is not exported in OBJECT/JSON #### Since 1.6.3 -#### Default - -```ts - -``` - #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`excludeFromExport`](/api/interfaces/itextprops/#excludefromexport) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L52) - *** ### fill > **fill**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L17) + Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ @@ -511,16 +430,14 @@ rgb(0,0,0) [`ITextProps`](/api/interfaces/itextprops/).[`fill`](/api/interfaces/itextprops/#fill) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L17) - *** ### fillRule > **fillRule**: `CanvasFillRule` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L25) + 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) @@ -535,16 +452,14 @@ nonzero [`ITextProps`](/api/interfaces/itextprops/).[`fillRule`](/api/interfaces/itextprops/#fillrule) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L26) - *** ### flipX > **flipX**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L68) + When true, an object is rendered as flipped horizontally #### Default @@ -557,16 +472,14 @@ false [`ITextProps`](/api/interfaces/itextprops/).[`flipX`](/api/interfaces/itextprops/#flipx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L70) - *** ### flipY > **flipY**: `boolean` +Defined in: [src/shapes/Object/types/BaseProps.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L75) + When true, an object is rendered as flipped vertically #### Default @@ -579,116 +492,90 @@ false [`ITextProps`](/api/interfaces/itextprops/).[`flipY`](/api/interfaces/itextprops/#flipy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L77) - *** ### fontFamily > **fontFamily**: `string` +Defined in: [src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L102) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`fontFamily`](/api/interfaces/itextprops/#fontfamily) -#### Defined in - -[src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L100) - *** ### fontSize > **fontSize**: `number` +Defined in: [src/shapes/Text/Text.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L100) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`fontSize`](/api/interfaces/itextprops/#fontsize) -#### Defined in - -[src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L98) - *** ### fontStyle > **fontStyle**: `string` +Defined in: [src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L103) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`fontStyle`](/api/interfaces/itextprops/#fontstyle) -#### Defined in - -[src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L101) - *** ### fontWeight > **fontWeight**: `string` \| `number` +Defined in: [src/shapes/Text/Text.ts:101](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L101) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`fontWeight`](/api/interfaces/itextprops/#fontweight) -#### Defined in - -[src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L99) - *** ### globalCompositeOperation > **globalCompositeOperation**: `GlobalCompositeOperation` -Composite rule used for canvas globalCompositeOperation - -#### Default +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L17) -```ts - -``` +Composite rule used for canvas globalCompositeOperation #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`globalCompositeOperation`](/api/interfaces/itextprops/#globalcompositeoperation) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L18) - *** ### hasBorders > **hasBorders**: `boolean` -When set to `false`, object's controlling borders are not rendered +Defined in: [src/shapes/Object/types/BorderProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BorderProps.ts#L21) -#### Default - -```ts - -``` +When set to `false`, object's controlling borders are not rendered #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`hasBorders`](/api/interfaces/itextprops/#hasborders) -#### Defined in - -[src/shapes/Object/types/BorderProps.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BorderProps.ts#L22) - *** ### hasControls > **hasControls**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L69) + When set to `false`, object's controls are not displayed and can not be used to manipulate object #### Default @@ -701,38 +588,28 @@ true [`ITextProps`](/api/interfaces/itextprops/).[`hasControls`](/api/interfaces/itextprops/#hascontrols) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L69) - *** ### height > **height**: `number` -Object height +Defined in: [src/shapes/Object/types/BaseProps.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L32) -#### Default - -```ts - -``` +Object height #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`height`](/api/interfaces/itextprops/#height) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L34) - *** ### hoverCursor > **hoverCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L27) + Default cursor value used when hovering over this object on canvas #### Default @@ -745,9 +622,17 @@ null [`ITextProps`](/api/interfaces/itextprops/).[`hoverCursor`](/api/interfaces/itextprops/#hovercursor) -#### Defined in +*** + +### charSpacing + +> **charSpacing**: `number` -[src/shapes/Object/types/FabricObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L27) +Defined in: [src/shapes/Text/Text.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L98) + +#### Inherited from + +[`ITextProps`](/api/interfaces/itextprops/).[`charSpacing`](/api/interfaces/itextprops/#charspacing) *** @@ -755,28 +640,22 @@ null > **includeDefaultValues**: `boolean` -When `false`, default object's values are not included in its serialization - -#### Default - -```ts +Defined in: [src/shapes/Object/types/ObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L43) -``` +When `false`, default object's values are not included in its serialization #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`includeDefaultValues`](/api/interfaces/itextprops/#includedefaultvalues) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L44) - *** ### inverted > **inverted**: `boolean` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L57) + 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 @@ -791,19 +670,17 @@ false [`ITextProps`](/api/interfaces/itextprops/).[`inverted`](/api/interfaces/itextprops/#inverted) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L60) - *** ### left > **left**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L11) + 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 @@ -815,220 +692,150 @@ You can change this by setting [originX](../../../../api/interfaces/fabricobject [`ITextProps`](/api/interfaces/itextprops/).[`left`](/api/interfaces/itextprops/#left) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L11) - *** ### lineHeight > **lineHeight**: `number` +Defined in: [src/shapes/Text/Text.ts:99](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L99) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lineHeight`](/api/interfaces/itextprops/#lineheight) -#### Defined in - -[src/shapes/Text/Text.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L97) - *** ### linethrough > **linethrough**: `boolean` +Defined in: [src/shapes/Text/Text.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L108) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`linethrough`](/api/interfaces/itextprops/#linethrough) -#### Defined in - -[src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L106) - *** ### lockMovementX > **lockMovementX**: `boolean` -When `true`, object horizontal movement is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L6) -```ts - -``` +When `true`, object horizontal movement is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockMovementX`](/api/interfaces/itextprops/#lockmovementx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L7) - *** ### lockMovementY > **lockMovementY**: `boolean` -When `true`, object vertical movement is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:12](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L12) -``` +When `true`, object vertical movement is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockMovementY`](/api/interfaces/itextprops/#lockmovementy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L14) - *** ### lockRotation > **lockRotation**: `boolean` -When `true`, object rotation is locked +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L18) -#### Default - -```ts - -``` +When `true`, object rotation is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockRotation`](/api/interfaces/itextprops/#lockrotation) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L21) - *** ### lockScalingFlip > **lockScalingFlip**: `boolean` -When `true`, object cannot be flipped by scaling into negative values - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L48) -``` +When `true`, object cannot be flipped by scaling into negative values #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockScalingFlip`](/api/interfaces/itextprops/#lockscalingflip) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L56) - *** ### lockScalingX > **lockScalingX**: `boolean` -When `true`, object horizontal scaling is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L24) -``` +When `true`, object horizontal scaling is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockScalingX`](/api/interfaces/itextprops/#lockscalingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L28) - *** ### lockScalingY > **lockScalingY**: `boolean` -When `true`, object vertical scaling is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L30) -```ts - -``` +When `true`, object vertical scaling is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockScalingY`](/api/interfaces/itextprops/#lockscalingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L35) - *** ### lockSkewingX > **lockSkewingX**: `boolean` -When `true`, object horizontal skewing is locked - -#### Default - -```ts +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L36) -``` +When `true`, object horizontal skewing is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockSkewingX`](/api/interfaces/itextprops/#lockskewingx) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L42) - *** ### lockSkewingY > **lockSkewingY**: `boolean` -When `true`, object vertical skewing is locked - -#### Default +Defined in: [src/shapes/Object/types/LockInteractionProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/LockInteractionProps.ts#L42) -```ts - -``` +When `true`, object vertical skewing is locked #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`lockSkewingY`](/api/interfaces/itextprops/#lockskewingy) -#### Defined in - -[src/shapes/Object/types/LockInteractionProps.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/LockInteractionProps.ts#L49) - *** ### minScaleLimit > **minScaleLimit**: `number` +Defined in: [src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L27) + Minimum allowed scale value of an object #### Default @@ -1041,30 +848,26 @@ Minimum allowed scale value of an object [`ITextProps`](/api/interfaces/itextprops/).[`minScaleLimit`](/api/interfaces/itextprops/#minscalelimit) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L27) - *** ### minWidth > **minWidth**: `number` +Defined in: [src/shapes/Textbox.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L36) + #### Inherited from `UniqueTextboxProps.minWidth` -#### Defined in - -[src/shapes/Textbox.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L36) - *** ### moveCursor > **moveCursor**: `null` \| `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L34) + Default cursor value used when moving this object on canvas #### Default @@ -1077,16 +880,14 @@ null [`ITextProps`](/api/interfaces/itextprops/).[`moveCursor`](/api/interfaces/itextprops/#movecursor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L34) - *** ### noScaleCache? > `optional` **noScaleCache**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L20) + 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. @@ -1103,16 +904,14 @@ true [`ITextProps`](/api/interfaces/itextprops/).[`noScaleCache`](/api/interfaces/itextprops/#noscalecache) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L20) - *** ### objectCaching > **objectCaching**: `boolean` +Defined in: [src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L37) + When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true @@ -1131,16 +930,14 @@ true [`ITextProps`](/api/interfaces/itextprops/).[`objectCaching`](/api/interfaces/itextprops/#objectcaching) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L37) - *** ### opacity > **opacity**: `number` +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L11) + Opacity of an object #### Default @@ -1153,38 +950,32 @@ Opacity of an object [`ITextProps`](/api/interfaces/itextprops/).[`opacity`](/api/interfaces/itextprops/#opacity) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L11) - *** ### ~~originX~~ > **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +Defined in: [src/shapes/Object/types/BaseProps.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L43) + Horizontal origin of transformation of an object (`left`, `center`, `right` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'left' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originX = 'center' ::: -#### Inherited from +#### Default -[`ITextProps`](/api/interfaces/itextprops/).[`originX`](/api/interfaces/itextprops/#originx) +```ts +'left' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L45) +[`ITextProps`](/api/interfaces/itextprops/).[`originX`](/api/interfaces/itextprops/#originx) *** @@ -1192,28 +983,26 @@ To set the default value to 'center' import BaseFabricObject and set the static > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +Defined in: [src/shapes/Object/types/BaseProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L54) + Vertical origin of transformation of an object (`top`, `center`, `bottom` or `[0, 1]`) See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups -#### Default - -```ts -'top' -``` - :::caution[Deprecated] please set your default to 'center' in new projects and don't use it to build logic The reason is explained here: https://github.com/fabricjs/fabric.js/discussions/9736 To set the default value to 'center' import BaseFabricObject and set the static BaseFabricObject.ownDefaults.originY = 'center' ::: -#### Inherited from +#### Default -[`ITextProps`](/api/interfaces/itextprops/).[`originY`](/api/interfaces/itextprops/#originy) +```ts +'top' +``` -#### Defined in +#### Inherited from -[src/shapes/Object/types/BaseProps.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L56) +[`ITextProps`](/api/interfaces/itextprops/).[`originY`](/api/interfaces/itextprops/#originy) *** @@ -1221,20 +1010,20 @@ To set the default value to 'center' import BaseFabricObject and set the static > **overline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L107) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`overline`](/api/interfaces/itextprops/#overline) -#### Defined in - -[src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L105) - *** ### padding > **padding**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L62) + Padding between object and its controlling borders (in pixels) #### Default @@ -1247,102 +1036,78 @@ Padding between object and its controlling borders (in pixels) [`ITextProps`](/api/interfaces/itextprops/).[`padding`](/api/interfaces/itextprops/#padding) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L62) - *** ### 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/types/FillStrokeProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L8) -``` +Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`paintFirst`](/api/interfaces/itextprops/#paintfirst) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L9) - *** ### 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:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L111) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`path`](/api/interfaces/itextprops/#path) -#### Defined in - -[src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L109) - *** ### pathAlign > **pathAlign**: [`TPathAlign`](/api/type-aliases/tpathalign/) +Defined in: [src/shapes/Text/Text.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L105) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`pathAlign`](/api/interfaces/itextprops/#pathalign) -#### Defined in - -[src/shapes/Text/Text.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L103) - *** ### pathSide > **pathSide**: [`TPathSide`](/api/type-aliases/tpathside/) +Defined in: [src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L104) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`pathSide`](/api/interfaces/itextprops/#pathside) -#### Defined in - -[src/shapes/Text/Text.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L102) - *** ### 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/types/FabricObjectProps.ts:48](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L48) -``` +When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`perPixelTargetFind`](/api/interfaces/itextprops/#perpixeltargetfind) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L50) - *** ### scaleX > **scaleX**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L82) + Object scale factor (horizontal) #### Default @@ -1355,16 +1120,14 @@ Object scale factor (horizontal) [`ITextProps`](/api/interfaces/itextprops/).[`scaleX`](/api/interfaces/itextprops/#scalex) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L84) - *** ### scaleY > **scaleY**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L89) + Object scale factor (vertical) #### Default @@ -1377,48 +1140,32 @@ Object scale factor (vertical) [`ITextProps`](/api/interfaces/itextprops/).[`scaleY`](/api/interfaces/itextprops/#scaley) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L91) - *** ### selectable > **selectable**: `boolean` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L55) + 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 [`ITextProps`](/api/interfaces/itextprops/).[`selectable`](/api/interfaces/itextprops/#selectable) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L58) - *** ### ~~selectionBackgroundColor~~ > **selectionBackgroundColor**: `string` +Defined in: [src/shapes/Object/types/FabricObjectProps.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FabricObjectProps.ts#L42) + 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. ::: @@ -1427,44 +1174,38 @@ This API is no longer supported and may be removed in a future release. [`ITextProps`](/api/interfaces/itextprops/).[`selectionBackgroundColor`](/api/interfaces/itextprops/#selectionbackgroundcolor) -#### Defined in - -[src/shapes/Object/types/FabricObjectProps.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FabricObjectProps.ts#L43) - *** ### selectionEnd > **selectionEnd**: `number` +Defined in: [src/shapes/IText/IText.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L71) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`selectionEnd`](/api/interfaces/itextprops/#selectionend) -#### Defined in - -[src/shapes/IText/IText.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L68) - *** ### selectionStart > **selectionStart**: `number` +Defined in: [src/shapes/IText/IText.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L70) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`selectionStart`](/api/interfaces/itextprops/#selectionstart) -#### Defined in - -[src/shapes/IText/IText.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L67) - *** ### shadow > **shadow**: `null` \| [`Shadow`](/api/classes/shadow/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L19) + Shadow object representing shadow of this shape #### Default @@ -1477,16 +1218,14 @@ null [`ITextProps`](/api/interfaces/itextprops/).[`shadow`](/api/interfaces/itextprops/#shadow) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L19) - *** ### skewX > **skewX**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L96) + Angle of skew on x axes of an object (in degrees) #### Default @@ -1499,16 +1238,14 @@ Angle of skew on x axes of an object (in degrees) [`ITextProps`](/api/interfaces/itextprops/).[`skewX`](/api/interfaces/itextprops/#skewx) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L98) - *** ### skewY > **skewY**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/BaseProps.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L103) + Angle of skew on y axes of an object (in degrees) #### Default @@ -1521,32 +1258,28 @@ Angle of skew on y axes of an object (in degrees) [`ITextProps`](/api/interfaces/itextprops/).[`skewY`](/api/interfaces/itextprops/#skewy) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L105) - *** ### snapAngle? > `optional` **snapAngle**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L8) + The angle that an object will lock to while rotating. #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`snapAngle`](/api/interfaces/itextprops/#snapangle) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L8) - *** ### snapThreshold? > `optional` **snapThreshold**: [`TDegree`](/api/type-aliases/tdegree/) +Defined in: [src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectTransformProps.ts#L15) + The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle. @@ -1554,30 +1287,26 @@ When undefined, the snapThreshold will default to the snapAngle. [`ITextProps`](/api/interfaces/itextprops/).[`snapThreshold`](/api/interfaces/itextprops/#snapthreshold) -#### Defined in - -[src/shapes/Object/types/ObjectTransformProps.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectTransformProps.ts#L15) - *** ### splitByGrapheme > **splitByGrapheme**: `boolean` +Defined in: [src/shapes/Textbox.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L37) + #### Inherited from `UniqueTextboxProps.splitByGrapheme` -#### Defined in - -[src/shapes/Textbox.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L37) - *** ### stroke > **stroke**: `null` \| `string` \| [`TFiller`](/api/type-aliases/tfiller/) +Defined in: [src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ObjectProps.ts#L18) + 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/ @@ -1591,16 +1320,14 @@ null [`ITextProps`](/api/interfaces/itextprops/).[`stroke`](/api/interfaces/itextprops/#stroke) -#### Defined in - -[src/shapes/Object/types/ObjectProps.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ObjectProps.ts#L18) - *** ### strokeDashArray > **strokeDashArray**: `null` \| `number`[] +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L47) + Array specifying dash pattern of an object's stroke (stroke must be defined) #### Default @@ -1613,16 +1340,14 @@ null; [`ITextProps`](/api/interfaces/itextprops/).[`strokeDashArray`](/api/interfaces/itextprops/#strokedasharray) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L48) - *** ### strokeDashOffset > **strokeDashOffset**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L54) + Line offset of an object's stroke #### Default @@ -1635,16 +1360,14 @@ Line offset of an object's stroke [`ITextProps`](/api/interfaces/itextprops/).[`strokeDashOffset`](/api/interfaces/itextprops/#strokedashoffset) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:55](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L55) - *** ### strokeLineCap > **strokeLineCap**: `CanvasLineCap` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L61) + Line endings style of an object's stroke (one of "butt", "round", "square") #### Default @@ -1657,38 +1380,28 @@ butt [`ITextProps`](/api/interfaces/itextprops/).[`strokeLineCap`](/api/interfaces/itextprops/#strokelinecap) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L62) - *** ### strokeLineJoin > **strokeLineJoin**: `CanvasLineJoin` -Corner style of an object's stroke (one of "bevel", "round", "miter") - -#### Default - -```ts +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L67) -``` +Corner style of an object's stroke (one of "bevel", "round", "miter") #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`strokeLineJoin`](/api/interfaces/itextprops/#strokelinejoin) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L69) - *** ### strokeMiterLimit > **strokeMiterLimit**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L74) + Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke #### Default @@ -1701,16 +1414,14 @@ Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke [`ITextProps`](/api/interfaces/itextprops/).[`strokeMiterLimit`](/api/interfaces/itextprops/#strokemiterlimit) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L76) - *** ### strokeUniform > **strokeUniform**: `boolean` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L87) + 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 @@ -1736,16 +1447,14 @@ false [`ITextProps`](/api/interfaces/itextprops/).[`strokeUniform`](/api/interfaces/itextprops/#strokeuniform) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L89) - *** ### strokeWidth > **strokeWidth**: `number` +Defined in: [src/shapes/Object/types/FillStrokeProps.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/FillStrokeProps.ts#L40) + Width of a stroke used to render this object #### Default @@ -1758,37 +1467,41 @@ Width of a stroke used to render this object [`ITextProps`](/api/interfaces/itextprops/).[`strokeWidth`](/api/interfaces/itextprops/#strokewidth) -#### Defined in - -[src/shapes/Object/types/FillStrokeProps.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/FillStrokeProps.ts#L41) - *** ### styles > **styles**: [`TextStyle`](/api/type-aliases/textstyle/) +Defined in: [src/shapes/Text/Text.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L122) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`styles`](/api/interfaces/itextprops/#styles) -#### Defined in - -[src/shapes/Text/Text.ts:119](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L119) - *** ### textAlign > **textAlign**: `string` +Defined in: [src/shapes/Text/Text.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L109) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`textAlign`](/api/interfaces/itextprops/#textalign) -#### Defined in +*** + +### textDecorationThickness -[src/shapes/Text/Text.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L107) +> **textDecorationThickness**: `number` + +Defined in: [src/shapes/Text/Text.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L112) + +#### Inherited from + +[`ITextProps`](/api/interfaces/itextprops/).[`textDecorationThickness`](/api/interfaces/itextprops/#textdecorationthickness) *** @@ -1796,9 +1509,11 @@ Width of a stroke used to render this object > **top**: `number` +Defined in: [src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L20) + 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 @@ -1810,16 +1525,14 @@ You can change this by setting [originY](../../../../api/interfaces/fabricobject [`ITextProps`](/api/interfaces/itextprops/).[`top`](/api/interfaces/itextprops/#top) -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L20) - *** ### touchCornerSize > **touchCornerSize**: `number` +Defined in: [src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L14) + Size of object's controlling corners when touch interaction is detected #### Default @@ -1832,16 +1545,14 @@ Size of object's controlling corners when touch interaction is detected [`ITextProps`](/api/interfaces/itextprops/).[`touchCornerSize`](/api/interfaces/itextprops/#touchcornersize) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L14) - *** ### transparentCorners > **transparentCorners**: `boolean` +Defined in: [src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/ControlProps.ts#L21) + When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) #### Default @@ -1854,64 +1565,42 @@ true [`ITextProps`](/api/interfaces/itextprops/).[`transparentCorners`](/api/interfaces/itextprops/#transparentcorners) -#### Defined in - -[src/shapes/Object/types/ControlProps.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/ControlProps.ts#L21) - *** ### underline > **underline**: `boolean` +Defined in: [src/shapes/Text/Text.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L106) + #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`underline`](/api/interfaces/itextprops/#underline) -#### Defined in - -[src/shapes/Text/Text.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L104) - *** ### visible > **visible**: `boolean` -When set to `false`, an object is not rendered on canvas +Defined in: [src/shapes/Object/types/SerializedObjectProps.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/SerializedObjectProps.ts#L37) -#### Default - -```ts - -``` +When set to `false`, an object is not rendered on canvas #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`visible`](/api/interfaces/itextprops/#visible) -#### Defined in - -[src/shapes/Object/types/SerializedObjectProps.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/SerializedObjectProps.ts#L40) - *** ### width > **width**: `number` -Object width - -#### Default - -```ts +Defined in: [src/shapes/Object/types/BaseProps.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/BaseProps.ts#L26) -``` +Object width #### Inherited from [`ITextProps`](/api/interfaces/itextprops/).[`width`](/api/interfaces/itextprops/#width) - -#### Defined in - -[src/shapes/Object/types/BaseProps.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/BaseProps.ts#L27) diff --git a/src/content/docs/api/interfaces/XY.md b/src/content/docs/api/interfaces/XY.md index 2cdb235e6..0b0988fa0 100644 --- a/src/content/docs/api/interfaces/XY.md +++ b/src/content/docs/api/interfaces/XY.md @@ -5,15 +5,15 @@ prev: false title: "XY" --- +Defined in: [src/Point.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L5) + ## Properties ### x > **x**: `number` -#### Defined in - -[src/Point.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L6) +Defined in: [src/Point.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L6) *** @@ -21,6 +21,4 @@ title: "XY" > **y**: `number` -#### Defined in - -[src/Point.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Point.ts#L7) +Defined in: [src/Point.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Point.ts#L7) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/changeWidth.md b/src/content/docs/api/namespaces/controlsUtils/functions/changeWidth.md deleted file mode 100644 index 7a138f011..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/changeWidth.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "changeWidth" ---- - -> **changeWidth**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -• **x**: `number` - -• **y**: `number` - -## Returns - -`boolean` - -## Defined in - -[src/controls/changeWidth.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/changeWidth.ts#L52) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createPathControls.md b/src/content/docs/api/namespaces/controlsUtils/functions/createPathControls.md deleted file mode 100644 index b143179d7..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createPathControls.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createPathControls" ---- - -> **createPathControls**(`path`, `options`): `Record`\<`string`, [`Control`](/api/classes/control/)\> - -## Parameters - -• **path**: [`Path`](/api/classes/path/)\<`Partial`\<[`PathProps`](/api/interfaces/pathprops/)\>, [`SerializedPathProps`](/api/interfaces/serializedpathprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -• **options**: `Partial`\<[`Control`](/api/classes/control/)\> & `object` = `{}` - -## Returns - -`Record`\<`string`, [`Control`](/api/classes/control/)\> - -## Defined in - -[src/controls/pathControl.ts:240](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/pathControl.ts#L240) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyControls.md b/src/content/docs/api/namespaces/controlsUtils/functions/createPolyControls.md deleted file mode 100644 index b51d434b9..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyControls.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createPolyControls" ---- - -## createPolyControls(poly, options) - -> **createPolyControls**(`poly`, `options`?): `Record`\<`string`, [`Control`](/api/classes/control/)\> - -### Parameters - -• **poly**: [`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -• **options?**: `Partial`\<[`Control`](/api/classes/control/)\> - -### Returns - -`Record`\<`string`, [`Control`](/api/classes/control/)\> - -### Defined in - -[src/controls/polyControl.ts:105](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L105) - -## createPolyControls(numOfControls, options) - -> **createPolyControls**(`numOfControls`, `options`?): `Record`\<`string`, [`Control`](/api/classes/control/)\> - -### Parameters - -• **numOfControls**: `number` - -• **options?**: `Partial`\<[`Control`](/api/classes/control/)\> - -### Returns - -`Record`\<`string`, [`Control`](/api/classes/control/)\> - -### Defined in - -[src/controls/polyControl.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L109) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyPositionHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/createPolyPositionHandler.md deleted file mode 100644 index a1346d895..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/createPolyPositionHandler.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createPolyPositionHandler" ---- - -> **createPolyPositionHandler**(`pointIndex`): (`dim`, `finalMatrix`, `polyObject`) => [`Point`](/api/classes/point/) - -This function locates the controls. -It'll be used both for drawing and for interaction. - -## Parameters - -• **pointIndex**: `number` - -## Returns - -`Function` - -### Parameters - -• **dim**: [`Point`](/api/classes/point/) - -• **finalMatrix**: [`TMat2D`](/api/type-aliases/tmat2d/) - -• **polyObject**: [`Polyline`](/api/classes/polyline/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedPolylineProps`](/api/interfaces/serializedpolylineprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -### Returns - -[`Point`](/api/classes/point/) - -## Defined in - -[src/controls/polyControl.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L24) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/factoryPolyActionHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/factoryPolyActionHandler.md deleted file mode 100644 index 967f4d812..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/factoryPolyActionHandler.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "factoryPolyActionHandler" ---- - -> **factoryPolyActionHandler**(`pointIndex`, `fn`): (`eventData`, `transform`, `x`, `y`) => `boolean` - -Keep the polygon in the same position when we change its `width`/`height`/`top`/`left`. - -## Parameters - -• **pointIndex**: `number` - -• **fn**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`TTransformAnchor`\> - -## Returns - -`Function` - -### Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -• **x**: `number` - -• **y**: `number` - -### Returns - -`boolean` - -## Defined in - -[src/controls/polyControl.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/polyControl.ts#L68) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/getLocalPoint.md b/src/content/docs/api/namespaces/controlsUtils/functions/getLocalPoint.md deleted file mode 100644 index 6031016b3..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/getLocalPoint.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getLocalPoint" ---- - -> **getLocalPoint**(`transform`, `originX`, `originY`, `x`, `y`): [`Point`](/api/classes/point/) - -Transforms a point to the offset from the given origin - -## Parameters - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -• **originX**: [`TOriginX`](/api/type-aliases/toriginx/) - -• **originY**: [`TOriginY`](/api/type-aliases/toriginy/) - -• **x**: `number` - -• **y**: `number` - -## Returns - -[`Point`](/api/classes/point/) - -the normalized point - -## Defined in - -[src/controls/util.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/util.ts#L132) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/renderCircleControl.md b/src/content/docs/api/namespaces/controlsUtils/functions/renderCircleControl.md deleted file mode 100644 index 8c67a2b4c..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/renderCircleControl.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "renderCircleControl" ---- - -> **renderCircleControl**(`this`, `ctx`, `left`, `top`, `styleOverride`, `fabricObject`): `void` - -Render a round control, as per fabric features. -This function is written to respect object properties like transparentCorners, cornerSize -cornerColor, cornerStrokeColor -plus the addition of offsetY and offsetX. - -## Parameters - -• **this**: [`Control`](/api/classes/control/) - -• **ctx**: `CanvasRenderingContext2D` - -context to render on - -• **left**: `number` - -x coordinate where the control center should be - -• **top**: `number` - -y coordinate where the control center should be - -• **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"`\>\> - -override for FabricObject controls style - -• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object for which we are rendering controls - -## Returns - -`void` - -## Defined in - -[src/controls/controlRendering.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/controlRendering.ts#L39) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/renderSquareControl.md b/src/content/docs/api/namespaces/controlsUtils/functions/renderSquareControl.md deleted file mode 100644 index 0d5464542..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/renderSquareControl.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "renderSquareControl" ---- - -> **renderSquareControl**(`this`, `ctx`, `left`, `top`, `styleOverride`, `fabricObject`): `void` - -Render a square control, as per fabric features. -This function is written to respect object properties like transparentCorners, cornerSize -cornerColor, cornerStrokeColor -plus the addition of offsetY and offsetX. - -## Parameters - -• **this**: [`Control`](/api/classes/control/) - -• **ctx**: `CanvasRenderingContext2D` - -context to render on - -• **left**: `number` - -x coordinate where the control center should be - -• **top**: `number` - -y coordinate where the control center should be - -• **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"`\>\> - -override for FabricObject controls style - -• **fabricObject**: [`InteractiveFabricObject`](/api/classes/interactivefabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object for which we are rendering controls - -## Returns - -`void` - -## Defined in - -[src/controls/controlRendering.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/controlRendering.ts#L100) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/rotationStyleHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/rotationStyleHandler.md deleted file mode 100644 index 4596ecde3..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/rotationStyleHandler.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "rotationStyleHandler" ---- - -> **rotationStyleHandler**(`eventData`, `control`, `fabricObject`): `string` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -the javascript event that is causing the scale - -• **control**: [`Control`](/api/classes/control/) - -the control that is interested in the action - -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object that is interested in the action - -## Returns - -`string` - -a valid css string for the cursor - -## Defined in - -[src/controls/rotate.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/rotate.ts#L19) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/rotationWithSnapping.md b/src/content/docs/api/namespaces/controlsUtils/functions/rotationWithSnapping.md deleted file mode 100644 index d0d129009..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/rotationWithSnapping.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "rotationWithSnapping" ---- - -> **rotationWithSnapping**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -• **x**: `number` - -• **y**: `number` - -## Returns - -`boolean` - -## Defined in - -[src/controls/rotate.ts:85](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/rotate.ts#L85) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scaleCursorStyleHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/scaleCursorStyleHandler.md deleted file mode 100644 index c17858207..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scaleCursorStyleHandler.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scaleCursorStyleHandler" ---- - -> **scaleCursorStyleHandler**(`eventData`, `control`, `fabricObject`): `string` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -the javascript event that is causing the scale - -• **control**: [`Control`](/api/classes/control/) - -the control that is interested in the action - -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object that is interested in the action - -## Returns - -`string` - -a valid css string for the cursor - -## Defined in - -[src/controls/scale.ts:95](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scale.ts#L95) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scaleOrSkewActionName.md b/src/content/docs/api/namespaces/controlsUtils/functions/scaleOrSkewActionName.md deleted file mode 100644 index 886c7ada2..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scaleOrSkewActionName.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scaleOrSkewActionName" ---- - -> **scaleOrSkewActionName**(`eventData`, `control`, `fabricObject`): `""` \| [`TAxisKey`](/api/type-aliases/taxiskey/)\<`"scale"` \| `"skew"`\> - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -the javascript event that is causing the scale - -• **control**: [`Control`](/api/classes/control/) - -the control that is interested in the action - -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object that is interested in the action - -## Returns - -`""` \| [`TAxisKey`](/api/type-aliases/taxiskey/)\<`"scale"` \| `"skew"`\> - -an action name - -## Defined in - -[src/controls/scaleSkew.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scaleSkew.ts#L24) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scaleSkewCursorStyleHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/scaleSkewCursorStyleHandler.md deleted file mode 100644 index a4c668ff3..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scaleSkewCursorStyleHandler.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scaleSkewCursorStyleHandler" ---- - -> **scaleSkewCursorStyleHandler**(`eventData`, `control`, `fabricObject`): `string` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -the javascript event that is causing the scale - -• **control**: [`Control`](/api/classes/control/) - -the control that is interested in the action - -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object that is interested in the action - -## Returns - -`string` - -a valid css string for the cursor - -## Defined in - -[src/controls/scaleSkew.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scaleSkew.ts#L46) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scalingEqually.md b/src/content/docs/api/namespaces/controlsUtils/functions/scalingEqually.md deleted file mode 100644 index 1442127c3..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scalingEqually.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scalingEqually" ---- - -> **scalingEqually**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: `ScaleTransform` - -• **x**: `number` - -• **y**: `number` - -## Returns - -`boolean` - -## Defined in - -[src/controls/scale.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scale.ts#L274) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scalingX.md b/src/content/docs/api/namespaces/controlsUtils/functions/scalingX.md deleted file mode 100644 index f5d67b151..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scalingX.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scalingX" ---- - -> **scalingX**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: `ScaleTransform` - -• **x**: `number` - -• **y**: `number` - -## Returns - -`boolean` - -## Defined in - -[src/controls/scale.ts:279](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scale.ts#L279) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scalingXOrSkewingY.md b/src/content/docs/api/namespaces/controlsUtils/functions/scalingXOrSkewingY.md deleted file mode 100644 index d5e9ff738..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scalingXOrSkewingY.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scalingXOrSkewingY" ---- - -> **scalingXOrSkewingY**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -javascript event that is doing the transform - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -javascript object containing a series of information around the current transform - -• **x**: `number` - -current mouse x position, canvas normalized - -• **y**: `number` - -current mouse y position, canvas normalized - -## Returns - -`boolean` - -true if some change happened - -## Defined in - -[src/controls/scaleSkew.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scaleSkew.ts#L64) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scalingY.md b/src/content/docs/api/namespaces/controlsUtils/functions/scalingY.md deleted file mode 100644 index a7ca1d82a..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scalingY.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scalingY" ---- - -> **scalingY**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -• **transform**: `ScaleTransform` - -• **x**: `number` - -• **y**: `number` - -## Returns - -`boolean` - -## Defined in - -[src/controls/scale.ts:284](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scale.ts#L284) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/scalingYOrSkewingX.md b/src/content/docs/api/namespaces/controlsUtils/functions/scalingYOrSkewingX.md deleted file mode 100644 index 280db0502..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/scalingYOrSkewingX.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "scalingYOrSkewingX" ---- - -> **scalingYOrSkewingX**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -javascript event that is doing the transform - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -javascript object containing a series of information around the current transform - -• **x**: `number` - -current mouse x position, canvas normalized - -• **y**: `number` - -current mouse y position, canvas normalized - -## Returns - -`boolean` - -true if some change happened - -## Defined in - -[src/controls/scaleSkew.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/scaleSkew.ts#L84) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/skewCursorStyleHandler.md b/src/content/docs/api/namespaces/controlsUtils/functions/skewCursorStyleHandler.md deleted file mode 100644 index 135ea72d2..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/skewCursorStyleHandler.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "skewCursorStyleHandler" ---- - -> **skewCursorStyleHandler**(`eventData`, `control`, `fabricObject`): `string` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -the javascript event that is causing the scale - -• **control**: [`Control`](/api/classes/control/) - -the control that is interested in the action - -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the fabric object that is interested in the action - -## Returns - -`string` - -a valid css string for the cursor - -## Defined in - -[src/controls/skew.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/skew.ts#L71) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerX.md b/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerX.md deleted file mode 100644 index 479c96f6c..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerX.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "skewHandlerX" ---- - -> **skewHandlerX**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -javascript event that is doing the transform - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -javascript object containing a series of information around the current transform - -• **x**: `number` - -current mouse x position, canvas normalized - -• **y**: `number` - -current mouse y position, canvas normalized - -## Returns - -`boolean` - -true if some change happened - -## Defined in - -[src/controls/skew.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/skew.ts#L225) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerY.md b/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerY.md deleted file mode 100644 index b29faa178..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/skewHandlerY.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "skewHandlerY" ---- - -> **skewHandlerY**(`eventData`, `transform`, `x`, `y`): `boolean` - -## Parameters - -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -javascript event that is doing the transform - -• **transform**: [`Transform`](/api/type-aliases/transform/) - -javascript object containing a series of information around the current transform - -• **x**: `number` - -current mouse x position, canvas normalized - -• **y**: `number` - -current mouse y position, canvas normalized - -## Returns - -`boolean` - -true if some change happened - -## Defined in - -[src/controls/skew.ts:243](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/skew.ts#L243) diff --git a/src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFireEvent.md b/src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFireEvent.md deleted file mode 100644 index b328f9ff5..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/functions/wrapWithFireEvent.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "wrapWithFireEvent" ---- - -> **wrapWithFireEvent**\<`T`, `P`\>(`eventName`, `actionHandler`, `extraEventInfo`?): [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> - -## Type Parameters - -• **T** *extends* [`Transform`](/api/type-aliases/transform/) - -• **P** *extends* `object` = `Record`\<`string`, `never`\> - -## Parameters - -• **eventName**: [`TModificationEvents`](/api/type-aliases/tmodificationevents/) - -the event we want to fire - -• **actionHandler**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> - -the function to wrap - -• **extraEventInfo?**: `P` - -extra information to pas to the event handler - -## Returns - -[`TransformActionHandler`](/api/type-aliases/transformactionhandler/)\<`T`\> - -a function with an action handler signature - -## Defined in - -[src/controls/wrapWithFireEvent.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/wrapWithFireEvent.ts#L16) diff --git a/src/content/docs/api/namespaces/controlsUtils/index.md b/src/content/docs/api/namespaces/controlsUtils/index.md deleted file mode 100644 index 02783fa97..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/index.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "controlsUtils" ---- - -## Index - -### Type Aliases - -- [PathPointControlStyle](/api/namespaces/controlsutils/type-aliases/pathpointcontrolstyle/) - -### Functions - -- [changeWidth](/api/namespaces/controlsutils/functions/changewidth/) -- [createObjectDefaultControls](/api/namespaces/controlsutils/functions/createobjectdefaultcontrols/) -- [createPathControls](/api/namespaces/controlsutils/functions/createpathcontrols/) -- [createPolyActionHandler](/api/namespaces/controlsutils/functions/createpolyactionhandler/) -- [createPolyControls](/api/namespaces/controlsutils/functions/createpolycontrols/) -- [createPolyPositionHandler](/api/namespaces/controlsutils/functions/createpolypositionhandler/) -- [createResizeControls](/api/namespaces/controlsutils/functions/createresizecontrols/) -- [createTextboxDefaultControls](/api/namespaces/controlsutils/functions/createtextboxdefaultcontrols/) -- [factoryPolyActionHandler](/api/namespaces/controlsutils/functions/factorypolyactionhandler/) -- [getLocalPoint](/api/namespaces/controlsutils/functions/getlocalpoint/) -- [polyActionHandler](/api/namespaces/controlsutils/functions/polyactionhandler/) -- [renderCircleControl](/api/namespaces/controlsutils/functions/rendercirclecontrol/) -- [renderSquareControl](/api/namespaces/controlsutils/functions/rendersquarecontrol/) -- [rotationStyleHandler](/api/namespaces/controlsutils/functions/rotationstylehandler/) -- [rotationWithSnapping](/api/namespaces/controlsutils/functions/rotationwithsnapping/) -- [scaleCursorStyleHandler](/api/namespaces/controlsutils/functions/scalecursorstylehandler/) -- [scaleOrSkewActionName](/api/namespaces/controlsutils/functions/scaleorskewactionname/) -- [scaleSkewCursorStyleHandler](/api/namespaces/controlsutils/functions/scaleskewcursorstylehandler/) -- [scalingEqually](/api/namespaces/controlsutils/functions/scalingequally/) -- [scalingX](/api/namespaces/controlsutils/functions/scalingx/) -- [scalingXOrSkewingY](/api/namespaces/controlsutils/functions/scalingxorskewingy/) -- [scalingY](/api/namespaces/controlsutils/functions/scalingy/) -- [scalingYOrSkewingX](/api/namespaces/controlsutils/functions/scalingyorskewingx/) -- [skewCursorStyleHandler](/api/namespaces/controlsutils/functions/skewcursorstylehandler/) -- [skewHandlerX](/api/namespaces/controlsutils/functions/skewhandlerx/) -- [skewHandlerY](/api/namespaces/controlsutils/functions/skewhandlery/) -- [wrapWithFireEvent](/api/namespaces/controlsutils/functions/wrapwithfireevent/) -- [wrapWithFixedAnchor](/api/namespaces/controlsutils/functions/wrapwithfixedanchor/) diff --git a/src/content/docs/api/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md b/src/content/docs/api/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md deleted file mode 100644 index 01e0e3b44..000000000 --- a/src/content/docs/api/namespaces/controlsUtils/type-aliases/PathPointControlStyle.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "PathPointControlStyle" ---- - -> **PathPointControlStyle**: `object` - -## Type declaration - -### connectionDashArray? - -> `optional` **connectionDashArray**: `number`[] - -### controlFill? - -> `optional` **controlFill**: `string` - -### controlStroke? - -> `optional` **controlStroke**: `string` - -## Defined in - -[src/controls/pathControl.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/controls/pathControl.ts#L21) diff --git a/src/content/docs/api/namespaces/filters/classes/BaseFilter.md b/src/content/docs/api/namespaces/filters/classes/BaseFilter.md deleted file mode 100644 index 9c57b1a85..000000000 --- a/src/content/docs/api/namespaces/filters/classes/BaseFilter.md +++ /dev/null @@ -1,563 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "BaseFilter" ---- - -## Extended by - -- [`BlendColor`](/api/namespaces/filters/classes/blendcolor/) -- [`BlendImage`](/api/namespaces/filters/classes/blendimage/) -- [`Blur`](/api/namespaces/filters/classes/blur/) -- [`Brightness`](/api/namespaces/filters/classes/brightness/) -- [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) -- [`Composed`](/api/namespaces/filters/classes/composed/) -- [`Contrast`](/api/namespaces/filters/classes/contrast/) -- [`Convolute`](/api/namespaces/filters/classes/convolute/) -- [`Gamma`](/api/namespaces/filters/classes/gamma/) -- [`Grayscale`](/api/namespaces/filters/classes/grayscale/) -- [`Invert`](/api/namespaces/filters/classes/invert/) -- [`Noise`](/api/namespaces/filters/classes/noise/) -- [`Pixelate`](/api/namespaces/filters/classes/pixelate/) -- [`RemoveColor`](/api/namespaces/filters/classes/removecolor/) -- [`Resize`](/api/namespaces/filters/classes/resize/) -- [`Saturation`](/api/namespaces/filters/classes/saturation/) -- [`Vibrance`](/api/namespaces/filters/classes/vibrance/) - -## Type Parameters - -• **Name** *extends* `string` - -• **OwnProps** *extends* `Record`\<`string`, `any`\> = `object` - -## Constructors - -### new BaseFilter() - -> **new BaseFilter**\<`Name`, `OwnProps`\>(`options`?): [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`Name`, `OwnProps`\> - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`OwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`Name`, `OwnProps`\> - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### defaults - -> `static` **defaults**: `Record`\<`string`, `unknown`\> - -#### Defined in - -[src/filters/BaseFilter.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L50) - -*** - -### type - -> `static` **type**: `string` = `'BaseFilter'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Defined in - -[src/filters/BaseFilter.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L41) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] = `[]` - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Defined in - -[src/filters/BaseFilter.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L48) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`_options`): `void` - -#### Parameters - -• **\_options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L274) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`_gl`, `_uniformLocations`): `void` - -Send uniform data from this filter to its shader program on the GPU. - -Intended to be overridden by subclasses. - -#### Parameters - -• **\_gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **\_uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of shader uniform names to their locations. - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:358](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L358) - -*** - -### toJSON() - -> **toJSON**(): `object` & `OwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `OwnProps` - -JSON - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `OwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `OwnProps` - -Object representation of an instance - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/BlendColor.md b/src/content/docs/api/namespaces/filters/classes/BlendColor.md deleted file mode 100644 index 55bb321c1..000000000 --- a/src/content/docs/api/namespaces/filters/classes/BlendColor.md +++ /dev/null @@ -1,716 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "BlendColor" ---- - -Color Blend filter class - -## Example - -```ts -const filter = new BlendColor({ - color: '#000', - mode: 'multiply' -}); - -const filter = new BlendImage({ - image: fabricImageObject, - mode: 'multiply' -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"BlendColor"`, `BlendColorOwnProps`\> - -## Constructors - -### new BlendColor() - -> **new BlendColor**(`options`?): [`BlendColor`](/api/namespaces/filters/classes/blendcolor/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`BlendColorOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`BlendColor`](/api/namespaces/filters/classes/blendcolor/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### alpha - -> **alpha**: `number` - -alpha value. represent the strength of the blend color operation. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/BlendColor.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L68) - -*** - -### color - -> **color**: `string` - -Color to make the blend operation with. default to a reddish color since black or white -gives always strong result. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/BlendColor.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L54) - -*** - -### mode - -> **mode**: [`TBlendMode`](/api/namespaces/filters/type-aliases/tblendmode/) - -Blend mode for the filter: one of multiply, add, difference, screen, subtract, -darken, lighten, overlay, exclusion, tint. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/BlendColor.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L62) - -*** - -### defaults - -> `static` **defaults**: `BlendColorOwnProps` = `blendColorDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/BlendColor.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L70) - -*** - -### type - -> `static` **type**: `string` = `'BlendColor'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/BlendColor.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L72) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/BlendColor.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L74) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Blend operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/BlendColor.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L102) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BlendColor.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L76) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/BlendColor.ts:183](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L183) - -*** - -### toJSON() - -> **toJSON**(): `object` & `BlendColorOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `BlendColorOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `BlendColorOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `BlendColorOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/BlendImage.md b/src/content/docs/api/namespaces/filters/classes/BlendImage.md deleted file mode 100644 index 6cbdeb21a..000000000 --- a/src/content/docs/api/namespaces/filters/classes/BlendImage.md +++ /dev/null @@ -1,771 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "BlendImage" ---- - -Image Blend filter class - -## Example - -```ts -const filter = new filters.BlendColor({ - color: '#000', - mode: 'multiply' -}); - -const filter = new BlendImage({ - image: fabricImageObject, - mode: 'multiply' -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`\> - -## Constructors - -### new BlendImage() - -> **new BlendImage**(`options`?): [`BlendImage`](/api/namespaces/filters/classes/blendimage/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`BlendImageOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`BlendImage`](/api/namespaces/filters/classes/blendimage/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### alpha - -> **alpha**: `number` - -alpha value. represent the strength of the blend image operation. -not implemented. - -#### Defined in - -[src/filters/BlendImage.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L62) - -*** - -### image - -> **image**: [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -Image to make the blend operation with. - -#### Defined in - -[src/filters/BlendImage.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L45) - -*** - -### mode - -> **mode**: `TBlendImageMode` - -Blend mode for the filter: either 'multiply' or 'mask'. 'multiply' will -multiply the values of each channel (R, G, B, and A) of the filter image by -their corresponding values in the base image. 'mask' will only look at the -alpha channel of the filter image, and apply those values to the base -image's alpha channel. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/BlendImage.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L56) - -*** - -### defaults - -> `static` **defaults**: `BlendImageOwnProps` = `blendImageDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/BlendImage.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L66) - -*** - -### type - -> `static` **type**: `string` = `'BlendImage'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/BlendImage.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L64) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/BlendImage.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L68) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Blend operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/BlendImage.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L122) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BlendImage.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L82) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### calculateMatrix() - -> **calculateMatrix**(): `number`[] - -Calculate a transformMatrix to adapt the image to blend over - -#### Returns - -`number`[] - -#### Defined in - -[src/filters/BlendImage.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L100) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### createTexture() - -> **createTexture**(`backend`, `image`): `null` \| `WebGLTexture` - -#### Parameters - -• **backend**: [`WebGLFilterBackend`](/api/classes/webglfilterbackend/) - -• **image**: [`FabricImage`](/api/classes/fabricimage/)\<`Partial`\<[`ImageProps`](/api/interfaces/imageprops/)\>, [`SerializedImageProps`](/api/interfaces/serializedimageprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -#### Returns - -`null` \| `WebGLTexture` - -#### Defined in - -[src/filters/BlendImage.ts:90](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L90) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BlendImage.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L70) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/BlendImage.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L74) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BlendImage.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L78) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/BlendImage.ts:179](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L179) - -*** - -### toJSON() - -> **toJSON**(): `object` & `BlendImageOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `BlendImageOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `BlendImageOwnProps` - -Returns object representation of an instance -TODO: Handle the possibility of missing image better. -As of now a BlendImage filter without image can't be used with fromObject - -#### Returns - -`object` & `BlendImageOwnProps` - -Object representation of an instance - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BlendImage.ts:194](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L194) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`object`, `options`?): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`\>\> - -Create filter instance from an object representation - -#### Parameters - -• **object**: `Record`\<`string`, `any`\> - -Object to create an instance from - -• **options?** - -• **options.signal?**: `AbortSignal` - -handle aborting image loading, see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"BlendImage"`, `BlendImageOwnProps`\>\> - -#### Static - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BlendImage.ts:212](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendImage.ts#L212) diff --git a/src/content/docs/api/namespaces/filters/classes/Blur.md b/src/content/docs/api/namespaces/filters/classes/Blur.md deleted file mode 100644 index e0893c869..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Blur.md +++ /dev/null @@ -1,742 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Blur" ---- - -Blur filter class - -## Example - -```ts -const filter = new Blur({ - blur: 0.5 -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Blur"`, `BlurOwnProps`\> - -## Constructors - -### new Blur() - -> **new Blur**(`options`?): [`Blur`](/api/namespaces/filters/classes/blur/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`BlurOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Blur`](/api/namespaces/filters/classes/blur/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### aspectRatio - -> **aspectRatio**: `number` - -#### Defined in - -[src/filters/Blur.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L41) - -*** - -### blur - -> **blur**: `number` - -blur value, in percentage of image dimensions. -specific to keep the image blur constant at different resolutions -range between 0 and 1. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Blur.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L38) - -*** - -### horizontal - -> **horizontal**: `boolean` - -#### Defined in - -[src/filters/Blur.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L40) - -*** - -### defaults - -> `static` **defaults**: `BlurOwnProps` = `blurDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Blur.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L45) - -*** - -### type - -> `static` **type**: `string` = `'Blur'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Blur.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L43) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Blur.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L47) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/Blur.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L53) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Blur.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L71) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### chooseRightDelta() - -> **chooseRightDelta**(): `number`[] - -choose right value of image percentage to blur with - -#### Returns - -`number`[] - -a numeric array with delta values - -#### Defined in - -[src/filters/Blur.ts:150](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L150) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Blur.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L49) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Blur.ts:142](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L142) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Blur.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L134) - -*** - -### simpleBlur() - -> **simpleBlur**(`__namedParameters`): `ImageData` - -#### Parameters - -• **\_\_namedParameters**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`ImageData` - -#### Defined in - -[src/filters/Blur.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Blur.ts#L75) - -*** - -### toJSON() - -> **toJSON**(): `object` & `BlurOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `BlurOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `BlurOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `BlurOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Brightness.md b/src/content/docs/api/namespaces/filters/classes/Brightness.md deleted file mode 100644 index 9f74355b6..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Brightness.md +++ /dev/null @@ -1,689 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Brightness" ---- - -Brightness filter class - -## Example - -```ts -const filter = new Brightness({ - brightness: 0.05 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Brightness"`, `BrightnessOwnProps`\> - -## Constructors - -### new Brightness() - -> **new Brightness**(`options`?): [`Brightness`](/api/namespaces/filters/classes/brightness/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`BrightnessOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Brightness`](/api/namespaces/filters/classes/brightness/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### brightness - -> **brightness**: `number` - -Brightness value, from -1 to 1. -translated to -255 to 255 for 2d -0.0039215686 is the part of 1 that get translated to 1 in 2d - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Brightness.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L31) - -*** - -### defaults - -> `static` **defaults**: `BrightnessOwnProps` = `brightnessDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Brightness.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L35) - -*** - -### type - -> `static` **type**: `string` = `'Brightness'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Brightness.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L33) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Brightness.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L37) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Brightness.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L49) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Brightness.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L39) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Brightness.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L58) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Brightness.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Brightness.ts#L68) - -*** - -### toJSON() - -> **toJSON**(): `object` & `BrightnessOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `BrightnessOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `BrightnessOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `BrightnessOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/ColorMatrix.md b/src/content/docs/api/namespaces/filters/classes/ColorMatrix.md deleted file mode 100644 index f4ea9c655..000000000 --- a/src/content/docs/api/namespaces/filters/classes/ColorMatrix.md +++ /dev/null @@ -1,735 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "ColorMatrix" ---- - -Color Matrix filter class - -## See - - - [demo](http://fabricjs.com/image-filters|ImageFilters) - - {@Link http://phoboslab.org/log/2013/11/fast-image-filters-with-webgl demo} - -## Example - -```ts -const filter = new ColorMatrix({ - matrix: [ - 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, - -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, - -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, - 0, 0, 0, 1, 0 - ] -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`Name`, `OwnProps`\> - -## Extended by - -- [`HueRotation`](/api/namespaces/filters/classes/huerotation/) - -## Type Parameters - -• **Name** *extends* `string` = `"ColorMatrix"` - -• **OwnProps** *extends* `object` = `ColorMatrixOwnProps` - -## Constructors - -### new ColorMatrix() - -> **new ColorMatrix**\<`Name`, `OwnProps`\>(`options`?): [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/)\<`Name`, `OwnProps`\> - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`OwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/)\<`Name`, `OwnProps`\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### colorsOnly - -> **colorsOnly**: `boolean` - -Lock the colormatrix on the color part, skipping alpha, mainly for non webgl scenario -to save some calculation - -#### Default - -```ts -true -``` - -#### Defined in - -[src/filters/ColorMatrix.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L56) - -*** - -### matrix - -> **matrix**: [`TMatColorMatrix`](/api/type-aliases/tmatcolormatrix/) - -Colormatrix for pixels. -array of 20 floats. Numbers in positions 4, 9, 14, 19 loose meaning -outside the -1, 1 range. -0.0039215686 is the part of 1 that get translated to 1 in 2d - -#### Param - -array of 20 numbers. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/ColorMatrix.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L48) - -*** - -### defaults - -> `static` **defaults**: `ColorMatrixOwnProps` = `colorMatrixDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/ColorMatrix.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L60) - -*** - -### type - -> `static` **type**: `string` = `'ColorMatrix'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/ColorMatrix.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L58) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/ColorMatrix.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L62) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the ColorMatrix operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/ColorMatrix.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L74) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/ColorMatrix.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L64) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/ColorMatrix.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L106) - -*** - -### toJSON() - -> **toJSON**(): `object` & `OwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `OwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `OwnProps` & `object` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `OwnProps` & `object` - -Object representation of an instance - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/ColorMatrix.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L134) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Composed.md b/src/content/docs/api/namespaces/filters/classes/Composed.md deleted file mode 100644 index eea5fa3ad..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Composed.md +++ /dev/null @@ -1,661 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Composed" ---- - -A container class that knows how to apply a sequence of filters to an input image. - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Composed"`, `ComposedOwnProps`\> - -## Constructors - -### new Composed() - -> **new Composed**(`options`): [`Composed`](/api/namespaces/filters/classes/composed/) - -#### Parameters - -• **options**: `object` & `Record`\<`string`, `any`\> = `{}` - -#### Returns - -[`Composed`](/api/namespaces/filters/classes/composed/) - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/Composed.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L21) - -## Properties - -### subFilters - -> **subFilters**: [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>[] - -A non sparse array of filters to apply - -#### Defined in - -[src/filters/Composed.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L17) - -*** - -### defaults - -> `static` **defaults**: `Record`\<`string`, `unknown`\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/BaseFilter.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L50) - -*** - -### type - -> `static` **type**: `string` = `'Composed'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Composed.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L19) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] = `[]` - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L48) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this container's filters to the input image provided. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/Composed.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L37) - -*** - -### applyTo2d() - -> **applyTo2d**(`_options`): `void` - -#### Parameters - -• **\_options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/BaseFilter.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L274) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Composed.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L61) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`_gl`, `_uniformLocations`): `void` - -Send uniform data from this filter to its shader program on the GPU. - -Intended to be overridden by subclasses. - -#### Parameters - -• **\_gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **\_uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of shader uniform names to their locations. - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/BaseFilter.ts:358](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L358) - -*** - -### toJSON() - -> **toJSON**(): `object` & `ComposedOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `ComposedOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` - -Serialize this filter into JSON. - -#### Returns - -`object` - -A JSON representation of this filter. - -##### subFilters - -> **subFilters**: `object` & `object`[] - -##### type - -> **type**: `"Composed"` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/Composed.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L51) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`object`, `options`?): `Promise`\<[`Composed`](/api/namespaces/filters/classes/composed/)\> - -Deserialize a JSON definition of a ComposedFilter into a concrete instance. - -#### Parameters - -• **object**: `Record`\<`string`, `any`\> - -Object to create an instance from - -• **options?** - -• **options.signal?**: `AbortSignal` - -handle aborting `BlendImage` filter loading, see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal - -#### Returns - -`Promise`\<[`Composed`](/api/namespaces/filters/classes/composed/)\> - -#### Static - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/Composed.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Composed.ts#L73) diff --git a/src/content/docs/api/namespaces/filters/classes/Contrast.md b/src/content/docs/api/namespaces/filters/classes/Contrast.md deleted file mode 100644 index 3999539c7..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Contrast.md +++ /dev/null @@ -1,687 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Contrast" ---- - -Contrast filter class - -## Example - -```ts -const filter = new Contrast({ - contrast: 0.25 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Contrast"`, `ContrastOwnProps`\> - -## Constructors - -### new Contrast() - -> **new Contrast**(`options`?): [`Contrast`](/api/namespaces/filters/classes/contrast/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`ContrastOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Contrast`](/api/namespaces/filters/classes/contrast/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### contrast - -> **contrast**: `number` - -contrast value, range from -1 to 1. - -#### Param - -#### Default - -```ts -0 -``` - -#### Defined in - -[src/filters/Contrast.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L29) - -*** - -### defaults - -> `static` **defaults**: `ContrastOwnProps` = `contrastDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Contrast.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L33) - -*** - -### type - -> `static` **type**: `string` = `'Contrast'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Contrast.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L31) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Contrast.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L35) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Contrast operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Contrast.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L51) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Contrast.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L37) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Contrast.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L41) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Contrast.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Contrast.ts#L68) - -*** - -### toJSON() - -> **toJSON**(): `object` & `ContrastOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `ContrastOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `ContrastOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `ContrastOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Convolute.md b/src/content/docs/api/namespaces/filters/classes/Convolute.md deleted file mode 100644 index bbab39a2a..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Convolute.md +++ /dev/null @@ -1,738 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Convolute" ---- - -Adapted from html5rocks article - -## Examples - -```ts -const filter = new Convolute({ - matrix: [ 0, -1, 0, - -1, 5, -1, - 0, -1, 0 ] -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -```ts -const filter = new Convolute({ - matrix: [ 1/9, 1/9, 1/9, - 1/9, 1/9, 1/9, - 1/9, 1/9, 1/9 ] -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -```ts -const filter = new Convolute({ - matrix: [ 1, 1, 1, - 1, 0.7, -1, - -1, -1, -1 ] -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -```ts -const filter = new Convolute({ - opaque: true, - matrix: [ 1, 1, 1, - 1, 0.7, -1, - -1, -1, -1 ] -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Convolute"`, `ConvoluteOwnProps`\> - -## Constructors - -### new Convolute() - -> **new Convolute**(`options`?): [`Convolute`](/api/namespaces/filters/classes/convolute/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`ConvoluteOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Convolute`](/api/namespaces/filters/classes/convolute/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### matrix - -> **matrix**: `number`[] - -#### Defined in - -[src/filters/Convolute.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L65) - -*** - -### opaque - -> **opaque**: `boolean` - -#### Defined in - -[src/filters/Convolute.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L60) - -*** - -### defaults - -> `static` **defaults**: `ConvoluteOwnProps` = `convoluteDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Convolute.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L69) - -*** - -### type - -> `static` **type**: `string` = `'Convolute'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Convolute.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L67) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Convolute.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L71) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Convolute.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L89) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `"Convolute_3_1"` \| `"Convolute_3_0"` \| `"Convolute_5_1"` \| `"Convolute_5_0"` \| `"Convolute_7_1"` \| `"Convolute_7_0"` \| `"Convolute_9_1"` \| `"Convolute_9_0"` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`"Convolute_3_1"` \| `"Convolute_3_0"` \| `"Convolute_5_1"` \| `"Convolute_5_0"` \| `"Convolute_7_1"` \| `"Convolute_7_0"` \| `"Convolute_9_1"` \| `"Convolute_9_0"` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/Convolute.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L73) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Convolute.ts:79](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L79) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Convolute.ts:154](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L154) - -*** - -### toJSON() - -> **toJSON**(): `object` & `ConvoluteOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `ConvoluteOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` - -Returns object representation of an instance - -#### Returns - -`object` - -Object representation of an instance - -##### matrix - -> **matrix**: `number`[] - -##### opaque - -> **opaque**: `boolean` - -##### type - -> **type**: `"Convolute"` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/Convolute.ts:165](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Convolute.ts#L165) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Gamma.md b/src/content/docs/api/namespaces/filters/classes/Gamma.md deleted file mode 100644 index 43005842f..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Gamma.md +++ /dev/null @@ -1,715 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Gamma" ---- - -Gamma filter class - -## Example - -```ts -const filter = new Gamma({ - gamma: [1, 0.5, 2.1] -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<*typeof* `GAMMA`, `GammaOwnProps`\> - -## Constructors - -### new Gamma() - -> **new Gamma**(`options`): [`Gamma`](/api/namespaces/filters/classes/gamma/) - -#### Parameters - -• **options** = `{}` - -• **options.gamma?**: `GammaInput` - -#### Returns - -[`Gamma`](/api/namespaces/filters/classes/gamma/) - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/Gamma.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L50) - -## Properties - -### gamma - -> **gamma**: `GammaInput` - -Gamma array value, from 0.01 to 2.2. - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Gamma.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L33) - -*** - -### rgbValues? - -> `optional` **rgbValues**: `object` - -#### b - -> **b**: `Uint8Array` - -#### g - -> **g**: `Uint8Array` - -#### r - -> **r**: `Uint8Array` - -#### Defined in - -[src/filters/Gamma.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L34) - -*** - -### defaults - -> `static` **defaults**: `GammaOwnProps` = `gammaDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Gamma.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L42) - -*** - -### type - -> `static` **type**: `"Gamma"` = `GAMMA` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Gamma.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L40) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Gamma.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L44) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Gamma operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Gamma.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L65) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Gamma.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L46) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Gamma.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L107) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Gamma.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L100) - -*** - -### toJSON() - -> **toJSON**(): `object` & `GammaOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `GammaOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` - -Object representation of an instance - -##### gamma - -> **gamma**: `GammaInput` - -##### type - -> **type**: `"Gamma"` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/Gamma.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Gamma.ts#L112) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Grayscale.md b/src/content/docs/api/namespaces/filters/classes/Grayscale.md deleted file mode 100644 index b8ee5c97e..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Grayscale.md +++ /dev/null @@ -1,674 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Grayscale" ---- - -Grayscale image filter class - -## Example - -```ts -const filter = new Grayscale(); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Grayscale"`, `GrayscaleOwnProps`\> - -## Constructors - -### new Grayscale() - -> **new Grayscale**(`options`?): [`Grayscale`](/api/namespaces/filters/classes/grayscale/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`GrayscaleOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Grayscale`](/api/namespaces/filters/classes/grayscale/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### mode - -> **mode**: `TGrayscaleMode` - -#### Defined in - -[src/filters/Grayscale.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L24) - -*** - -### defaults - -> `static` **defaults**: `GrayscaleOwnProps` = `grayscaleDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Grayscale.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L28) - -*** - -### type - -> `static` **type**: `string` = `'Grayscale'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Grayscale.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L26) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Grayscale.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L30) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Grayscale operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Grayscale.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L38) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/Grayscale.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L61) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Grayscale.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L65) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Grayscale filter isNeutralState implementation -The filter is never neutral -on the image - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Grayscale.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L88) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Grayscale.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Grayscale.ts#L75) - -*** - -### toJSON() - -> **toJSON**(): `object` & `GrayscaleOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `GrayscaleOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `GrayscaleOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `GrayscaleOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/HueRotation.md b/src/content/docs/api/namespaces/filters/classes/HueRotation.md deleted file mode 100644 index 6725283a6..000000000 --- a/src/content/docs/api/namespaces/filters/classes/HueRotation.md +++ /dev/null @@ -1,753 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "HueRotation" ---- - -HueRotation filter class - -## Example - -```ts -const filter = new HueRotation({ - rotation: -0.5 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/)\<`"HueRotation"`, `HueRotationOwnProps`\> - -## Constructors - -### new HueRotation() - -> **new HueRotation**(`options`?): [`HueRotation`](/api/namespaces/filters/classes/huerotation/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`HueRotationOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`HueRotation`](/api/namespaces/filters/classes/huerotation/) - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`constructor`](/api/namespaces/filters/classes/colormatrix/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### colorsOnly - -> **colorsOnly**: `boolean` - -Lock the colormatrix on the color part, skipping alpha, mainly for non webgl scenario -to save some calculation - -#### Default - -```ts -true -``` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`colorsOnly`](/api/namespaces/filters/classes/colormatrix/#colorsonly) - -#### Defined in - -[src/filters/ColorMatrix.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L56) - -*** - -### matrix - -> **matrix**: [`TMatColorMatrix`](/api/type-aliases/tmatcolormatrix/) - -Colormatrix for pixels. -array of 20 floats. Numbers in positions 4, 9, 14, 19 loose meaning -outside the -1, 1 range. -0.0039215686 is the part of 1 that get translated to 1 in 2d - -#### Param - -array of 20 numbers. - -#### Default - -```ts - -``` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`matrix`](/api/namespaces/filters/classes/colormatrix/#matrix) - -#### Defined in - -[src/filters/ColorMatrix.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L48) - -*** - -### rotation - -> **rotation**: `number` - -HueRotation value, from -1 to 1. - -#### Defined in - -[src/filters/HueRotation.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L31) - -*** - -### defaults - -> `static` **defaults**: `HueRotationOwnProps` = `hueRotationDefaultValues` - -#### Overrides - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`defaults`](/api/namespaces/filters/classes/colormatrix/#defaults) - -#### Defined in - -[src/filters/HueRotation.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L35) - -*** - -### type - -> `static` **type**: `string` = `'HueRotation'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`type`](/api/namespaces/filters/classes/colormatrix/#type) - -#### Defined in - -[src/filters/HueRotation.ts:33](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L33) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`uniformLocations`](/api/namespaces/filters/classes/colormatrix/#uniformlocations) - -#### Defined in - -[src/filters/ColorMatrix.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L62) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`type`](/api/namespaces/filters/classes/colormatrix/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/colormatrix/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`_swapTextures`](/api/namespaces/filters/classes/colormatrix/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`applyTo`](/api/namespaces/filters/classes/colormatrix/#applyto) - -#### Defined in - -[src/filters/HueRotation.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L60) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the ColorMatrix operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`applyTo2d`](/api/namespaces/filters/classes/colormatrix/#applyto2d) - -#### Defined in - -[src/filters/ColorMatrix.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L74) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`applyToWebGL`](/api/namespaces/filters/classes/colormatrix/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/colormatrix/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### calculateMatrix() - -> **calculateMatrix**(): `void` - -#### Returns - -`void` - -#### Defined in - -[src/filters/HueRotation.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L37) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`createHelpLayer`](/api/namespaces/filters/classes/colormatrix/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`createProgram`](/api/namespaces/filters/classes/colormatrix/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`getAttributeLocations`](/api/namespaces/filters/classes/colormatrix/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`getCacheKey`](/api/namespaces/filters/classes/colormatrix/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`getFragmentSource`](/api/namespaces/filters/classes/colormatrix/#getfragmentsource) - -#### Defined in - -[src/filters/ColorMatrix.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L64) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`getUniformLocations`](/api/namespaces/filters/classes/colormatrix/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`getVertexSource`](/api/namespaces/filters/classes/colormatrix/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`isNeutralState`](/api/namespaces/filters/classes/colormatrix/#isneutralstate) - -#### Defined in - -[src/filters/HueRotation.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L56) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`retrieveShader`](/api/namespaces/filters/classes/colormatrix/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`sendAttributeData`](/api/namespaces/filters/classes/colormatrix/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`sendUniformData`](/api/namespaces/filters/classes/colormatrix/#senduniformdata) - -#### Defined in - -[src/filters/ColorMatrix.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrix.ts#L106) - -*** - -### toJSON() - -> **toJSON**(): `object` & `HueRotationOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `HueRotationOwnProps` - -JSON - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`toJSON`](/api/namespaces/filters/classes/colormatrix/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` - -Object representation of an instance - -##### rotation - -> **rotation**: `number` - -##### type - -> **type**: `"HueRotation"` - -#### Overrides - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`toObject`](/api/namespaces/filters/classes/colormatrix/#toobject) - -#### Defined in - -[src/filters/HueRotation.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/HueRotation.ts#L66) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/colormatrix/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/).[`fromObject`](/api/namespaces/filters/classes/colormatrix/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Invert.md b/src/content/docs/api/namespaces/filters/classes/Invert.md deleted file mode 100644 index 0a502f356..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Invert.md +++ /dev/null @@ -1,684 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Invert" ---- - -## Example - -```ts -const filter = new Invert(); -object.filters.push(filter); -object.applyFilters(canvas.renderAll.bind(canvas)); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Invert"`, `InvertOwnProps`\> - -## Constructors - -### new Invert() - -> **new Invert**(`options`?): [`Invert`](/api/namespaces/filters/classes/invert/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`InvertOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Invert`](/api/namespaces/filters/classes/invert/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### alpha - -> **alpha**: `boolean` - -Invert also alpha. - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Invert.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L28) - -*** - -### invert - -> **invert**: `boolean` - -Filter invert. if false, does nothing - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Invert.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L35) - -*** - -### defaults - -> `static` **defaults**: `InvertOwnProps` = `invertDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Invert.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L39) - -*** - -### type - -> `static` **type**: `string` = `'Invert'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Invert.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L37) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Invert.ts:41](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L41) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Invert operation to a Uint8Array representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Invert.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L49) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Invert filter isNeutralState implementation -Used only in image applyFilters to discard filters that will not have an effect -on the image - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Invert.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L71) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Invert.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Invert.ts#L81) - -*** - -### toJSON() - -> **toJSON**(): `object` & `InvertOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `InvertOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `InvertOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `InvertOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Noise.md b/src/content/docs/api/namespaces/filters/classes/Noise.md deleted file mode 100644 index 34e7cc0a5..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Noise.md +++ /dev/null @@ -1,688 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Noise" ---- - -Noise filter class - -## Example - -```ts -const filter = new Noise({ - noise: 700 -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Noise"`, `NoiseOwnProps`\> - -## Constructors - -### new Noise() - -> **new Noise**(`options`?): [`Noise`](/api/namespaces/filters/classes/noise/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`NoiseOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Noise`](/api/namespaces/filters/classes/noise/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### noise - -> **noise**: `number` - -Noise value, from - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Noise.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L30) - -*** - -### defaults - -> `static` **defaults**: `NoiseOwnProps` = `noiseDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Noise.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L34) - -*** - -### type - -> `static` **type**: `string` = `'Noise'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Noise.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L32) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Noise.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L36) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Brightness operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Noise.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L48) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Noise.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L38) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Noise.ts:72](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L72) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Noise.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Noise.ts#L64) - -*** - -### toJSON() - -> **toJSON**(): `object` & `NoiseOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `NoiseOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `NoiseOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `NoiseOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Pixelate.md b/src/content/docs/api/namespaces/filters/classes/Pixelate.md deleted file mode 100644 index ca6b18f89..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Pixelate.md +++ /dev/null @@ -1,656 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Pixelate" ---- - -Pixelate filter class - -## Example - -```ts -const filter = new Pixelate({ - blocksize: 8 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Pixelate"`, `PixelateOwnProps`\> - -## Constructors - -### new Pixelate() - -> **new Pixelate**(`options`?): [`Pixelate`](/api/namespaces/filters/classes/pixelate/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`PixelateOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Pixelate`](/api/namespaces/filters/classes/pixelate/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### blocksize - -> **blocksize**: `number` - -#### Defined in - -[src/filters/Pixelate.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L24) - -*** - -### defaults - -> `static` **defaults**: `PixelateOwnProps` = `pixelateDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Pixelate.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L28) - -*** - -### type - -> `static` **type**: `string` = `'Pixelate'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Pixelate.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L26) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Pixelate.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L30) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Pixelate operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Pixelate.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L38) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Indicate when the filter is not gonna apply changes to the image - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Pixelate.ts:63](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L63) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Pixelate.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Pixelate.ts#L77) - -*** - -### toJSON() - -> **toJSON**(): `object` & `PixelateOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `PixelateOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `PixelateOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `PixelateOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/RemoveColor.md b/src/content/docs/api/namespaces/filters/classes/RemoveColor.md deleted file mode 100644 index f898b7d37..000000000 --- a/src/content/docs/api/namespaces/filters/classes/RemoveColor.md +++ /dev/null @@ -1,720 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "RemoveColor" ---- - -Remove white filter class - -## Example - -```ts -const filter = new RemoveColor({ - threshold: 0.2, -}); -object.filters.push(filter); -object.applyFilters(); -canvas.renderAll(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"RemoveColor"`, `RemoveColorOwnProps`\> - -## Constructors - -### new RemoveColor() - -> **new RemoveColor**(`options`?): [`RemoveColor`](/api/namespaces/filters/classes/removecolor/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`RemoveColorOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`RemoveColor`](/api/namespaces/filters/classes/removecolor/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### color - -> **color**: `string` - -Color to remove, in any format understood by [Color](../../../../../../api/classes/color). - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/RemoveColor.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L38) - -*** - -### distance - -> **distance**: `number` - -distance to actual color, as value up or down from each r,g,b -between 0 and 1 - -#### Defined in - -[src/filters/RemoveColor.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L44) - -*** - -### useAlpha - -> **useAlpha**: `boolean` - -For color to remove inside distance, use alpha channel for a smoother deletion -NOT IMPLEMENTED YET - -#### Defined in - -[src/filters/RemoveColor.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L50) - -*** - -### defaults - -> `static` **defaults**: `RemoveColorOwnProps` = `removeColorDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/RemoveColor.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L54) - -*** - -### type - -> `static` **type**: `string` = `'RemoveColor'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/RemoveColor.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L52) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/RemoveColor.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L56) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`canvasEl`): `void` - -Applies filter to canvas element - -#### Parameters - -• **canvasEl**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -Canvas element to apply filter to - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/RemoveColor.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L66) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/RemoveColor.ts:58](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L58) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(`options`?): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Parameters - -• **options?**: `any` - -#### Returns - -`boolean` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/BaseFilter.ts:247](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L247) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/RemoveColor.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/RemoveColor.ts#L100) - -*** - -### toJSON() - -> **toJSON**(): `object` & `RemoveColorOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `RemoveColorOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `RemoveColorOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `RemoveColorOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Resize.md b/src/content/docs/api/namespaces/filters/classes/Resize.md deleted file mode 100644 index aa5ba0368..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Resize.md +++ /dev/null @@ -1,1006 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Resize" ---- - -Resize image filter class - -## Example - -```ts -const filter = new Resize(); -object.filters.push(filter); -object.applyFilters(canvas.renderAll.bind(canvas)); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Resize"`, `ResizeOwnProps`\> - -## Constructors - -### new Resize() - -> **new Resize**(`options`?): [`Resize`](/api/namespaces/filters/classes/resize/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`ResizeOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Resize`](/api/namespaces/filters/classes/resize/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### lanczosLobes - -> **lanczosLobes**: `number` - -LanczosLobes parameter for lanczos filter, valid for resizeType lanczos - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Resize.ts:80](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L80) - -*** - -### resizeType - -> **resizeType**: [`TResizeType`](/api/namespaces/filters/type-aliases/tresizetype/) - -Resize type -for webgl resizeType is just lanczos, for canvas2d can be: -bilinear, hermite, sliceHack, lanczos. - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Resize.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L59) - -*** - -### scaleX - -> **scaleX**: `number` - -Scale factor for resizing, x axis - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Resize.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L66) - -*** - -### scaleY - -> **scaleY**: `number` - -Scale factor for resizing, y axis - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Resize.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L73) - -*** - -### defaults - -> `static` **defaults**: `ResizeOwnProps` = `resizeDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Resize.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L84) - -*** - -### type - -> `static` **type**: `string` = `'Resize'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Resize.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L82) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Resize.ts:86](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L86) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply the resize filter to the image -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/Resize.ts:197](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L197) - -*** - -### applyTo2d() - -> **applyTo2d**(`this`, `options`): `void` - -#### Parameters - -• **this**: `ResizeDuring2DResize` - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Resize.ts:223](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L223) - -*** - -### applyToForWebgl() - -> **applyToForWebgl**(`this`, `options`): `void` - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Defined in - -[src/filters/Resize.ts:163](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L163) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bilinearFiltering() - -> **bilinearFiltering**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` - -bilinearFiltering - -#### Parameters - -• **this**: `ResizeDuring2DResize` - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -• **oW**: `number` - -Original Width - -• **oH**: `number` - -Original Height - -• **dW**: `number` - -Destination Width - -• **dH**: `number` - -Destination Height - -#### Returns - -`ImageData` - -#### Defined in - -[src/filters/Resize.ts:417](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L417) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### generateShader() - -> **generateShader**(`filterWindow`): `string` - -Generate vertex and shader sources from the necessary steps numbers - -#### Parameters - -• **filterWindow**: `number` - -#### Returns - -`string` - -#### Defined in - -[src/filters/Resize.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L136) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(`this`): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -#### Returns - -`string` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/Resize.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L111) - -*** - -### getFilterWindow() - -> **getFilterWindow**(`this`): `number` - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -#### Returns - -`number` - -#### Defined in - -[src/filters/Resize.ts:106](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L106) - -*** - -### getFragmentSource() - -> **getFragmentSource**(`this`): `string` - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Resize.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L116) - -*** - -### getTaps() - -> **getTaps**(`this`): `any`[] - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -#### Returns - -`any`[] - -#### Defined in - -[src/filters/Resize.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L121) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### hermiteFastResize() - -> **hermiteFastResize**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` - -hermiteFastResize - -#### Parameters - -• **this**: `ResizeDuring2DResize` - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -• **oW**: `number` - -Original Width - -• **oH**: `number` - -Original Height - -• **dW**: `number` - -Destination Width - -• **dH**: `number` - -Destination Height - -#### Returns - -`ImageData` - -#### Defined in - -[src/filters/Resize.ts:480](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L480) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Resize.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L205) - -*** - -### lanczosCreate() - -> **lanczosCreate**(`lobes`): (`x`) => `number` - -#### Parameters - -• **lobes**: `number` - -#### Returns - -`Function` - -##### Parameters - -• **x**: `number` - -##### Returns - -`number` - -#### Defined in - -[src/filters/Resize.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L209) - -*** - -### lanczosResize() - -> **lanczosResize**(`this`, `options`, `oW`, `oH`, `dW`, `dH`): `ImageData` - -Filter lanczosResize - -#### Parameters - -• **this**: `ResizeDuring2DResize` - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -• **oW**: `number` - -Original Width - -• **oH**: `number` - -Original Height - -• **dW**: `number` - -Destination Width - -• **dH**: `number` - -Destination Height - -#### Returns - -`ImageData` - -#### Defined in - -[src/filters/Resize.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L326) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`this`, `gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **this**: `ResizeDuringWEBGLResize` - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Resize.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L94) - -*** - -### sliceByTwo() - -> **sliceByTwo**(`options`, `oW`, `oH`, `dW`, `dH`): `ImageData` - -Filter sliceByTwo - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -• **oW**: `number` - -Original Width - -• **oH**: `number` - -Original Height - -• **dW**: `number` - -Destination Width - -• **dH**: `number` - -Destination Height - -#### Returns - -`ImageData` - -#### Defined in - -[src/filters/Resize.ts:261](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L261) - -*** - -### toJSON() - -> **toJSON**(): `object` & `ResizeOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `ResizeOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `ResizeOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `ResizeOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Saturation.md b/src/content/docs/api/namespaces/filters/classes/Saturation.md deleted file mode 100644 index 29feaba5f..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Saturation.md +++ /dev/null @@ -1,689 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Saturation" ---- - -Saturate filter class - -## Example - -```ts -const filter = new Saturation({ - saturation: 1 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Saturation"`, `SaturationOwnProps`\> - -## Constructors - -### new Saturation() - -> **new Saturation**(`options`?): [`Saturation`](/api/namespaces/filters/classes/saturation/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`SaturationOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Saturation`](/api/namespaces/filters/classes/saturation/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### saturation - -> **saturation**: `number` - -Saturation value, from -1 to 1. -Increases/decreases the color saturation. -A value of 0 has no effect. - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Saturation.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L32) - -*** - -### defaults - -> `static` **defaults**: `SaturationOwnProps` = `saturationDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Saturation.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L36) - -*** - -### type - -> `static` **type**: `string` = `'Saturation'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Saturation.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L34) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Saturation.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L38) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Saturation operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Saturation.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L50) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Saturation.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L40) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Saturation.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L73) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Saturation.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Saturation.ts#L66) - -*** - -### toJSON() - -> **toJSON**(): `object` & `SaturationOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `SaturationOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `SaturationOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `SaturationOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/classes/Vibrance.md b/src/content/docs/api/namespaces/filters/classes/Vibrance.md deleted file mode 100644 index 990997a8e..000000000 --- a/src/content/docs/api/namespaces/filters/classes/Vibrance.md +++ /dev/null @@ -1,689 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Vibrance" ---- - -Vibrance filter class - -## Example - -```ts -const filter = new Vibrance({ - vibrance: 1 -}); -object.filters.push(filter); -object.applyFilters(); -``` - -## Extends - -- [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`"Vibrance"`, `VibranceOwnProps`\> - -## Constructors - -### new Vibrance() - -> **new Vibrance**(`options`?): [`Vibrance`](/api/namespaces/filters/classes/vibrance/) - -Constructor - -#### Parameters - -• **options?**: `object` & `Partial`\<`VibranceOwnProps`\> & `Record`\<`string`, `any`\> = `{}` - -Options object - -#### Returns - -[`Vibrance`](/api/namespaces/filters/classes/vibrance/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`constructor`](/api/namespaces/filters/classes/basefilter/#constructors) - -#### Defined in - -[src/filters/BaseFilter.ts:56](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L56) - -## Properties - -### vibrance - -> **vibrance**: `number` - -Vibrance value, from -1 to 1. -Increases/decreases the saturation of more muted colors with less effect on saturated colors. -A value of 0 has no effect. - -#### Param - -#### Default - -```ts - -``` - -#### Defined in - -[src/filters/Vibrance.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L32) - -*** - -### defaults - -> `static` **defaults**: `VibranceOwnProps` = `vibranceDefaultValues` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`defaults`](/api/namespaces/filters/classes/basefilter/#defaults) - -#### Defined in - -[src/filters/Vibrance.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L36) - -*** - -### type - -> `static` **type**: `string` = `'Vibrance'` - -The class type. Used to identify which class this is. -This is used for serialization purposes and internally it can be used -to identify classes. As a developer you could use `instance of Class` -but to avoid importing all the code and blocking tree shaking we try -to avoid doing that. - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type) - -#### Defined in - -[src/filters/Vibrance.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L34) - -*** - -### uniformLocations - -> `static` **uniformLocations**: `string`[] - -Contains the uniform locations for the fragment shader. -uStepW and uStepH are handled by the BaseFilter, each filter class -needs to specify all the one that are needed - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`uniformLocations`](/api/namespaces/filters/classes/basefilter/#uniformlocations) - -#### Defined in - -[src/filters/Vibrance.ts:38](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L38) - -## Accessors - -### type - -> `get` **type**(): `Name` - -Filter type - -#### Default - -```ts - -``` - -#### Returns - -`Name` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`type`](/api/namespaces/filters/classes/basefilter/#type-1) - -#### Defined in - -[src/filters/BaseFilter.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L30) - -## Methods - -### \_setupFrameBuffer() - -> **\_setupFrameBuffer**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_setupFrameBuffer`](/api/namespaces/filters/classes/basefilter/#_setupframebuffer) - -#### Defined in - -[src/filters/BaseFilter.ts:204](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L204) - -*** - -### \_swapTextures() - -> **\_swapTextures**(`options`): `void` - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`_swapTextures`](/api/namespaces/filters/classes/basefilter/#_swaptextures) - -#### Defined in - -[src/filters/BaseFilter.ts:231](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L231) - -*** - -### applyTo() - -> **applyTo**(`options`): `void` - -Apply this filter to the input image data provided. - -Determines whether to use WebGL or Canvas2D based on the options.webgl flag. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) \| [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo`](/api/namespaces/filters/classes/basefilter/#applyto) - -#### Defined in - -[src/filters/BaseFilter.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L264) - -*** - -### applyTo2d() - -> **applyTo2d**(`options`): `void` - -Apply the Vibrance operation to a Uint8ClampedArray representing the pixels of an image. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyTo2d`](/api/namespaces/filters/classes/basefilter/#applyto2d) - -#### Defined in - -[src/filters/Vibrance.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L50) - -*** - -### applyToWebGL() - -> **applyToWebGL**(`options`): `void` - -Apply this filter using webgl. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`applyToWebGL`](/api/namespaces/filters/classes/basefilter/#applytowebgl) - -#### Defined in - -[src/filters/BaseFilter.ts:314](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L314) - -*** - -### bindAdditionalTexture() - -> **bindAdditionalTexture**(`gl`, `texture`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **texture**: `WebGLTexture` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`bindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#bindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:333](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L333) - -*** - -### createHelpLayer() - -> **createHelpLayer**(`options`): `void` - -If needed by a 2d filter, this functions can create an helper canvas to be used -remember that options.targetCanvas is available for use till end of chain. - -#### Parameters - -• **options**: [`T2DPipelineState`](/api/type-aliases/t2dpipelinestate/) - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createHelpLayer`](/api/namespaces/filters/classes/basefilter/#createhelplayer) - -#### Defined in - -[src/filters/BaseFilter.ts:369](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L369) - -*** - -### createProgram() - -> **createProgram**(`gl`, `fragmentSource`, `vertexSource`): `object` - -Compile this filter's shader program. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context to use for shader compilation. - -• **fragmentSource**: `string` = `...` - -fragmentShader source for compilation - -• **vertexSource**: `string` = `...` - -vertexShader source for compilation - -#### Returns - -`object` - -##### attributeLocations - -> **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -##### program - -> **program**: `WebGLProgram` - -##### uniformLocations - -> **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`createProgram`](/api/namespaces/filters/classes/basefilter/#createprogram) - -#### Defined in - -[src/filters/BaseFilter.ts:82](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L82) - -*** - -### getAttributeLocations() - -> **getAttributeLocations**(`gl`, `program`): [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -Return a map of attribute names to WebGLAttributeLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take attribute locations. - -#### Returns - -[`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) - -A map of attribute names to attribute locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getAttributeLocations`](/api/namespaces/filters/classes/basefilter/#getattributelocations) - -#### Defined in - -[src/filters/BaseFilter.ts:152](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L152) - -*** - -### getCacheKey() - -> **getCacheKey**(): `string` - -Returns a string that represent the current selected shader code for the filter. -Used to force recompilation when parameters change or to retrieve the shader from cache - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getCacheKey`](/api/namespaces/filters/classes/basefilter/#getcachekey) - -#### Defined in - -[src/filters/BaseFilter.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L283) - -*** - -### getFragmentSource() - -> **getFragmentSource**(): `string` - -#### Returns - -`string` - -#### Overrides - -`BaseFilter.getFragmentSource` - -#### Defined in - -[src/filters/Vibrance.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L40) - -*** - -### getUniformLocations() - -> **getUniformLocations**(`gl`, `program`): [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -Return a map of uniform names to WebGLUniformLocation objects. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **program**: `WebGLProgram` - -The shader program from which to take uniform locations. - -#### Returns - -[`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of uniform names to uniform locations. - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getUniformLocations`](/api/namespaces/filters/classes/basefilter/#getuniformlocations) - -#### Defined in - -[src/filters/BaseFilter.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L168) - -*** - -### getVertexSource() - -> **getVertexSource**(): `string` - -#### Returns - -`string` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`getVertexSource`](/api/namespaces/filters/classes/basefilter/#getvertexsource) - -#### Defined in - -[src/filters/BaseFilter.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L71) - -*** - -### isNeutralState() - -> **isNeutralState**(): `boolean` - -Generic isNeutral implementation for one parameter based filters. -Used only in image applyFilters to discard filters that will not have an effect -on the image -Other filters may need their own version ( ColorMatrix, HueRotation, gamma, ComposedFilter ) - -#### Returns - -`boolean` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`isNeutralState`](/api/namespaces/filters/classes/basefilter/#isneutralstate) - -#### Defined in - -[src/filters/Vibrance.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L75) - -*** - -### retrieveShader() - -> **retrieveShader**(`options`): [`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -Retrieves the cached shader. - -#### Parameters - -• **options**: [`TWebGLPipelineState`](/api/type-aliases/twebglpipelinestate/) - -#### Returns - -[`TWebGLProgramCacheItem`](/api/type-aliases/twebglprogramcacheitem/) - -the compiled program shader - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`retrieveShader`](/api/namespaces/filters/classes/basefilter/#retrieveshader) - -#### Defined in - -[src/filters/BaseFilter.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L294) - -*** - -### sendAttributeData() - -> **sendAttributeData**(`gl`, `attributeLocations`, `aPositionData`): `void` - -Send attribute data from this filter to its shader program on the GPU. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The canvas context used to compile the shader program. - -• **attributeLocations**: `Record`\<`string`, `number`\> - -A map of shader attribute names to their locations. - -• **aPositionData**: `Float32Array` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendAttributeData`](/api/namespaces/filters/classes/basefilter/#sendattributedata) - -#### Defined in - -[src/filters/BaseFilter.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L191) - -*** - -### sendUniformData() - -> **sendUniformData**(`gl`, `uniformLocations`): `void` - -Send data from this filter to its shader program's uniforms. - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -The GL canvas context used to compile this filter's shader. - -• **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) - -A map of string uniform names to WebGLUniformLocation objects - -#### Returns - -`void` - -#### Overrides - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`sendUniformData`](/api/namespaces/filters/classes/basefilter/#senduniformdata) - -#### Defined in - -[src/filters/Vibrance.ts:68](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Vibrance.ts#L68) - -*** - -### toJSON() - -> **toJSON**(): `object` & `VibranceOwnProps` - -Returns a JSON representation of an instance - -#### Returns - -`object` & `VibranceOwnProps` - -JSON - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toJSON`](/api/namespaces/filters/classes/basefilter/#tojson) - -#### Defined in - -[src/filters/BaseFilter.ts:406](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L406) - -*** - -### toObject() - -> **toObject**(): `object` & `VibranceOwnProps` - -Returns object representation of an instance -It will automatically export the default values of a filter, -stored in the static defaults property. - -#### Returns - -`object` & `VibranceOwnProps` - -Object representation of an instance - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`toObject`](/api/namespaces/filters/classes/basefilter/#toobject) - -#### Defined in - -[src/filters/BaseFilter.ts:386](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L386) - -*** - -### unbindAdditionalTexture() - -> **unbindAdditionalTexture**(`gl`, `textureUnit`): `void` - -#### Parameters - -• **gl**: `WebGLRenderingContext` - -• **textureUnit**: `number` - -#### Returns - -`void` - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`unbindAdditionalTexture`](/api/namespaces/filters/classes/basefilter/#unbindadditionaltexture) - -#### Defined in - -[src/filters/BaseFilter.ts:344](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L344) - -*** - -### fromObject() - -> `static` **fromObject**(`__namedParameters`, `_options`): `Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Parameters - -• **\_\_namedParameters**: `Record`\<`string`, `any`\> - -• **\_options**: [`Abortable`](/api/type-aliases/abortable/) - -#### Returns - -`Promise`\<[`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\>\> - -#### Inherited from - -[`BaseFilter`](/api/namespaces/filters/classes/basefilter/).[`fromObject`](/api/namespaces/filters/classes/basefilter/#fromobject) - -#### Defined in - -[src/filters/BaseFilter.ts:411](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BaseFilter.ts#L411) diff --git a/src/content/docs/api/namespaces/filters/index.md b/src/content/docs/api/namespaces/filters/index.md deleted file mode 100644 index 82945ec37..000000000 --- a/src/content/docs/api/namespaces/filters/index.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "filters" ---- - -## Index - -### Classes - -- [BaseFilter](/api/namespaces/filters/classes/basefilter/) -- [BlendColor](/api/namespaces/filters/classes/blendcolor/) -- [BlendImage](/api/namespaces/filters/classes/blendimage/) -- [Blur](/api/namespaces/filters/classes/blur/) -- [Brightness](/api/namespaces/filters/classes/brightness/) -- [ColorMatrix](/api/namespaces/filters/classes/colormatrix/) -- [Composed](/api/namespaces/filters/classes/composed/) -- [Contrast](/api/namespaces/filters/classes/contrast/) -- [Convolute](/api/namespaces/filters/classes/convolute/) -- [Gamma](/api/namespaces/filters/classes/gamma/) -- [Grayscale](/api/namespaces/filters/classes/grayscale/) -- [HueRotation](/api/namespaces/filters/classes/huerotation/) -- [Invert](/api/namespaces/filters/classes/invert/) -- [Noise](/api/namespaces/filters/classes/noise/) -- [Pixelate](/api/namespaces/filters/classes/pixelate/) -- [RemoveColor](/api/namespaces/filters/classes/removecolor/) -- [Resize](/api/namespaces/filters/classes/resize/) -- [Saturation](/api/namespaces/filters/classes/saturation/) -- [Vibrance](/api/namespaces/filters/classes/vibrance/) - -### Type Aliases - -- [TBlendMode](/api/namespaces/filters/type-aliases/tblendmode/) -- [TResizeType](/api/namespaces/filters/type-aliases/tresizetype/) - -### Variables - -- [BlackWhite](/api/namespaces/filters/variables/blackwhite/) -- [Brownie](/api/namespaces/filters/variables/brownie/) -- [Kodachrome](/api/namespaces/filters/variables/kodachrome/) -- [Polaroid](/api/namespaces/filters/variables/polaroid/) -- [Sepia](/api/namespaces/filters/variables/sepia/) -- [Technicolor](/api/namespaces/filters/variables/technicolor/) -- [Vintage](/api/namespaces/filters/variables/vintage/) diff --git a/src/content/docs/api/namespaces/filters/type-aliases/TBlendMode.md b/src/content/docs/api/namespaces/filters/type-aliases/TBlendMode.md deleted file mode 100644 index c536e1b92..000000000 --- a/src/content/docs/api/namespaces/filters/type-aliases/TBlendMode.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TBlendMode" ---- - -> **TBlendMode**: `"multiply"` \| `"add"` \| `"difference"` \| `"screen"` \| `"subtract"` \| `"darken"` \| `"lighten"` \| `"overlay"` \| `"exclusion"` \| `"tint"` - -## Defined in - -[src/filters/BlendColor.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/BlendColor.ts#L7) diff --git a/src/content/docs/api/namespaces/filters/type-aliases/TResizeType.md b/src/content/docs/api/namespaces/filters/type-aliases/TResizeType.md deleted file mode 100644 index 0fe8da7b0..000000000 --- a/src/content/docs/api/namespaces/filters/type-aliases/TResizeType.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TResizeType" ---- - -> **TResizeType**: `"bilinear"` \| `"hermite"` \| `"sliceHack"` \| `"lanczos"` - -## Defined in - -[src/filters/Resize.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/Resize.ts#L12) diff --git a/src/content/docs/api/namespaces/filters/variables/BlackWhite.md b/src/content/docs/api/namespaces/filters/variables/BlackWhite.md deleted file mode 100644 index b83b7393f..000000000 --- a/src/content/docs/api/namespaces/filters/variables/BlackWhite.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "BlackWhite" ---- - -> `const` **BlackWhite**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L75) diff --git a/src/content/docs/api/namespaces/filters/variables/Brownie.md b/src/content/docs/api/namespaces/filters/variables/Brownie.md deleted file mode 100644 index 9251f35e4..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Brownie.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Brownie" ---- - -> `const` **Brownie**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L27) diff --git a/src/content/docs/api/namespaces/filters/variables/Kodachrome.md b/src/content/docs/api/namespaces/filters/variables/Kodachrome.md deleted file mode 100644 index ccebe7b8c..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Kodachrome.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Kodachrome" ---- - -> `const` **Kodachrome**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:43](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L43) diff --git a/src/content/docs/api/namespaces/filters/variables/Polaroid.md b/src/content/docs/api/namespaces/filters/variables/Polaroid.md deleted file mode 100644 index abc215251..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Polaroid.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Polaroid" ---- - -> `const` **Polaroid**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L59) diff --git a/src/content/docs/api/namespaces/filters/variables/Sepia.md b/src/content/docs/api/namespaces/filters/variables/Sepia.md deleted file mode 100644 index 9b7d5ec0e..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Sepia.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Sepia" ---- - -> `const` **Sepia**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L67) diff --git a/src/content/docs/api/namespaces/filters/variables/Technicolor.md b/src/content/docs/api/namespaces/filters/variables/Technicolor.md deleted file mode 100644 index 640845c8a..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Technicolor.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Technicolor" ---- - -> `const` **Technicolor**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L51) diff --git a/src/content/docs/api/namespaces/filters/variables/Vintage.md b/src/content/docs/api/namespaces/filters/variables/Vintage.md deleted file mode 100644 index 82897adf2..000000000 --- a/src/content/docs/api/namespaces/filters/variables/Vintage.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "Vintage" ---- - -> `const` **Vintage**: *typeof* [`ColorMatrix`](/api/namespaces/filters/classes/colormatrix/) - -## Defined in - -[src/filters/ColorMatrixFilters.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/ColorMatrixFilters.ts#L35) diff --git a/src/content/docs/api/namespaces/util/functions/animate.md b/src/content/docs/api/namespaces/util/functions/animate.md deleted file mode 100644 index f3175cf89..000000000 --- a/src/content/docs/api/namespaces/util/functions/animate.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "animate" ---- - -## animate(options) - -> **animate**(`options`): `ArrayAnimation` - -Changes value(s) from startValue to endValue within a certain period of time, -invoking callbacks as the value(s) change. - -### Parameters - -• **options**: `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`[]\> & `object`\> - -### Returns - -`ArrayAnimation` - -### Examples - -```ts -animate({ - startValue: 1, - endValue: 0, - onChange: (v) => { - obj.set('opacity', v); - // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` - canvas.renderAll(); - } -}); -``` - -```ts -Using lists: -animate({ - startValue: [1, 2, 3], - endValue: [2, 4, 6], - onChange: ([x, y, zoom]) => { - canvas.zoomToPoint(new Point(x, y), zoom); - canvas.renderAll(); - } -}); -``` - -### Defined in - -[src/util/animation/animate.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/animate.ts#L50) - -## animate(options) - -> **animate**(`options`): `ValueAnimation` - -### Parameters - -• **options**: `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`\> & `object`\> - -### Returns - -`ValueAnimation` - -### Defined in - -[src/util/animation/animate.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/animate.ts#L51) - -## animate(options) - -> **animate**\<`T`\>(`options`): `T` *extends* [`ArrayAnimationOptions`](/api/namespaces/util/type-aliases/arrayanimationoptions/) ? `ArrayAnimation` : `ValueAnimation` - -### Type Parameters - -• **T** *extends* `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`\> & `object`\> \| `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`number`[]\> & `object`\> - -### Parameters - -• **options**: `T` - -### Returns - -`T` *extends* [`ArrayAnimationOptions`](/api/namespaces/util/type-aliases/arrayanimationoptions/) ? `ArrayAnimation` : `ValueAnimation` - -### Defined in - -[src/util/animation/animate.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/animate.ts#L52) diff --git a/src/content/docs/api/namespaces/util/functions/animateColor.md b/src/content/docs/api/namespaces/util/functions/animateColor.md deleted file mode 100644 index 61cd5dcc6..000000000 --- a/src/content/docs/api/namespaces/util/functions/animateColor.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "animateColor" ---- - -> **animateColor**(`options`): `ColorAnimation` - -## Parameters - -• **options**: `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`number`[]\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`string`\> & `object`\> - -## Returns - -`ColorAnimation` - -## Defined in - -[src/util/animation/animate.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/animate.ts#L70) diff --git a/src/content/docs/api/namespaces/util/functions/applyTransformToObject.md b/src/content/docs/api/namespaces/util/functions/applyTransformToObject.md deleted file mode 100644 index fc0685505..000000000 --- a/src/content/docs/api/namespaces/util/functions/applyTransformToObject.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "applyTransformToObject" ---- - -> **applyTransformToObject**(`object`, `transform`): `void` - -discard an object transform state and apply the one from the matrix. - -## Parameters - -• **object**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -the object you want to transform - -• **transform**: [`TMat2D`](/api/type-aliases/tmat2d/) - -the destination transform - -## Returns - -`void` - -## Defined in - -[src/util/misc/objectTransforms.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L54) diff --git a/src/content/docs/api/namespaces/util/functions/calcDimensionsMatrix.md b/src/content/docs/api/namespaces/util/functions/calcDimensionsMatrix.md deleted file mode 100644 index 3e59da479..000000000 --- a/src/content/docs/api/namespaces/util/functions/calcDimensionsMatrix.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "calcDimensionsMatrix" ---- - -> **calcDimensionsMatrix**(`options`): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **options**: [`TScaleMatrixArgs`](/api/namespaces/util/type-aliases/tscalematrixargs/) - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -transform matrix - -## Defined in - -[src/util/misc/matrix.ts:274](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L274) diff --git a/src/content/docs/api/namespaces/util/functions/calcPlaneChangeMatrix.md b/src/content/docs/api/namespaces/util/functions/calcPlaneChangeMatrix.md deleted file mode 100644 index e0586f638..000000000 --- a/src/content/docs/api/namespaces/util/functions/calcPlaneChangeMatrix.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "calcPlaneChangeMatrix" ---- - -> **calcPlaneChangeMatrix**(`from`?, `to`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **from?**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -• **to?**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -## Defined in - -[src/util/misc/planeChange.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/planeChange.ts#L15) diff --git a/src/content/docs/api/namespaces/util/functions/calcVectorRotation.md b/src/content/docs/api/namespaces/util/functions/calcVectorRotation.md deleted file mode 100644 index 8c2e10e29..000000000 --- a/src/content/docs/api/namespaces/util/functions/calcVectorRotation.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "calcVectorRotation" ---- - -> **calcVectorRotation**(`v`): [`TRadian`](/api/type-aliases/tradian/) - -## Parameters - -• **v**: [`Point`](/api/classes/point/) - -## Returns - -[`TRadian`](/api/type-aliases/tradian/) - -the angle in radians of `v` - -## Defined in - -[src/util/misc/vectors.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L47) diff --git a/src/content/docs/api/namespaces/util/functions/cancelAnimFrame.md b/src/content/docs/api/namespaces/util/functions/cancelAnimFrame.md deleted file mode 100644 index dae621d34..000000000 --- a/src/content/docs/api/namespaces/util/functions/cancelAnimFrame.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "cancelAnimFrame" ---- - -> **cancelAnimFrame**(`handle`): `void` - -## Parameters - -• **handle**: `number` - -## Returns - -`void` - -## Defined in - -[src/util/animation/AnimationFrameProvider.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/AnimationFrameProvider.ts#L7) diff --git a/src/content/docs/api/namespaces/util/functions/capValue.md b/src/content/docs/api/namespaces/util/functions/capValue.md deleted file mode 100644 index 1bbc0967b..000000000 --- a/src/content/docs/api/namespaces/util/functions/capValue.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "capValue" ---- - -> **capValue**(`min`, `value`, `max`): `number` - -## Parameters - -• **min**: `number` - -• **value**: `number` - -• **max**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/misc/capValue.ts:1](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/capValue.ts#L1) diff --git a/src/content/docs/api/namespaces/util/functions/composeMatrix.md b/src/content/docs/api/namespaces/util/functions/composeMatrix.md deleted file mode 100644 index bd79f644e..000000000 --- a/src/content/docs/api/namespaces/util/functions/composeMatrix.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "composeMatrix" ---- - -> **composeMatrix**(`options`): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **options**: [`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/) - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -transform matrix - -## Defined in - -[src/util/misc/matrix.ts:312](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L312) diff --git a/src/content/docs/api/namespaces/util/functions/copyCanvasElement.md b/src/content/docs/api/namespaces/util/functions/copyCanvasElement.md deleted file mode 100644 index f8b330f43..000000000 --- a/src/content/docs/api/namespaces/util/functions/copyCanvasElement.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "copyCanvasElement" ---- - -> **copyCanvasElement**(`canvas`): `HTMLCanvasElement` - -## Parameters - -• **canvas**: `HTMLCanvasElement` - -to copy size and content of - -## Returns - -`HTMLCanvasElement` - -initialized canvas element - -## Defined in - -[src/util/misc/dom.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/dom.ts#L28) diff --git a/src/content/docs/api/namespaces/util/functions/cos.md b/src/content/docs/api/namespaces/util/functions/cos.md deleted file mode 100644 index c0b3030bf..000000000 --- a/src/content/docs/api/namespaces/util/functions/cos.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "cos" ---- - -> **cos**(`angle`): `number` - -## Parameters - -• **angle**: [`TRadian`](/api/type-aliases/tradian/) - -the angle - -## Returns - -`number` - -the cosin value for angle. - -## Defined in - -[src/util/misc/cos.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/cos.ts#L11) diff --git a/src/content/docs/api/namespaces/util/functions/createImage.md b/src/content/docs/api/namespaces/util/functions/createImage.md deleted file mode 100644 index c06d45e79..000000000 --- a/src/content/docs/api/namespaces/util/functions/createImage.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createImage" ---- - -> **createImage**(): `HTMLImageElement` - -## Returns - -`HTMLImageElement` - -HTML image element - -## Defined in - -[src/util/misc/dom.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/dom.ts#L20) diff --git a/src/content/docs/api/namespaces/util/functions/createScaleMatrix.md b/src/content/docs/api/namespaces/util/functions/createScaleMatrix.md deleted file mode 100644 index 7c9bdc5b8..000000000 --- a/src/content/docs/api/namespaces/util/functions/createScaleMatrix.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createScaleMatrix" ---- - -> **createScaleMatrix**(`x`, `y`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **x**: `number` - -scale on X axis - -• **y?**: `number` = `x` - -scale on Y axis - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -matrix - -## Defined in - -[src/util/misc/matrix.ts:200](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L200) diff --git a/src/content/docs/api/namespaces/util/functions/createSkewXMatrix.md b/src/content/docs/api/namespaces/util/functions/createSkewXMatrix.md deleted file mode 100644 index 51711a66f..000000000 --- a/src/content/docs/api/namespaces/util/functions/createSkewXMatrix.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createSkewXMatrix" ---- - -> **createSkewXMatrix**(`skewValue`): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **skewValue**: [`TDegree`](/api/type-aliases/tdegree/) - -translation on X axis - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -matrix - -## Defined in - -[src/util/misc/matrix.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L228) diff --git a/src/content/docs/api/namespaces/util/functions/createSkewYMatrix.md b/src/content/docs/api/namespaces/util/functions/createSkewYMatrix.md deleted file mode 100644 index 0497ede15..000000000 --- a/src/content/docs/api/namespaces/util/functions/createSkewYMatrix.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createSkewYMatrix" ---- - -> **createSkewYMatrix**(`skewValue`): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **skewValue**: [`TDegree`](/api/type-aliases/tdegree/) - -translation on Y axis - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -matrix - -## Defined in - -[src/util/misc/matrix.ts:250](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L250) diff --git a/src/content/docs/api/namespaces/util/functions/createTranslateMatrix.md b/src/content/docs/api/namespaces/util/functions/createTranslateMatrix.md deleted file mode 100644 index 9dcf026d3..000000000 --- a/src/content/docs/api/namespaces/util/functions/createTranslateMatrix.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createTranslateMatrix" ---- - -> **createTranslateMatrix**(`x`, `y`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **x**: `number` - -translation on X axis - -• **y?**: `number` = `0` - -translation on Y axis - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -matrix - -## Defined in - -[src/util/misc/matrix.ts:147](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L147) diff --git a/src/content/docs/api/namespaces/util/functions/createVector.md b/src/content/docs/api/namespaces/util/functions/createVector.md deleted file mode 100644 index e34bdce21..000000000 --- a/src/content/docs/api/namespaces/util/functions/createVector.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "createVector" ---- - -> **createVector**(`from`, `to`): [`Point`](/api/classes/point/) - -## Parameters - -• **from**: [`XY`](/api/interfaces/xy/) - -• **to**: [`XY`](/api/interfaces/xy/) - -## Returns - -[`Point`](/api/classes/point/) - -vector - -## Defined in - -[src/util/misc/vectors.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L24) diff --git a/src/content/docs/api/namespaces/util/functions/crossProduct.md b/src/content/docs/api/namespaces/util/functions/crossProduct.md deleted file mode 100644 index 788cab45c..000000000 --- a/src/content/docs/api/namespaces/util/functions/crossProduct.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "crossProduct" ---- - -> **crossProduct**(`a`, `b`): `number` - -## Parameters - -• **a**: [`Point`](/api/classes/point/) - -• **b**: [`Point`](/api/classes/point/) - -## Returns - -`number` - -the magnitude of Z vector - -## Defined in - -[src/util/misc/vectors.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L74) diff --git a/src/content/docs/api/namespaces/util/functions/degreesToRadians.md b/src/content/docs/api/namespaces/util/functions/degreesToRadians.md deleted file mode 100644 index 666b0cd1c..000000000 --- a/src/content/docs/api/namespaces/util/functions/degreesToRadians.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "degreesToRadians" ---- - -> **degreesToRadians**(`degrees`): [`TRadian`](/api/type-aliases/tradian/) - -## Parameters - -• **degrees**: [`TDegree`](/api/type-aliases/tdegree/) - -value in degrees - -## Returns - -[`TRadian`](/api/type-aliases/tradian/) - -value in radians - -## Defined in - -[src/util/misc/radiansDegreesConversion.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/radiansDegreesConversion.ts#L9) diff --git a/src/content/docs/api/namespaces/util/functions/dotProduct.md b/src/content/docs/api/namespaces/util/functions/dotProduct.md deleted file mode 100644 index 63733c17e..000000000 --- a/src/content/docs/api/namespaces/util/functions/dotProduct.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "dotProduct" ---- - -> **dotProduct**(`a`, `b`): `number` - -## Parameters - -• **a**: [`Point`](/api/classes/point/) - -• **b**: [`Point`](/api/classes/point/) - -## Returns - -`number` - -## Defined in - -[src/util/misc/vectors.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L83) diff --git a/src/content/docs/api/namespaces/util/functions/enlivenObjectEnlivables.md b/src/content/docs/api/namespaces/util/functions/enlivenObjectEnlivables.md deleted file mode 100644 index d33032d1e..000000000 --- a/src/content/docs/api/namespaces/util/functions/enlivenObjectEnlivables.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "enlivenObjectEnlivables" ---- - -> **enlivenObjectEnlivables**\<`R`\>(`serializedObject`, `options`?): `Promise`\<`R`\> - -## Type Parameters - -• **R** = `Record`\<`string`, `null` \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> \| [`TFiller`](/api/type-aliases/tfiller/)\> - -## Parameters - -• **serializedObject**: `any` - -• **options?**: [`Abortable`](/api/type-aliases/abortable/) = `{}` - -## Returns - -`Promise`\<`R`\> - -the input object with enlived values - -## Defined in - -[src/util/misc/objectEnlive.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectEnlive.ts#L143) diff --git a/src/content/docs/api/namespaces/util/functions/enlivenObjects.md b/src/content/docs/api/namespaces/util/functions/enlivenObjects.md deleted file mode 100644 index 973947b98..000000000 --- a/src/content/docs/api/namespaces/util/functions/enlivenObjects.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "enlivenObjects" ---- - -> **enlivenObjects**\<`T`\>(`objects`, `options`?): `Promise`\<`T`[]\> - -## Type Parameters - -• **T** *extends* [`Shadow`](/api/classes/shadow/) \| [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> \| [`TFiller`](/api/type-aliases/tfiller/) \| [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> \| [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`, `object`\> - -## Parameters - -• **objects**: `any`[] - -Objects to enliven - -• **options?**: [`EnlivenObjectOptions`](/api/namespaces/util/type-aliases/enlivenobjectoptions/) = `{}` - -## Returns - -`Promise`\<`T`[]\> - -## Defined in - -[src/util/misc/objectEnlive.ts:92](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectEnlive.ts#L92) diff --git a/src/content/docs/api/namespaces/util/functions/findScaleToCover.md b/src/content/docs/api/namespaces/util/functions/findScaleToCover.md deleted file mode 100644 index c64bf2a8b..000000000 --- a/src/content/docs/api/namespaces/util/functions/findScaleToCover.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "findScaleToCover" ---- - -> **findScaleToCover**(`source`, `destination`): `number` - -## Parameters - -• **source**: [`TSize`](/api/type-aliases/tsize/) - -natural unscaled size of the object - -• **destination**: [`TSize`](/api/type-aliases/tsize/) - -natural unscaled size of the object - -## Returns - -`number` - -scale factor to apply to source to cover destination - -## Defined in - -[src/util/misc/findScaleTo.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/findScaleTo.ts#L25) diff --git a/src/content/docs/api/namespaces/util/functions/findScaleToFit.md b/src/content/docs/api/namespaces/util/functions/findScaleToFit.md deleted file mode 100644 index f12e1f251..000000000 --- a/src/content/docs/api/namespaces/util/functions/findScaleToFit.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "findScaleToFit" ---- - -> **findScaleToFit**(`source`, `destination`): `number` - -## Parameters - -• **source**: [`TSize`](/api/type-aliases/tsize/) - -natural unscaled size of the object - -• **destination**: [`TSize`](/api/type-aliases/tsize/) - -natural unscaled size of the object - -## Returns - -`number` - -scale factor to apply to source to fit into destination - -## Defined in - -[src/util/misc/findScaleTo.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/findScaleTo.ts#L11) diff --git a/src/content/docs/api/namespaces/util/functions/getOrthonormalVector.md b/src/content/docs/api/namespaces/util/functions/getOrthonormalVector.md deleted file mode 100644 index 35e4453e5..000000000 --- a/src/content/docs/api/namespaces/util/functions/getOrthonormalVector.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getOrthonormalVector" ---- - -> **getOrthonormalVector**(`v`, `counterClockwise`?): [`Point`](/api/classes/point/) - -## Parameters - -• **v**: [`Point`](/api/classes/point/) - -• **counterClockwise?**: `boolean` = `true` - -the direction of the orthogonal vector, defaults to `true` - -## Returns - -[`Point`](/api/classes/point/) - -the unit orthogonal vector - -## Defined in - -[src/util/misc/vectors.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L62) diff --git a/src/content/docs/api/namespaces/util/functions/getPathSegmentsInfo.md b/src/content/docs/api/namespaces/util/functions/getPathSegmentsInfo.md deleted file mode 100644 index 93bee0b1b..000000000 --- a/src/content/docs/api/namespaces/util/functions/getPathSegmentsInfo.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getPathSegmentsInfo" ---- - -> **getPathSegmentsInfo**(`path`): [`TPathSegmentInfo`](/api/namespaces/util/type-aliases/tpathsegmentinfo/)[] - -## Parameters - -• **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -parsed path commands - -## Returns - -[`TPathSegmentInfo`](/api/namespaces/util/type-aliases/tpathsegmentinfo/)[] - -path commands information - -## Defined in - -[src/util/path/index.ts:682](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L682) diff --git a/src/content/docs/api/namespaces/util/functions/getPointOnPath.md b/src/content/docs/api/namespaces/util/functions/getPointOnPath.md deleted file mode 100644 index bb2f95ce1..000000000 --- a/src/content/docs/api/namespaces/util/functions/getPointOnPath.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getPointOnPath" ---- - -> **getPointOnPath**(`path`, `distance`, `infos`): `undefined` \| [`TPointAngle`](/api/namespaces/util/type-aliases/tpointangle/) - -Get the point on the path that is distance along the path - -## Parameters - -• **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -• **distance**: `number` - -• **infos**: [`TPathSegmentInfo`](/api/namespaces/util/type-aliases/tpathsegmentinfo/)[] = `...` - -## Returns - -`undefined` \| [`TPointAngle`](/api/namespaces/util/type-aliases/tpointangle/) - -## Defined in - -[src/util/path/index.ts:790](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L790) diff --git a/src/content/docs/api/namespaces/util/functions/getPointer.md b/src/content/docs/api/namespaces/util/functions/getPointer.md deleted file mode 100644 index 8193dda91..000000000 --- a/src/content/docs/api/namespaces/util/functions/getPointer.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getPointer" ---- - -> **getPointer**(`event`): [`Point`](/api/classes/point/) - -## Parameters - -• **event**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -## Returns - -[`Point`](/api/classes/point/) - -## Defined in - -[src/util/dom\_event.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/dom_event.ts#L15) diff --git a/src/content/docs/api/namespaces/util/functions/getRandomInt.md b/src/content/docs/api/namespaces/util/functions/getRandomInt.md deleted file mode 100644 index e05bbaf74..000000000 --- a/src/content/docs/api/namespaces/util/functions/getRandomInt.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getRandomInt" ---- - -> **getRandomInt**(`min`, `max`): `number` - -## Parameters - -• **min**: `number` - -lower limit - -• **max**: `number` - -upper limit - -## Returns - -`number` - -random value (between min and max) - -## Defined in - -[src/util/internals/getRandomInt.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/internals/getRandomInt.ts#L7) diff --git a/src/content/docs/api/namespaces/util/functions/getRegularPolygonPath.md b/src/content/docs/api/namespaces/util/functions/getRegularPolygonPath.md deleted file mode 100644 index 771e23358..000000000 --- a/src/content/docs/api/namespaces/util/functions/getRegularPolygonPath.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getRegularPolygonPath" ---- - -> **getRegularPolygonPath**(`numVertexes`, `radius`): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -## Parameters - -• **numVertexes**: `number` - -• **radius**: `number` - -## Returns - -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -An array of SVG path commands - -## Defined in - -[src/util/path/index.ts:1005](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L1005) diff --git a/src/content/docs/api/namespaces/util/functions/getSmoothPathFromPoints.md b/src/content/docs/api/namespaces/util/functions/getSmoothPathFromPoints.md deleted file mode 100644 index 31f204a5d..000000000 --- a/src/content/docs/api/namespaces/util/functions/getSmoothPathFromPoints.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getSmoothPathFromPoints" ---- - -> **getSmoothPathFromPoints**(`points`, `correction`?): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -## Parameters - -• **points**: [`Point`](/api/classes/point/)[] - -Array of points - -• **correction?**: `number` = `0` - -Apply a correction to the path (usually we use `width / 1000`). If value is undefined 0 is used as the correction value. - -## Returns - -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -An array of SVG path commands - -## Defined in - -[src/util/path/index.ts:910](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L910) diff --git a/src/content/docs/api/namespaces/util/functions/getSvgAttributes.md b/src/content/docs/api/namespaces/util/functions/getSvgAttributes.md deleted file mode 100644 index d2d4245e4..000000000 --- a/src/content/docs/api/namespaces/util/functions/getSvgAttributes.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "getSvgAttributes" ---- - -> **getSvgAttributes**(`type`): `string`[] - -## Parameters - -• **type**: [`SVGElementName`](/api/type-aliases/svgelementname/) - -Type of svg element (eg. 'circle') - -## Returns - -`string`[] - -string names of supported attributes - -## Defined in - -[src/util/misc/svgParsing.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/svgParsing.ts#L17) diff --git a/src/content/docs/api/namespaces/util/functions/groupSVGElements.md b/src/content/docs/api/namespaces/util/functions/groupSVGElements.md deleted file mode 100644 index 20fdac2d3..000000000 --- a/src/content/docs/api/namespaces/util/functions/groupSVGElements.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "groupSVGElements" ---- - -> **groupSVGElements**(`elements`, `options`?): [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -## Parameters - -• **elements**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\>[] - -FabricObject(s) parsed from svg, to group - -• **options?**: `Partial`\<[`GroupProps`](/api/interfaces/groupprops/)\> - -## Returns - -[`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -## Defined in - -[src/util/misc/groupSVGElements.ts:12](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/groupSVGElements.ts#L12) diff --git a/src/content/docs/api/namespaces/util/functions/hasStyleChanged.md b/src/content/docs/api/namespaces/util/functions/hasStyleChanged.md deleted file mode 100644 index 352ae2466..000000000 --- a/src/content/docs/api/namespaces/util/functions/hasStyleChanged.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "hasStyleChanged" ---- - -> **hasStyleChanged**(`prevStyle`, `thisStyle`, `forTextSpans`): `boolean` - -## Parameters - -• **prevStyle**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\> - -first style to compare - -• **thisStyle**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\> - -second style to compare - -• **forTextSpans**: `boolean` = `false` - -whether to check overline, underline, and line-through properties - -## Returns - -`boolean` - -true if the style changed - -## Defined in - -[src/util/misc/textStyles.ts:21](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/textStyles.ts#L21) diff --git a/src/content/docs/api/namespaces/util/functions/isBetweenVectors.md b/src/content/docs/api/namespaces/util/functions/isBetweenVectors.md deleted file mode 100644 index 8fcd3bc91..000000000 --- a/src/content/docs/api/namespaces/util/functions/isBetweenVectors.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "isBetweenVectors" ---- - -> **isBetweenVectors**(`t`, `a`, `b`): `boolean` - -## Parameters - -• **t**: [`Point`](/api/classes/point/) - -vector to be tested - -• **a**: [`Point`](/api/classes/point/) - -initial vector - -• **b**: [`Point`](/api/classes/point/) - -final vector - -## Returns - -`boolean` - -true if the vector is among the others - -## Defined in - -[src/util/misc/vectors.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L94) diff --git a/src/content/docs/api/namespaces/util/functions/isIdentityMatrix.md b/src/content/docs/api/namespaces/util/functions/isIdentityMatrix.md deleted file mode 100644 index f493e6880..000000000 --- a/src/content/docs/api/namespaces/util/functions/isIdentityMatrix.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "isIdentityMatrix" ---- - -> **isIdentityMatrix**(`mat`): `boolean` - -## Parameters - -• **mat**: [`TMat2D`](/api/type-aliases/tmat2d/) - -## Returns - -`boolean` - -## Defined in - -[src/util/misc/matrix.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L35) diff --git a/src/content/docs/api/namespaces/util/functions/isTouchEvent.md b/src/content/docs/api/namespaces/util/functions/isTouchEvent.md deleted file mode 100644 index 5e0ae2bb6..000000000 --- a/src/content/docs/api/namespaces/util/functions/isTouchEvent.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "isTouchEvent" ---- - -> **isTouchEvent**(`event`): `boolean` - -## Parameters - -• **event**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) - -## Returns - -`boolean` - -## Defined in - -[src/util/dom\_event.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/dom_event.ts#L22) diff --git a/src/content/docs/api/namespaces/util/functions/joinPath.md b/src/content/docs/api/namespaces/util/functions/joinPath.md deleted file mode 100644 index 856983c89..000000000 --- a/src/content/docs/api/namespaces/util/functions/joinPath.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "joinPath" ---- - -> **joinPath**(`pathData`, `fractionDigits`?): `string` - -## Parameters - -• **pathData**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -fabricJS parsed path commands - -• **fractionDigits?**: `number` - -number of fraction digits to "leave" - -## Returns - -`string` - -joined path 'M 0 0 L 20 30' - -## Defined in - -[src/util/path/index.ts:1032](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L1032) diff --git a/src/content/docs/api/namespaces/util/functions/loadImage.md b/src/content/docs/api/namespaces/util/functions/loadImage.md deleted file mode 100644 index d97119143..000000000 --- a/src/content/docs/api/namespaces/util/functions/loadImage.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "loadImage" ---- - -> **loadImage**(`url`, `options`?): `Promise`\<`HTMLImageElement`\> - -## Parameters - -• **url**: `string` - -URL representing an image - -• **options?**: [`LoadImageOptions`](/api/namespaces/util/type-aliases/loadimageoptions/) = `{}` - -image loading options - -## Returns - -`Promise`\<`HTMLImageElement`\> - -the loaded image. - -## Defined in - -[src/util/misc/objectEnlive.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectEnlive.ts#L29) diff --git a/src/content/docs/api/namespaces/util/functions/magnitude.md b/src/content/docs/api/namespaces/util/functions/magnitude.md deleted file mode 100644 index a4bbfbe1d..000000000 --- a/src/content/docs/api/namespaces/util/functions/magnitude.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "magnitude" ---- - -> **magnitude**(`point`): `number` - -## Parameters - -• **point**: [`Point`](/api/classes/point/) - -## Returns - -`number` - -## Defined in - -[src/util/misc/vectors.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/vectors.ts#L31) diff --git a/src/content/docs/api/namespaces/util/functions/makeBoundingBoxFromPoints.md b/src/content/docs/api/namespaces/util/functions/makeBoundingBoxFromPoints.md deleted file mode 100644 index d7cbaa7ac..000000000 --- a/src/content/docs/api/namespaces/util/functions/makeBoundingBoxFromPoints.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "makeBoundingBoxFromPoints" ---- - -> **makeBoundingBoxFromPoints**(`points`): [`TBBox`](/api/type-aliases/tbbox/) - -## Parameters - -• **points**: [`XY`](/api/interfaces/xy/)[] - -## Returns - -[`TBBox`](/api/type-aliases/tbbox/) - -Object with left, top, width, height properties - -## Defined in - -[src/util/misc/boundingBoxFromPoints.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/boundingBoxFromPoints.ts#L9) diff --git a/src/content/docs/api/namespaces/util/functions/makePathSimpler.md b/src/content/docs/api/namespaces/util/functions/makePathSimpler.md deleted file mode 100644 index 5b3c0ec91..000000000 --- a/src/content/docs/api/namespaces/util/functions/makePathSimpler.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "makePathSimpler" ---- - -> **makePathSimpler**(`path`): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -## Parameters - -• **path**: [`TComplexPathData`](/api/namespaces/util/type-aliases/tcomplexpathdata/) - -the array of commands of a parsed SVG path for `Path` - -## Returns - -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -the simplified array of commands of a parsed SVG path for `Path` -TODO: figure out how to remove the type assertions in a nice way - -## Defined in - -[src/util/path/index.ts:351](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L351) diff --git a/src/content/docs/api/namespaces/util/functions/matrixToSVG.md b/src/content/docs/api/namespaces/util/functions/matrixToSVG.md deleted file mode 100644 index 2e530dd71..000000000 --- a/src/content/docs/api/namespaces/util/functions/matrixToSVG.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "matrixToSVG" ---- - -> **matrixToSVG**(`transform`): `string` - -## Parameters - -• **transform**: [`TMat2D`](/api/type-aliases/tmat2d/) - -an array with 6 numbers - -## Returns - -`string` - -transform matrix for svg - -## Defined in - -[src/util/misc/svgParsing.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/svgParsing.ts#L128) diff --git a/src/content/docs/api/namespaces/util/functions/mergeClipPaths.md b/src/content/docs/api/namespaces/util/functions/mergeClipPaths.md deleted file mode 100644 index 7ff33e0ec..000000000 --- a/src/content/docs/api/namespaces/util/functions/mergeClipPaths.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "mergeClipPaths" ---- - -> **mergeClipPaths**(`c1`, `c2`): [`Group`](/api/classes/group/) - -## Parameters - -• **c1**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -• **c2**: [`FabricObject`](/api/classes/fabricobject/)\<`Partial`\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -## Returns - -[`Group`](/api/classes/group/) - -merged clip path - -## Defined in - -[src/util/misc/mergeClipPaths.ts:23](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/mergeClipPaths.ts#L23) diff --git a/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrices.md b/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrices.md deleted file mode 100644 index 01c54028a..000000000 --- a/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrices.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "multiplyTransformMatrices" ---- - -> **multiplyTransformMatrices**(`a`, `b`, `is2x2`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **a**: [`TMat2D`](/api/type-aliases/tmat2d/) - -First transformMatrix - -• **b**: [`TMat2D`](/api/type-aliases/tmat2d/) - -Second transformMatrix - -• **is2x2?**: `boolean` - -flag to multiply matrices as 2x2 matrices - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -The product of the two transform matrices - -## Defined in - -[src/util/misc/matrix.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L73) diff --git a/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrixArray.md b/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrixArray.md deleted file mode 100644 index a900a1499..000000000 --- a/src/content/docs/api/namespaces/util/functions/multiplyTransformMatrixArray.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "multiplyTransformMatrixArray" ---- - -> **multiplyTransformMatrixArray**(`matrices`, `is2x2`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **matrices**: (`undefined` \| `null` \| `false` \| [`TMat2D`](/api/type-aliases/tmat2d/))[] - -an array of matrices - -• **is2x2?**: `boolean` - -flag to multiply matrices as 2x2 matrices - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -the multiplication product - -## Defined in - -[src/util/misc/matrix.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L96) diff --git a/src/content/docs/api/namespaces/util/functions/parsePath.md b/src/content/docs/api/namespaces/util/functions/parsePath.md deleted file mode 100644 index 862971d60..000000000 --- a/src/content/docs/api/namespaces/util/functions/parsePath.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parsePath" ---- - -> **parsePath**(`pathString`): [`TComplexPathData`](/api/namespaces/util/type-aliases/tcomplexpathdata/) - -## Parameters - -• **pathString**: `string` - -## Returns - -[`TComplexPathData`](/api/namespaces/util/type-aliases/tcomplexpathdata/) - -An array of SVG path commands - -## Defined in - -[src/util/path/index.ts:857](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L857) diff --git a/src/content/docs/api/namespaces/util/functions/parsePreserveAspectRatioAttribute.md b/src/content/docs/api/namespaces/util/functions/parsePreserveAspectRatioAttribute.md deleted file mode 100644 index 5a2923592..000000000 --- a/src/content/docs/api/namespaces/util/functions/parsePreserveAspectRatioAttribute.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parsePreserveAspectRatioAttribute" ---- - -> **parsePreserveAspectRatioAttribute**(`attribute`): `TPreserveArParsed` - -## Parameters - -• **attribute**: `string` - -to be parsed - -## Returns - -`TPreserveArParsed` - -an object containing align and meetOrSlice attribute - -## Defined in - -[src/util/misc/svgParsing.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/svgParsing.ts#L108) diff --git a/src/content/docs/api/namespaces/util/functions/parseUnit.md b/src/content/docs/api/namespaces/util/functions/parseUnit.md deleted file mode 100644 index 2cdfd5880..000000000 --- a/src/content/docs/api/namespaces/util/functions/parseUnit.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "parseUnit" ---- - -> **parseUnit**(`value`, `fontSize`): `number` - -## Parameters - -• **value**: `string` - -number to operate on - -• **fontSize**: `number` = `DEFAULT_SVG_FONT_SIZE` - -## Returns - -`number` - -## Defined in - -[src/util/misc/svgParsing.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/svgParsing.ts#L53) diff --git a/src/content/docs/api/namespaces/util/functions/pick.md b/src/content/docs/api/namespaces/util/functions/pick.md deleted file mode 100644 index ab698a1e5..000000000 --- a/src/content/docs/api/namespaces/util/functions/pick.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "pick" ---- - -> **pick**\<`T`\>(`source`, `keys`): `Partial`\<`T`\> - -## Type Parameters - -• **T** *extends* `Record`\<`string`, `any`\> - -## Parameters - -• **source**: `T` - -Source object - -• **keys**: keyof `T`[] = `[]` - -## Returns - -`Partial`\<`T`\> - -object populated with the picked keys - -## Defined in - -[src/util/misc/pick.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/pick.ts#L7) diff --git a/src/content/docs/api/namespaces/util/functions/projectStrokeOnPoints.md b/src/content/docs/api/namespaces/util/functions/projectStrokeOnPoints.md deleted file mode 100644 index fb5122ea5..000000000 --- a/src/content/docs/api/namespaces/util/functions/projectStrokeOnPoints.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "projectStrokeOnPoints" ---- - -> **projectStrokeOnPoints**(`points`, `options`, `openPath`): [`TProjection`](/api/namespaces/util/type-aliases/tprojection/)[] - -Used to calculate object's bounding box - -## Parameters - -• **points**: [`XY`](/api/interfaces/xy/)[] - -• **options**: [`TProjectStrokeOnPointsOptions`](/api/namespaces/util/type-aliases/tprojectstrokeonpointsoptions/) - -• **openPath**: `boolean` = `false` - -## Returns - -[`TProjection`](/api/namespaces/util/type-aliases/tprojection/)[] - -## See - -https://github.com/fabricjs/fabric.js/pull/8344 - -## Defined in - -[src/util/misc/projectStroke/index.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/projectStroke/index.ts#L16) diff --git a/src/content/docs/api/namespaces/util/functions/qrDecompose.md b/src/content/docs/api/namespaces/util/functions/qrDecompose.md deleted file mode 100644 index e94997093..000000000 --- a/src/content/docs/api/namespaces/util/functions/qrDecompose.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "qrDecompose" ---- - -> **qrDecompose**(`a`): `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\> - -## Parameters - -• **a**: [`TMat2D`](/api/type-aliases/tmat2d/) - -transformMatrix - -## Returns - -`Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\> - -Components of transform - -## Defined in - -[src/util/misc/matrix.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L116) diff --git a/src/content/docs/api/namespaces/util/functions/radiansToDegrees.md b/src/content/docs/api/namespaces/util/functions/radiansToDegrees.md deleted file mode 100644 index aa37ad0ec..000000000 --- a/src/content/docs/api/namespaces/util/functions/radiansToDegrees.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "radiansToDegrees" ---- - -> **radiansToDegrees**(`radians`): [`TDegree`](/api/type-aliases/tdegree/) - -## Parameters - -• **radians**: [`TRadian`](/api/type-aliases/tradian/) - -value in radians - -## Returns - -[`TDegree`](/api/type-aliases/tdegree/) - -value in degrees - -## Defined in - -[src/util/misc/radiansDegreesConversion.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/radiansDegreesConversion.ts#L17) diff --git a/src/content/docs/api/namespaces/util/functions/removeFromArray.md b/src/content/docs/api/namespaces/util/functions/removeFromArray.md deleted file mode 100644 index f0baa8b4e..000000000 --- a/src/content/docs/api/namespaces/util/functions/removeFromArray.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "removeFromArray" ---- - -> **removeFromArray**\<`T`\>(`array`, `value`): `T`[] - -## Type Parameters - -• **T** - -## Parameters - -• **array**: `T`[] - -• **value**: `T` - -## Returns - -`T`[] - -original array - -## Defined in - -[src/util/internals/removeFromArray.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/internals/removeFromArray.ts#L8) diff --git a/src/content/docs/api/namespaces/util/functions/request.md b/src/content/docs/api/namespaces/util/functions/request.md deleted file mode 100644 index 84313d9e2..000000000 --- a/src/content/docs/api/namespaces/util/functions/request.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "request" ---- - -> **request**(`url`, `options`?): `XMLHttpRequest` - -Cross-browser abstraction for sending XMLHttpRequest - -:::caution[Deprecated] -this has to go away, we can use a modern browser method to do the same. -::: - -## Parameters - -• **url**: `string` - -URL to send XMLHttpRequest to - -• **options?**: `requestOptions` = `{}` - -Options object - -## Returns - -`XMLHttpRequest` - -request - -## Defined in - -[src/util/internals/dom\_request.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/internals/dom_request.ts#L20) diff --git a/src/content/docs/api/namespaces/util/functions/requestAnimFrame.md b/src/content/docs/api/namespaces/util/functions/requestAnimFrame.md deleted file mode 100644 index a7c5239bb..000000000 --- a/src/content/docs/api/namespaces/util/functions/requestAnimFrame.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "requestAnimFrame" ---- - -> **requestAnimFrame**(`callback`): `number` - -## Parameters - -• **callback**: `FrameRequestCallback` - -## Returns - -`number` - -## Defined in - -[src/util/animation/AnimationFrameProvider.ts:3](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/AnimationFrameProvider.ts#L3) diff --git a/src/content/docs/api/namespaces/util/functions/resetObjectTransform.md b/src/content/docs/api/namespaces/util/functions/resetObjectTransform.md deleted file mode 100644 index 916cb5921..000000000 --- a/src/content/docs/api/namespaces/util/functions/resetObjectTransform.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "resetObjectTransform" ---- - -> **resetObjectTransform**(`target`): `void` - -reset an object transform state to neutral. Top and left are not accounted for - -## Parameters - -• **target**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -object to transform - -## Returns - -`void` - -## Defined in - -[src/util/misc/objectTransforms.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L71) diff --git a/src/content/docs/api/namespaces/util/functions/rotatePoint.md b/src/content/docs/api/namespaces/util/functions/rotatePoint.md deleted file mode 100644 index 3853c04cf..000000000 --- a/src/content/docs/api/namespaces/util/functions/rotatePoint.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "rotatePoint" ---- - -> **rotatePoint**(`point`, `origin`, `radians`): [`Point`](/api/classes/point/) - -## Parameters - -• **point**: [`Point`](/api/classes/point/) - -• **origin**: [`Point`](/api/classes/point/) - -The origin of the rotation - -• **radians**: [`TRadian`](/api/type-aliases/tradian/) - -The radians of the angle for the rotation - -## Returns - -[`Point`](/api/classes/point/) - -The new rotated point - -## Defined in - -[src/util/misc/rotatePoint.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/rotatePoint.ts#L11) diff --git a/src/content/docs/api/namespaces/util/functions/sendObjectToPlane.md b/src/content/docs/api/namespaces/util/functions/sendObjectToPlane.md deleted file mode 100644 index 51b611363..000000000 --- a/src/content/docs/api/namespaces/util/functions/sendObjectToPlane.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "sendObjectToPlane" ---- - -> **sendObjectToPlane**(`object`, `from`?, `to`?): [`TMat2D`](/api/type-aliases/tmat2d/) - -## Parameters - -• **object**: [`BaseFabricObject`](/api/classes/basefabricobject/)\<`Partial`\<`ObjectProps`\>, [`SerializedObjectProps`](/api/interfaces/serializedobjectprops/), [`ObjectEvents`](/api/interfaces/objectevents/)\> - -• **from?**: [`TMat2D`](/api/type-aliases/tmat2d/) - -plane matrix containing object. Passing `undefined` is equivalent to passing the identity matrix, which means `object` is a direct child of canvas. - -• **to?**: [`TMat2D`](/api/type-aliases/tmat2d/) - -destination plane matrix to contain object. Passing `undefined` means `object` should be sent to the canvas coordinate plane. - -## Returns - -[`TMat2D`](/api/type-aliases/tmat2d/) - -the transform matrix that was applied to `object` - -## Defined in - -[src/util/misc/planeChange.ts:81](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/planeChange.ts#L81) diff --git a/src/content/docs/api/namespaces/util/functions/sendPointToPlane.md b/src/content/docs/api/namespaces/util/functions/sendPointToPlane.md deleted file mode 100644 index 03473d798..000000000 --- a/src/content/docs/api/namespaces/util/functions/sendPointToPlane.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "sendPointToPlane" ---- - -> **sendPointToPlane**(`point`, `from`?, `to`?): [`Point`](/api/classes/point/) - -## Parameters - -• **point**: [`Point`](/api/classes/point/) - -• **from?**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -plane matrix containing object. Passing `undefined` is equivalent to passing the identity matrix, which means `point` exists in the canvas coordinate plane. - -• **to?**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -destination plane matrix to contain object. Passing `undefined` means `point` should be sent to the canvas coordinate plane. - -## Returns - -[`Point`](/api/classes/point/) - -transformed point - -## Defined in - -[src/util/misc/planeChange.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/planeChange.ts#L36) diff --git a/src/content/docs/api/namespaces/util/functions/sendVectorToPlane.md b/src/content/docs/api/namespaces/util/functions/sendVectorToPlane.md deleted file mode 100644 index d9d528928..000000000 --- a/src/content/docs/api/namespaces/util/functions/sendVectorToPlane.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "sendVectorToPlane" ---- - -> **sendVectorToPlane**(`point`, `from`, `to`): [`Point`](/api/classes/point/) - -See [sendPointToPlane](../../../../../../api/namespaces/util/functions/sendpointtoplane) - -## Parameters - -• **point**: [`Point`](/api/classes/point/) - -• **from**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -• **to**: [`TMat2D`](/api/type-aliases/tmat2d/) = `iMatrix` - -## Returns - -[`Point`](/api/classes/point/) - -## Defined in - -[src/util/misc/planeChange.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/planeChange.ts#L45) diff --git a/src/content/docs/api/namespaces/util/functions/setStyle.md b/src/content/docs/api/namespaces/util/functions/setStyle.md deleted file mode 100644 index 61a822793..000000000 --- a/src/content/docs/api/namespaces/util/functions/setStyle.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "setStyle" ---- - -> **setStyle**(`element`, `styles`): `void` - -wrapper for setting element's style - -## Parameters - -• **element**: `HTMLElement` - -• **styles**: `string` \| `Record`\<`string`, `string`\> - -## Returns - -`void` - -## Defined in - -[src/util/dom\_style.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/dom_style.ts#L8) diff --git a/src/content/docs/api/namespaces/util/functions/sin.md b/src/content/docs/api/namespaces/util/functions/sin.md deleted file mode 100644 index 10daa508a..000000000 --- a/src/content/docs/api/namespaces/util/functions/sin.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "sin" ---- - -> **sin**(`angle`): `number` - -## Parameters - -• **angle**: [`TRadian`](/api/type-aliases/tradian/) - -the angle - -## Returns - -`number` - -the sin value for angle. - -## Defined in - -[src/util/misc/sin.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/sin.ts#L11) diff --git a/src/content/docs/api/namespaces/util/functions/sizeAfterTransform.md b/src/content/docs/api/namespaces/util/functions/sizeAfterTransform.md deleted file mode 100644 index 8172b4783..000000000 --- a/src/content/docs/api/namespaces/util/functions/sizeAfterTransform.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "sizeAfterTransform" ---- - -> **sizeAfterTransform**(`width`, `height`, `t`): [`Point`](/api/classes/point/) - -## Parameters - -• **width**: `number` - -• **height**: `number` - -• **t**: [`TMat2D`](/api/type-aliases/tmat2d/) - -## Returns - -[`Point`](/api/classes/point/) - -size - -## Defined in - -[src/util/misc/objectTransforms.ts:107](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectTransforms.ts#L107) diff --git a/src/content/docs/api/namespaces/util/functions/stylesFromArray.md b/src/content/docs/api/namespaces/util/functions/stylesFromArray.md deleted file mode 100644 index 3c9632906..000000000 --- a/src/content/docs/api/namespaces/util/functions/stylesFromArray.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "stylesFromArray" ---- - -> **stylesFromArray**(`styles`, `text`): [`TextStyle`](/api/type-aliases/textstyle/) - -## Parameters - -• **styles**: [`TextStyle`](/api/type-aliases/textstyle/) \| [`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) - -the serialized form of a text object's styles - -• **text**: `string` - -the text string that the styles are applied to - -## Returns - -[`TextStyle`](/api/type-aliases/textstyle/) - -## Defined in - -[src/util/misc/textStyles.ts:99](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/textStyles.ts#L99) diff --git a/src/content/docs/api/namespaces/util/functions/stylesToArray.md b/src/content/docs/api/namespaces/util/functions/stylesToArray.md deleted file mode 100644 index 5ebb9a9bf..000000000 --- a/src/content/docs/api/namespaces/util/functions/stylesToArray.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "stylesToArray" ---- - -> **stylesToArray**(`styles`, `text`): [`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) - -## Parameters - -• **styles**: [`TextStyle`](/api/type-aliases/textstyle/) - -per character styles for a text object - -• **text**: `string` - -the text string that the styles are applied to - -## Returns - -[`TextStyleArray`](/api/namespaces/util/type-aliases/textstylearray/) - -## Defined in - -[src/util/misc/textStyles.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/textStyles.ts#L48) diff --git a/src/content/docs/api/namespaces/util/functions/toDataURL.md b/src/content/docs/api/namespaces/util/functions/toDataURL.md deleted file mode 100644 index a4832f2aa..000000000 --- a/src/content/docs/api/namespaces/util/functions/toDataURL.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "toDataURL" ---- - -> **toDataURL**(`canvasEl`, `format`, `quality`): `string` - -## Parameters - -• **canvasEl**: `HTMLCanvasElement` - -to copy size and content of - -• **format**: [`ImageFormat`](/api/type-aliases/imageformat/) - -'jpeg' or 'png', in some browsers 'webp' is ok too - -• **quality**: `number` - -<= 1 and > 0 - -## Returns - -`string` - -data url - -## Defined in - -[src/util/misc/dom.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/dom.ts#L53) diff --git a/src/content/docs/api/namespaces/util/functions/toFixed.md b/src/content/docs/api/namespaces/util/functions/toFixed.md deleted file mode 100644 index 8f1c6bbcc..000000000 --- a/src/content/docs/api/namespaces/util/functions/toFixed.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "toFixed" ---- - -> **toFixed**(`number`, `fractionDigits`): `number` - -## Parameters - -• **number**: `string` \| `number` - -number to operate on - -• **fractionDigits**: `number` - -number of fraction digits to "leave" - -## Returns - -`number` - -## Defined in - -[src/util/misc/toFixed.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/toFixed.ts#L7) diff --git a/src/content/docs/api/namespaces/util/functions/transformPath.md b/src/content/docs/api/namespaces/util/functions/transformPath.md deleted file mode 100644 index 8fc9fa03d..000000000 --- a/src/content/docs/api/namespaces/util/functions/transformPath.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "transformPath" ---- - -> **transformPath**(`path`, `transform`, `pathOffset`?): [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -## Parameters - -• **path**: [`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -fabricJS parsed and simplified path commands - -• **transform**: [`TMat2D`](/api/type-aliases/tmat2d/) - -matrix that represent the transformation - -• **pathOffset?**: [`Point`](/api/classes/point/) - -`Path.pathOffset` - -## Returns - -[`TSimplePathData`](/api/namespaces/util/type-aliases/tsimplepathdata/) - -the transformed path - -## Defined in - -[src/util/path/index.ts:966](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/index.ts#L966) diff --git a/src/content/docs/api/namespaces/util/functions/transformPoint.md b/src/content/docs/api/namespaces/util/functions/transformPoint.md deleted file mode 100644 index 94b4a0f78..000000000 --- a/src/content/docs/api/namespaces/util/functions/transformPoint.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "transformPoint" ---- - -> **transformPoint**(`p`, `t`, `ignoreOffset`?): [`Point`](/api/classes/point/) - -## Parameters - -• **p**: [`XY`](/api/interfaces/xy/) - -The point to transform - -• **t**: [`TMat2D`](/api/type-aliases/tmat2d/) - -The transform - -• **ignoreOffset?**: `boolean` - -Indicates that the offset should not be applied - -## Returns - -[`Point`](/api/classes/point/) - -The transformed point - -## Defined in - -[src/util/misc/matrix.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L46) diff --git a/src/content/docs/api/namespaces/util/index.md b/src/content/docs/api/namespaces/util/index.md deleted file mode 100644 index 30f00d21c..000000000 --- a/src/content/docs/api/namespaces/util/index.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "util" ---- - -## Index - -### Namespaces - -- [ease](/api/namespaces/util/namespaces/ease/index/) -- [string](/api/namespaces/util/namespaces/string/index/) - -### Type Aliases - -- [AnimationOptions](/api/namespaces/util/type-aliases/animationoptions/) -- [AnimationState](/api/namespaces/util/type-aliases/animationstate/) -- [ArrayAnimationOptions](/api/namespaces/util/type-aliases/arrayanimationoptions/) -- [ColorAnimationOptions](/api/namespaces/util/type-aliases/coloranimationoptions/) -- [EnlivenObjectOptions](/api/namespaces/util/type-aliases/enlivenobjectoptions/) -- [LoadImageOptions](/api/namespaces/util/type-aliases/loadimageoptions/) -- [TAbortCallback](/api/namespaces/util/type-aliases/tabortcallback/) -- [TAnimation](/api/namespaces/util/type-aliases/tanimation/) -- [TAnimationBaseOptions](/api/namespaces/util/type-aliases/tanimationbaseoptions/) -- [TAnimationCallbacks](/api/namespaces/util/type-aliases/tanimationcallbacks/) -- [TAnimationOptions](/api/namespaces/util/type-aliases/tanimationoptions/) -- [TArcCommand](/api/namespaces/util/type-aliases/tarccommand/) -- [TArcCommandSingleFlag](/api/namespaces/util/type-aliases/tarccommandsingleflag/) -- [TBaseAnimationOptions](/api/namespaces/util/type-aliases/tbaseanimationoptions/) -- [TClosePathCommand](/api/namespaces/util/type-aliases/tclosepathcommand/) -- [TComplexParsedCommand](/api/namespaces/util/type-aliases/tcomplexparsedcommand/) -- [TComplexParsedCommandType](/api/namespaces/util/type-aliases/tcomplexparsedcommandtype/) -- [TComplexPathData](/api/namespaces/util/type-aliases/tcomplexpathdata/) -- [TComposeMatrixArgs](/api/namespaces/util/type-aliases/tcomposematrixargs/) -- [TCubicCurveCommand](/api/namespaces/util/type-aliases/tcubiccurvecommand/) -- [TCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tcubiccurveshortcutcommand/) -- [TCurveInfo](/api/namespaces/util/type-aliases/tcurveinfo/) -- [TEasingFunction](/api/namespaces/util/type-aliases/teasingfunction/) -- [TEndPathInfo](/api/namespaces/util/type-aliases/tendpathinfo/) -- [THorizontalLineCommand](/api/namespaces/util/type-aliases/thorizontallinecommand/) -- [TLineCommand](/api/namespaces/util/type-aliases/tlinecommand/) -- [TMoveToCommand](/api/namespaces/util/type-aliases/tmovetocommand/) -- [TOnAnimationChangeCallback](/api/namespaces/util/type-aliases/tonanimationchangecallback/) -- [TParsedAbsoluteArcCommand](/api/namespaces/util/type-aliases/tparsedabsolutearccommand/) -- [TParsedAbsoluteClosePathCommand](/api/namespaces/util/type-aliases/tparsedabsoluteclosepathcommand/) -- [TParsedAbsoluteCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurvecommand/) -- [TParsedAbsoluteCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) -- [TParsedAbsoluteHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedabsolutehorizontallinecommand/) -- [TParsedAbsoluteLineCommand](/api/namespaces/util/type-aliases/tparsedabsolutelinecommand/) -- [TParsedAbsoluteMoveToCommand](/api/namespaces/util/type-aliases/tparsedabsolutemovetocommand/) -- [TParsedAbsoluteQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurvecommand/) -- [TParsedAbsoluteQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) -- [TParsedAbsoluteVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedabsoluteverticallinecommand/) -- [TParsedArcCommand](/api/namespaces/util/type-aliases/tparsedarccommand/) -- [TParsedClosePathCommand](/api/namespaces/util/type-aliases/tparsedclosepathcommand/) -- [TParsedCommand](/api/namespaces/util/type-aliases/tparsedcommand/) -- [TParsedCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedcubiccurvecommand/) -- [TParsedCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedcubiccurveshortcutcommand/) -- [TParsedHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedhorizontallinecommand/) -- [TParsedLineCommand](/api/namespaces/util/type-aliases/tparsedlinecommand/) -- [TParsedMoveToCommand](/api/namespaces/util/type-aliases/tparsedmovetocommand/) -- [TParsedQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedquadraticcurvecommand/) -- [TParsedQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedquadraticcurveshortcutcommand/) -- [TParsedRelativeArcCommand](/api/namespaces/util/type-aliases/tparsedrelativearccommand/) -- [TParsedRelativeClosePathCommand](/api/namespaces/util/type-aliases/tparsedrelativeclosepathcommand/) -- [TParsedRelativeCubicCurveCommand](/api/namespaces/util/type-aliases/tparsedrelativecubiccurvecommand/) -- [TParsedRelativeCubicCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedrelativecubiccurveshortcutcommand/) -- [TParsedRelativeHorizontalLineCommand](/api/namespaces/util/type-aliases/tparsedrelativehorizontallinecommand/) -- [TParsedRelativeLineCommand](/api/namespaces/util/type-aliases/tparsedrelativelinecommand/) -- [TParsedRelativeMoveToCommand](/api/namespaces/util/type-aliases/tparsedrelativemovetocommand/) -- [TParsedRelativeQuadraticCurveCommand](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurvecommand/) -- [TParsedRelativeQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) -- [TParsedRelativeVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedrelativeverticallinecommand/) -- [TParsedVerticalLineCommand](/api/namespaces/util/type-aliases/tparsedverticallinecommand/) -- [TPathSegmentCommandInfo](/api/namespaces/util/type-aliases/tpathsegmentcommandinfo/) -- [TPathSegmentInfo](/api/namespaces/util/type-aliases/tpathsegmentinfo/) -- [TPathSegmentInfoCommon](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/) -- [TPointAngle](/api/namespaces/util/type-aliases/tpointangle/) -- [TProjectStrokeOnPointsOptions](/api/namespaces/util/type-aliases/tprojectstrokeonpointsoptions/) -- [TProjection](/api/namespaces/util/type-aliases/tprojection/) -- [TQrDecomposeOut](/api/namespaces/util/type-aliases/tqrdecomposeout/) -- [TQuadraticCurveCommand](/api/namespaces/util/type-aliases/tquadraticcurvecommand/) -- [TQuadraticCurveShortcutCommand](/api/namespaces/util/type-aliases/tquadraticcurveshortcutcommand/) -- [TRotateMatrixArgs](/api/namespaces/util/type-aliases/trotatematrixargs/) -- [TScaleMatrixArgs](/api/namespaces/util/type-aliases/tscalematrixargs/) -- [TSimpleParseCommandType](/api/namespaces/util/type-aliases/tsimpleparsecommandtype/) -- [TSimpleParsedCommand](/api/namespaces/util/type-aliases/tsimpleparsedcommand/) -- [TSimplePathData](/api/namespaces/util/type-aliases/tsimplepathdata/) -- [TTranslateMatrixArgs](/api/namespaces/util/type-aliases/ttranslatematrixargs/) -- [TVerticalLineCommand](/api/namespaces/util/type-aliases/tverticallinecommand/) -- [TextStyleArray](/api/namespaces/util/type-aliases/textstylearray/) -- [ValueAnimationOptions](/api/namespaces/util/type-aliases/valueanimationoptions/) - -### Functions - -- [addTransformToObject](/api/namespaces/util/functions/addtransformtoobject/) -- [animate](/api/namespaces/util/functions/animate/) -- [animateColor](/api/namespaces/util/functions/animatecolor/) -- [applyTransformToObject](/api/namespaces/util/functions/applytransformtoobject/) -- [calcAngleBetweenVectors](/api/namespaces/util/functions/calcanglebetweenvectors/) -- [calcDimensionsMatrix](/api/namespaces/util/functions/calcdimensionsmatrix/) -- [calcPlaneChangeMatrix](/api/namespaces/util/functions/calcplanechangematrix/) -- [calcVectorRotation](/api/namespaces/util/functions/calcvectorrotation/) -- [cancelAnimFrame](/api/namespaces/util/functions/cancelanimframe/) -- [capValue](/api/namespaces/util/functions/capvalue/) -- [composeMatrix](/api/namespaces/util/functions/composematrix/) -- [copyCanvasElement](/api/namespaces/util/functions/copycanvaselement/) -- [cos](/api/namespaces/util/functions/cos/) -- [createCanvasElement](/api/namespaces/util/functions/createcanvaselement/) -- [createImage](/api/namespaces/util/functions/createimage/) -- [createRotateMatrix](/api/namespaces/util/functions/createrotatematrix/) -- [createScaleMatrix](/api/namespaces/util/functions/createscalematrix/) -- [createSkewXMatrix](/api/namespaces/util/functions/createskewxmatrix/) -- [createSkewYMatrix](/api/namespaces/util/functions/createskewymatrix/) -- [createTranslateMatrix](/api/namespaces/util/functions/createtranslatematrix/) -- [createVector](/api/namespaces/util/functions/createvector/) -- [crossProduct](/api/namespaces/util/functions/crossproduct/) -- [degreesToRadians](/api/namespaces/util/functions/degreestoradians/) -- [dotProduct](/api/namespaces/util/functions/dotproduct/) -- [enlivenObjectEnlivables](/api/namespaces/util/functions/enlivenobjectenlivables/) -- [enlivenObjects](/api/namespaces/util/functions/enlivenobjects/) -- [findScaleToCover](/api/namespaces/util/functions/findscaletocover/) -- [findScaleToFit](/api/namespaces/util/functions/findscaletofit/) -- [getBoundsOfCurve](/api/namespaces/util/functions/getboundsofcurve/) -- [getOrthonormalVector](/api/namespaces/util/functions/getorthonormalvector/) -- [getPathSegmentsInfo](/api/namespaces/util/functions/getpathsegmentsinfo/) -- [getPointOnPath](/api/namespaces/util/functions/getpointonpath/) -- [getPointer](/api/namespaces/util/functions/getpointer/) -- [getRandomInt](/api/namespaces/util/functions/getrandomint/) -- [getRegularPolygonPath](/api/namespaces/util/functions/getregularpolygonpath/) -- [getSmoothPathFromPoints](/api/namespaces/util/functions/getsmoothpathfrompoints/) -- [getSvgAttributes](/api/namespaces/util/functions/getsvgattributes/) -- [getUnitVector](/api/namespaces/util/functions/getunitvector/) -- [groupSVGElements](/api/namespaces/util/functions/groupsvgelements/) -- [hasStyleChanged](/api/namespaces/util/functions/hasstylechanged/) -- [invertTransform](/api/namespaces/util/functions/inverttransform/) -- [isBetweenVectors](/api/namespaces/util/functions/isbetweenvectors/) -- [isIdentityMatrix](/api/namespaces/util/functions/isidentitymatrix/) -- [isTouchEvent](/api/namespaces/util/functions/istouchevent/) -- [isTransparent](/api/namespaces/util/functions/istransparent/) -- [joinPath](/api/namespaces/util/functions/joinpath/) -- [loadImage](/api/namespaces/util/functions/loadimage/) -- [magnitude](/api/namespaces/util/functions/magnitude/) -- [makeBoundingBoxFromPoints](/api/namespaces/util/functions/makeboundingboxfrompoints/) -- [makePathSimpler](/api/namespaces/util/functions/makepathsimpler/) -- [matrixToSVG](/api/namespaces/util/functions/matrixtosvg/) -- [mergeClipPaths](/api/namespaces/util/functions/mergeclippaths/) -- [multiplyTransformMatrices](/api/namespaces/util/functions/multiplytransformmatrices/) -- [multiplyTransformMatrixArray](/api/namespaces/util/functions/multiplytransformmatrixarray/) -- [parsePath](/api/namespaces/util/functions/parsepath/) -- [parsePreserveAspectRatioAttribute](/api/namespaces/util/functions/parsepreserveaspectratioattribute/) -- [parseUnit](/api/namespaces/util/functions/parseunit/) -- [pick](/api/namespaces/util/functions/pick/) -- [projectStrokeOnPoints](/api/namespaces/util/functions/projectstrokeonpoints/) -- [qrDecompose](/api/namespaces/util/functions/qrdecompose/) -- [radiansToDegrees](/api/namespaces/util/functions/radianstodegrees/) -- [removeFromArray](/api/namespaces/util/functions/removefromarray/) -- [removeTransformFromObject](/api/namespaces/util/functions/removetransformfromobject/) -- [request](/api/namespaces/util/functions/request/) -- [requestAnimFrame](/api/namespaces/util/functions/requestanimframe/) -- [resetObjectTransform](/api/namespaces/util/functions/resetobjecttransform/) -- [rotatePoint](/api/namespaces/util/functions/rotatepoint/) -- [rotateVector](/api/namespaces/util/functions/rotatevector/) -- [saveObjectTransform](/api/namespaces/util/functions/saveobjecttransform/) -- [sendObjectToPlane](/api/namespaces/util/functions/sendobjecttoplane/) -- [sendPointToPlane](/api/namespaces/util/functions/sendpointtoplane/) -- [sendVectorToPlane](/api/namespaces/util/functions/sendvectortoplane/) -- [setStyle](/api/namespaces/util/functions/setstyle/) -- [sin](/api/namespaces/util/functions/sin/) -- [sizeAfterTransform](/api/namespaces/util/functions/sizeaftertransform/) -- [stylesFromArray](/api/namespaces/util/functions/stylesfromarray/) -- [stylesToArray](/api/namespaces/util/functions/stylestoarray/) -- [toDataURL](/api/namespaces/util/functions/todataurl/) -- [toFixed](/api/namespaces/util/functions/tofixed/) -- [transformPath](/api/namespaces/util/functions/transformpath/) -- [transformPoint](/api/namespaces/util/functions/transformpoint/) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/defaultEasing.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/defaultEasing.md deleted file mode 100644 index f5174df5f..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/defaultEasing.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "defaultEasing" ---- - -> **defaultEasing**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Default sinusoidal easing - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:36](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L36) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBack.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBack.md deleted file mode 100644 index 8becbb981..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBack.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInBack" ---- - -> **easeInBack**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Backwards easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:258](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L258) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBounce.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBounce.md deleted file mode 100644 index 97c0cfc5a..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInBounce.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInBounce" ---- - -> **easeInBounce**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Bouncing easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:296](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L296) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCirc.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCirc.md deleted file mode 100644 index f9843f257..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCirc.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInCirc" ---- - -> **easeInCirc**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Circular easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:158](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L158) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCubic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCubic.md deleted file mode 100644 index 407c19ee0..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInCubic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInCubic" ---- - -> **easeInCubic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Cubic easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:42](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L42) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInElastic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInElastic.md deleted file mode 100644 index 6b04213a2..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInElastic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInElastic" ---- - -> **easeInElastic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Elastic easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:181](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L181) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInExpo.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInExpo.md deleted file mode 100644 index cfdf0c46a..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInExpo.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInExpo" ---- - -> **easeInExpo**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Exponential easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:129](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L129) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBack.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBack.md deleted file mode 100644 index 057cb4d27..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBack.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutBack" ---- - -> **easeInOutBack**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Backwards easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:270](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L270) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBounce.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBounce.md deleted file mode 100644 index a3a8343c1..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutBounce.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutBounce" ---- - -> **easeInOutBounce**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Bouncing easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:302](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L302) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCirc.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCirc.md deleted file mode 100644 index 26e0cf665..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCirc.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutCirc" ---- - -> **easeInOutCirc**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Circular easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:170](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L170) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCubic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCubic.md deleted file mode 100644 index b772299cb..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutCubic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutCubic" ---- - -> **easeInOutCubic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Cubic easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L54) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutElastic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutElastic.md deleted file mode 100644 index 18f6ed9d1..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutElastic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutElastic" ---- - -> **easeInOutElastic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Elastic easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:227](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L227) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutExpo.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutExpo.md deleted file mode 100644 index 0307aed82..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutExpo.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutExpo" ---- - -> **easeInOutExpo**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Exponential easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:141](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L141) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuad.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuad.md deleted file mode 100644 index f1aa4c878..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuad.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutQuad" ---- - -> **easeInOutQuad**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quadratic easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L321) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuart.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuart.md deleted file mode 100644 index 026e60599..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuart.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutQuart" ---- - -> **easeInOutQuart**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quartic easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:77](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L77) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuint.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuint.md deleted file mode 100644 index 353d8b67b..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutQuint.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutQuint" ---- - -> **easeInOutQuint**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quintic easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L100) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutSine.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutSine.md deleted file mode 100644 index 96c3d1ec5..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInOutSine.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInOutSine" ---- - -> **easeInOutSine**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Sinusoidal easing in and out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L123) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuad.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuad.md deleted file mode 100644 index 7ab882708..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuad.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInQuad" ---- - -> **easeInQuad**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quadratic easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:310](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L310) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuart.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuart.md deleted file mode 100644 index df185f632..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuart.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInQuart" ---- - -> **easeInQuart**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quartic easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L65) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuint.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuint.md deleted file mode 100644 index dc17cf877..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInQuint.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInQuint" ---- - -> **easeInQuint**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quintic easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:88](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L88) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInSine.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInSine.md deleted file mode 100644 index 3957aa5bc..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeInSine.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeInSine" ---- - -> **easeInSine**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Sinusoidal easing in - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:111](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L111) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBack.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBack.md deleted file mode 100644 index 542e8e350..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBack.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutBack" ---- - -> **easeOutBack**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Backwards easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:264](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L264) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBounce.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBounce.md deleted file mode 100644 index 54c43b03f..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutBounce.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutBounce" ---- - -> **easeOutBounce**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Bouncing easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:281](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L281) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCirc.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCirc.md deleted file mode 100644 index f5b572cbf..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCirc.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutCirc" ---- - -> **easeOutCirc**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Circular easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L164) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCubic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCubic.md deleted file mode 100644 index b629f02fe..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutCubic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutCubic" ---- - -> **easeOutCubic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Cubic easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L48) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutElastic.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutElastic.md deleted file mode 100644 index b51b67697..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutElastic.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutElastic" ---- - -> **easeOutElastic**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Elastic easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:202](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L202) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutExpo.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutExpo.md deleted file mode 100644 index 485055930..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutExpo.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutExpo" ---- - -> **easeOutExpo**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Exponential easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:135](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L135) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuad.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuad.md deleted file mode 100644 index 3c8c72076..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuad.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutQuad" ---- - -> **easeOutQuad**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quadratic easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:315](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L315) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuart.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuart.md deleted file mode 100644 index d61cc6a26..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuart.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutQuart" ---- - -> **easeOutQuart**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quartic easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:71](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L71) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuint.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuint.md deleted file mode 100644 index 2db0f6a6a..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutQuint.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutQuint" ---- - -> **easeOutQuint**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Quintic easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:94](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L94) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutSine.md b/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutSine.md deleted file mode 100644 index 0262878d8..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/functions/easeOutSine.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "easeOutSine" ---- - -> **easeOutSine**(`timeElapsed`, `startValue`, `byValue`, `duration`): `number` - -Sinusoidal easing out - -## Parameters - -• **timeElapsed**: `number` - -• **startValue**: `number` - -• **byValue**: `number` - -• **duration**: `number` - -## Returns - -`number` - -## Defined in - -[src/util/animation/easing.ts:117](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/easing.ts#L117) diff --git a/src/content/docs/api/namespaces/util/namespaces/ease/index.md b/src/content/docs/api/namespaces/util/namespaces/ease/index.md deleted file mode 100644 index 22e358574..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/ease/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "ease" ---- - -## Index - -### Functions - -- [defaultEasing](/api/namespaces/util/namespaces/ease/functions/defaulteasing/) -- [easeInBack](/api/namespaces/util/namespaces/ease/functions/easeinback/) -- [easeInBounce](/api/namespaces/util/namespaces/ease/functions/easeinbounce/) -- [easeInCirc](/api/namespaces/util/namespaces/ease/functions/easeincirc/) -- [easeInCubic](/api/namespaces/util/namespaces/ease/functions/easeincubic/) -- [easeInElastic](/api/namespaces/util/namespaces/ease/functions/easeinelastic/) -- [easeInExpo](/api/namespaces/util/namespaces/ease/functions/easeinexpo/) -- [easeInOutBack](/api/namespaces/util/namespaces/ease/functions/easeinoutback/) -- [easeInOutBounce](/api/namespaces/util/namespaces/ease/functions/easeinoutbounce/) -- [easeInOutCirc](/api/namespaces/util/namespaces/ease/functions/easeinoutcirc/) -- [easeInOutCubic](/api/namespaces/util/namespaces/ease/functions/easeinoutcubic/) -- [easeInOutElastic](/api/namespaces/util/namespaces/ease/functions/easeinoutelastic/) -- [easeInOutExpo](/api/namespaces/util/namespaces/ease/functions/easeinoutexpo/) -- [easeInOutQuad](/api/namespaces/util/namespaces/ease/functions/easeinoutquad/) -- [easeInOutQuart](/api/namespaces/util/namespaces/ease/functions/easeinoutquart/) -- [easeInOutQuint](/api/namespaces/util/namespaces/ease/functions/easeinoutquint/) -- [easeInOutSine](/api/namespaces/util/namespaces/ease/functions/easeinoutsine/) -- [easeInQuad](/api/namespaces/util/namespaces/ease/functions/easeinquad/) -- [easeInQuart](/api/namespaces/util/namespaces/ease/functions/easeinquart/) -- [easeInQuint](/api/namespaces/util/namespaces/ease/functions/easeinquint/) -- [easeInSine](/api/namespaces/util/namespaces/ease/functions/easeinsine/) -- [easeOutBack](/api/namespaces/util/namespaces/ease/functions/easeoutback/) -- [easeOutBounce](/api/namespaces/util/namespaces/ease/functions/easeoutbounce/) -- [easeOutCirc](/api/namespaces/util/namespaces/ease/functions/easeoutcirc/) -- [easeOutCubic](/api/namespaces/util/namespaces/ease/functions/easeoutcubic/) -- [easeOutElastic](/api/namespaces/util/namespaces/ease/functions/easeoutelastic/) -- [easeOutExpo](/api/namespaces/util/namespaces/ease/functions/easeoutexpo/) -- [easeOutQuad](/api/namespaces/util/namespaces/ease/functions/easeoutquad/) -- [easeOutQuart](/api/namespaces/util/namespaces/ease/functions/easeoutquart/) -- [easeOutQuint](/api/namespaces/util/namespaces/ease/functions/easeoutquint/) -- [easeOutSine](/api/namespaces/util/namespaces/ease/functions/easeoutsine/) diff --git a/src/content/docs/api/namespaces/util/namespaces/string/functions/escapeXml.md b/src/content/docs/api/namespaces/util/namespaces/string/functions/escapeXml.md deleted file mode 100644 index 274062e4f..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/string/functions/escapeXml.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "escapeXml" ---- - -> **escapeXml**(`string`): `string` - -## Parameters - -• **string**: `string` - -String to escape - -## Returns - -`string` - -Escaped version of a string - -## Defined in - -[src/util/lang\_string.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/lang_string.ts#L19) diff --git a/src/content/docs/api/namespaces/util/namespaces/string/functions/graphemeSplit.md b/src/content/docs/api/namespaces/util/namespaces/string/functions/graphemeSplit.md deleted file mode 100644 index 5d6c44028..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/string/functions/graphemeSplit.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "graphemeSplit" ---- - -> **graphemeSplit**(`textstring`): `string`[] - -## Parameters - -• **textstring**: `string` - -String to escape - -## Returns - -`string`[] - -array containing the graphemes - -## Defined in - -[src/util/lang\_string.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/lang_string.ts#L32) diff --git a/src/content/docs/api/namespaces/util/namespaces/string/index.md b/src/content/docs/api/namespaces/util/namespaces/string/index.md deleted file mode 100644 index 102f7983a..000000000 --- a/src/content/docs/api/namespaces/util/namespaces/string/index.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "string" ---- - -## Index - -### Functions - -- [capitalize](/api/namespaces/util/namespaces/string/functions/capitalize/) -- [escapeXml](/api/namespaces/util/namespaces/string/functions/escapexml/) -- [graphemeSplit](/api/namespaces/util/namespaces/string/functions/graphemesplit/) diff --git a/src/content/docs/api/namespaces/util/type-aliases/AnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/AnimationOptions.md deleted file mode 100644 index 7654b4701..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/AnimationOptions.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "AnimationOptions" ---- - -> **AnimationOptions**\<`T`\>: `T` *extends* [`TColorArg`](/api/type-aliases/tcolorarg/) ? [`ColorAnimationOptions`](/api/namespaces/util/type-aliases/coloranimationoptions/) : `T` *extends* `number`[] ? [`ArrayAnimationOptions`](/api/namespaces/util/type-aliases/arrayanimationoptions/) : [`ValueAnimationOptions`](/api/namespaces/util/type-aliases/valueanimationoptions/) - -## Type Parameters - -• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/) - -## Defined in - -[src/util/animation/types.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L131) diff --git a/src/content/docs/api/namespaces/util/type-aliases/AnimationState.md b/src/content/docs/api/namespaces/util/type-aliases/AnimationState.md deleted file mode 100644 index 42aae8422..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/AnimationState.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "AnimationState" ---- - -> **AnimationState**: `"pending"` \| `"running"` \| `"completed"` \| `"aborted"` - -## Defined in - -[src/util/animation/types.ts:3](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L3) diff --git a/src/content/docs/api/namespaces/util/type-aliases/ArrayAnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/ArrayAnimationOptions.md deleted file mode 100644 index 6563a10ea..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/ArrayAnimationOptions.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "ArrayAnimationOptions" ---- - -> **ArrayAnimationOptions**: [`TAnimationOptions`](/api/namespaces/util/type-aliases/tanimationoptions/)\<`number`[]\> - -## Defined in - -[src/util/animation/types.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L123) diff --git a/src/content/docs/api/namespaces/util/type-aliases/ColorAnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/ColorAnimationOptions.md deleted file mode 100644 index 22b95b1b9..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/ColorAnimationOptions.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "ColorAnimationOptions" ---- - -> **ColorAnimationOptions**: [`TAnimationOptions`](/api/namespaces/util/type-aliases/tanimationoptions/)\<[`TColorArg`](/api/type-aliases/tcolorarg/), `string`, `number`[]\> - -## Defined in - -[src/util/animation/types.ts:125](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L125) diff --git a/src/content/docs/api/namespaces/util/type-aliases/EnlivenObjectOptions.md b/src/content/docs/api/namespaces/util/type-aliases/EnlivenObjectOptions.md deleted file mode 100644 index 5ad7a4808..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/EnlivenObjectOptions.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "EnlivenObjectOptions" ---- - -> **EnlivenObjectOptions**: [`Abortable`](/api/type-aliases/abortable/) & `object` - -## Type declaration - -### reviver()? - -> `optional` **reviver**: \<`T`\>(`serializedObj`, `instance`) => `void` - -Method for further parsing of object elements, -called after each fabric object created. - -#### Type Parameters - -• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) \| [`FabricObject`](/api/classes/fabricobject/) \| [`BaseFilter`](/api/namespaces/filters/classes/basefilter/)\<`string`\> \| [`Shadow`](/api/classes/shadow/) \| [`TFiller`](/api/type-aliases/tfiller/) - -#### Parameters - -• **serializedObj**: `Record`\<`string`, `any`\> - -• **instance**: `T` - -#### Returns - -`void` - -## Defined in - -[src/util/misc/objectEnlive.ts:64](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectEnlive.ts#L64) diff --git a/src/content/docs/api/namespaces/util/type-aliases/LoadImageOptions.md b/src/content/docs/api/namespaces/util/type-aliases/LoadImageOptions.md deleted file mode 100644 index 65175479b..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/LoadImageOptions.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "LoadImageOptions" ---- - -> **LoadImageOptions**: [`Abortable`](/api/type-aliases/abortable/) & `object` - -## Type declaration - -### crossOrigin? - -> `optional` **crossOrigin**: [`TCrossOrigin`](/api/type-aliases/tcrossorigin/) - -cors value for the image loading, default to anonymous - -## Defined in - -[src/util/misc/objectEnlive.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/objectEnlive.ts#L16) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TAbortCallback.md b/src/content/docs/api/namespaces/util/type-aliases/TAbortCallback.md deleted file mode 100644 index 85d690edb..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TAbortCallback.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TAbortCallback" ---- - -> **TAbortCallback**\<`T`\>: [`TOnAnimationChangeCallback`](/api/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`, `boolean`\> - -Called on each step to determine if animation should abort - -## Type Parameters - -• **T** - -## Defined in - -[src/util/animation/types.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L22) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TAnimation.md b/src/content/docs/api/namespaces/util/type-aliases/TAnimation.md deleted file mode 100644 index 2ada4c701..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TAnimation.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TAnimation" ---- - -> **TAnimation**\<`T`\>: `T` *extends* [`TColorArg`](/api/type-aliases/tcolorarg/) ? `ColorAnimation` : `T` *extends* `number`[] ? `ArrayAnimation` : `ValueAnimation` - -## Type Parameters - -• **T** *extends* `number` \| `number`[] \| [`TColorArg`](/api/type-aliases/tcolorarg/) - -## Defined in - -[src/util/animation/animate.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/animate.ts#L11) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TAnimationBaseOptions.md b/src/content/docs/api/namespaces/util/type-aliases/TAnimationBaseOptions.md deleted file mode 100644 index c8b62f016..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TAnimationBaseOptions.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TAnimationBaseOptions" ---- - -> **TAnimationBaseOptions**\<`T`\>: `object` - -## Type Parameters - -• **T** - -## Type declaration - -### delay - -> **delay**: `number` - -Delay to start the animation in ms - -#### Default - -```ts -0 -``` - -### duration - -> **duration**: `number` - -Duration of the animation in ms - -#### Default - -```ts -500 -``` - -### easing - -> **easing**: [`TEasingFunction`](/api/namespaces/util/type-aliases/teasingfunction/)\<`T`\> - -Easing function - -#### Default - -```ts -{defaultEasing} -``` - -### target - -> **target**: `unknown` - -The object this animation is being performed on - -## Defined in - -[src/util/animation/types.ts:49](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L49) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TAnimationCallbacks.md b/src/content/docs/api/namespaces/util/type-aliases/TAnimationCallbacks.md deleted file mode 100644 index 0b05b4b67..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TAnimationCallbacks.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TAnimationCallbacks" ---- - -> **TAnimationCallbacks**\<`T`\>: `object` - -## Type Parameters - -• **T** - -## Type declaration - -### abort - -> **abort**: [`TAbortCallback`](/api/namespaces/util/type-aliases/tabortcallback/)\<`T`\> - -Function called at each frame. -If it returns true, abort - -### onChange - -> **onChange**: [`TOnAnimationChangeCallback`](/api/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`\> - -Called at each frame of the animation - -### onComplete - -> **onComplete**: [`TOnAnimationChangeCallback`](/api/namespaces/util/type-aliases/tonanimationchangecallback/)\<`T`\> - -Called after the last frame of the animation - -### onStart - -> **onStart**: `VoidFunction` - -Called when the animation starts - -## Defined in - -[src/util/animation/types.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L74) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TAnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/TAnimationOptions.md deleted file mode 100644 index 711fdf8fe..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TAnimationOptions.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TAnimationOptions" ---- - -> **TAnimationOptions**\<`T`, `TCallback`, `TEasing`\>: `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`TEasing`\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`TCallback`\> & `object`\> - -## Type Parameters - -• **T** - -• **TCallback** = `T` - -• **TEasing** = `T` - -## Defined in - -[src/util/animation/types.ts:104](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L104) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TArcCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TArcCommand.md deleted file mode 100644 index b426b7f5c..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TArcCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TArcCommand" ---- - -> **TArcCommand**: `TCommand8`\<[`TParsedArcCommand`](/api/namespaces/util/type-aliases/tparsedarccommand/)\> \| [`TArcCommandSingleFlag`](/api/namespaces/util/type-aliases/tarccommandsingleflag/)\<[`TParsedArcCommand`](/api/namespaces/util/type-aliases/tparsedarccommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:255](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L255) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TArcCommandSingleFlag.md b/src/content/docs/api/namespaces/util/type-aliases/TArcCommandSingleFlag.md deleted file mode 100644 index da05913e9..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TArcCommandSingleFlag.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TArcCommandSingleFlag" ---- - -> **TArcCommandSingleFlag**\<`T`\>: \`$\{T\[0\]\} $\{T\[1\]\} $\{T\[2\]\} $\{T\[3\]\} $\{T\[4\]\}$\{T\[5\]\} $\{T\[6\]\} $\{T\[7\]\}\` - -## Type Parameters - -• **T** *extends* [`TParsedArcCommand`](/api/namespaces/util/type-aliases/tparsedarccommand/) - -## Defined in - -[src/util/path/typedefs.ts:253](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L253) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TBaseAnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/TBaseAnimationOptions.md deleted file mode 100644 index 57b930d45..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TBaseAnimationOptions.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TBaseAnimationOptions" ---- - -> **TBaseAnimationOptions**\<`T`, `TCallback`, `TEasing`\>: `Partial`\<[`TAnimationBaseOptions`](/api/namespaces/util/type-aliases/tanimationbaseoptions/)\<`TEasing`\> & [`TAnimationCallbacks`](/api/namespaces/util/type-aliases/tanimationcallbacks/)\<`TCallback`\>\> & `object` - -## Type declaration - -### byValue - -> **byValue**: `T` - -### startValue - -> **startValue**: `T` - -## Type Parameters - -• **T** - -• **TCallback** = `T` - -• **TEasing** = `T` - -## Defined in - -[src/util/animation/types.ts:97](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L97) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TClosePathCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TClosePathCommand.md deleted file mode 100644 index 24648bcd7..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TClosePathCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TClosePathCommand" ---- - -> **TClosePathCommand**: `TCommand1`\<[`TParsedClosePathCommand`](/api/namespaces/util/type-aliases/tparsedclosepathcommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:144](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L144) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommand.md deleted file mode 100644 index 6002a39be..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommand.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TComplexParsedCommand" ---- - -> **TComplexParsedCommand**: [`TParsedMoveToCommand`](/api/namespaces/util/type-aliases/tparsedmovetocommand/) \| [`TParsedLineCommand`](/api/namespaces/util/type-aliases/tparsedlinecommand/) \| [`TParsedHorizontalLineCommand`](/api/namespaces/util/type-aliases/tparsedhorizontallinecommand/) \| [`TParsedVerticalLineCommand`](/api/namespaces/util/type-aliases/tparsedverticallinecommand/) \| [`TParsedClosePathCommand`](/api/namespaces/util/type-aliases/tparsedclosepathcommand/) \| [`TParsedCubicCurveCommand`](/api/namespaces/util/type-aliases/tparsedcubiccurvecommand/) \| [`TParsedCubicCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedcubiccurveshortcutcommand/) \| [`TParsedQuadraticCurveCommand`](/api/namespaces/util/type-aliases/tparsedquadraticcurvecommand/) \| [`TParsedQuadraticCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedquadraticcurveshortcutcommand/) \| [`TParsedArcCommand`](/api/namespaces/util/type-aliases/tparsedarccommand/) - -Any old valid SVG path command - -## Defined in - -[src/util/path/typedefs.ts:266](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L266) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommandType.md b/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommandType.md deleted file mode 100644 index 44984ba8e..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TComplexParsedCommandType.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TComplexParsedCommandType" ---- - -> **TComplexParsedCommandType**: `"M"` \| `"L"` \| `"C"` \| `"Q"` \| `"Z"` \| `"z"` \| `"m"` \| `"l"` \| `"h"` \| `"v"` \| `"c"` \| `"s"` \| `"q"` \| `"t"` \| `"a"` \| `"H"` \| `"V"` \| `"S"` \| `"T"` \| `"A"` - -## Defined in - -[src/util/path/typedefs.ts:296](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L296) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TComplexPathData.md b/src/content/docs/api/namespaces/util/type-aliases/TComplexPathData.md deleted file mode 100644 index b61823132..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TComplexPathData.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TComplexPathData" ---- - -> **TComplexPathData**: [`TComplexParsedCommand`](/api/namespaces/util/type-aliases/tcomplexparsedcommand/)[] - -A series of path commands - -## Defined in - -[src/util/path/typedefs.ts:281](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L281) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TComposeMatrixArgs.md b/src/content/docs/api/namespaces/util/type-aliases/TComposeMatrixArgs.md deleted file mode 100644 index eefde771f..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TComposeMatrixArgs.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TComposeMatrixArgs" ---- - -> **TComposeMatrixArgs**: [`TTranslateMatrixArgs`](/api/namespaces/util/type-aliases/ttranslatematrixargs/) & [`TRotateMatrixArgs`](/api/namespaces/util/type-aliases/trotatematrixargs/) & [`TScaleMatrixArgs`](/api/namespaces/util/type-aliases/tscalematrixargs/) - -## Defined in - -[src/util/misc/matrix.ts:27](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L27) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveCommand.md deleted file mode 100644 index aca849b37..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TCubicCurveCommand" ---- - -> **TCubicCurveCommand**: `TCommand7`\<[`TParsedCubicCurveCommand`](/api/namespaces/util/type-aliases/tparsedcubiccurvecommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:168](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L168) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveShortcutCommand.md deleted file mode 100644 index d3a73a4e6..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TCubicCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TCubicCurveShortcutCommand" ---- - -> **TCubicCurveShortcutCommand**: `TCommand5`\<[`TParsedCubicCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedcubiccurveshortcutcommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:188](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L188) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TEasingFunction.md b/src/content/docs/api/namespaces/util/type-aliases/TEasingFunction.md deleted file mode 100644 index 906630b16..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TEasingFunction.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TEasingFunction" ---- - -> **TEasingFunction**\<`T`\>: `T` *extends* `number`[] ? (`timeElapsed`, `startValue`, `byValue`, `duration`, `index`) => `number` : (`timeElapsed`, `startValue`, `byValue`, `duration`) => `number` - -An easing function used to calculate the current value - -## See - -AnimationBase#calculate - -## Param - -ms elapsed since start - -## Param - -## Param - -## Param - -in ms - -## Type Parameters - -• **T** = `unknown` - -## Defined in - -[src/util/animation/types.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L34) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TEndPathInfo.md b/src/content/docs/api/namespaces/util/type-aliases/TEndPathInfo.md deleted file mode 100644 index 55996dd53..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TEndPathInfo.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TEndPathInfo" ---- - -> **TEndPathInfo**: [`TPathSegmentInfoCommon`](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/)\<`"Z"`\> & `object` - -## Type declaration - -### destX - -> **destX**: `number` - -### destY - -> **destY**: `number` - -## Defined in - -[src/util/path/typedefs.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L28) diff --git a/src/content/docs/api/namespaces/util/type-aliases/THorizontalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/THorizontalLineCommand.md deleted file mode 100644 index 41b4cf4a8..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/THorizontalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "THorizontalLineCommand" ---- - -> **THorizontalLineCommand**: `TCommand2`\<[`TParsedHorizontalLineCommand`](/api/namespaces/util/type-aliases/tparsedhorizontallinecommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:128](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L128) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TLineCommand.md deleted file mode 100644 index 902f8eb5f..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TLineCommand" ---- - -> **TLineCommand**: `TCommand3`\<[`TParsedLineCommand`](/api/namespaces/util/type-aliases/tparsedlinecommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L120) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TMoveToCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TMoveToCommand.md deleted file mode 100644 index 3a39db6fc..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TMoveToCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TMoveToCommand" ---- - -> **TMoveToCommand**: `TCommand3`\<[`TParsedMoveToCommand`](/api/namespaces/util/type-aliases/tparsedmovetocommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:112](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L112) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteArcCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteArcCommand.md deleted file mode 100644 index 0b2a48e00..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteArcCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteArcCommand" ---- - -> **TParsedAbsoluteArcCommand**: [`"A"`, `number`, `number`, [`TRadian`](/api/type-aliases/tradian/), `0` \| `1`, `0` \| `1`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:228](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L228) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteClosePathCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteClosePathCommand.md deleted file mode 100644 index cadc1f022..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteClosePathCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteClosePathCommand" ---- - -> **TParsedAbsoluteClosePathCommand**: [`"Z"`] - -## Defined in - -[src/util/path/typedefs.ts:138](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L138) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveCommand.md deleted file mode 100644 index 0f919e62f..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteCubicCurveCommand" ---- - -> **TParsedAbsoluteCubicCurveCommand**: [`"C"`, `number`, `number`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:146](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L146) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md deleted file mode 100644 index 176a41b8b..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteCubicCurveShortcutCommand" ---- - -> **TParsedAbsoluteCubicCurveShortcutCommand**: [`"S"`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:170](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L170) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteHorizontalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteHorizontalLineCommand.md deleted file mode 100644 index cb73a18d3..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteHorizontalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteHorizontalLineCommand" ---- - -> **TParsedAbsoluteHorizontalLineCommand**: [`"H"`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:122](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L122) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteLineCommand.md deleted file mode 100644 index a44b2fc15..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteLineCommand" ---- - -> **TParsedAbsoluteLineCommand**: [`"L"`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:114](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L114) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteMoveToCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteMoveToCommand.md deleted file mode 100644 index 81dfac353..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteMoveToCommand.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteMoveToCommand" ---- - -> **TParsedAbsoluteMoveToCommand**: [`"M"`, `number`, `number`] - -Begin parsed SVG path commands -Read about commands at [https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths|MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths|MDN) - -## Defined in - -[src/util/path/typedefs.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L102) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md deleted file mode 100644 index 55b1d8d66..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteQuadraticCurveCommand" ---- - -> **TParsedAbsoluteQuadraticCurveCommand**: [`"Q"`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:191](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L191) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md deleted file mode 100644 index 6ab3935c9..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteQuadraticCurveShortcutCommand" ---- - -> **TParsedAbsoluteQuadraticCurveShortcutCommand**: [`"T"`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:211](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L211) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteVerticalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteVerticalLineCommand.md deleted file mode 100644 index d8994ea54..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedAbsoluteVerticalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedAbsoluteVerticalLineCommand" ---- - -> **TParsedAbsoluteVerticalLineCommand**: [`"V"`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L130) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedArcCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedArcCommand.md deleted file mode 100644 index a954c19b7..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedArcCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedArcCommand" ---- - -> **TParsedArcCommand**: [`TParsedAbsoluteArcCommand`](/api/namespaces/util/type-aliases/tparsedabsolutearccommand/) \| [`TParsedRelativeArcCommand`](/api/namespaces/util/type-aliases/tparsedrelativearccommand/) - -## Defined in - -[src/util/path/typedefs.ts:249](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L249) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedClosePathCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedClosePathCommand.md deleted file mode 100644 index 521adf043..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedClosePathCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedClosePathCommand" ---- - -> **TParsedClosePathCommand**: [`TParsedAbsoluteClosePathCommand`](/api/namespaces/util/type-aliases/tparsedabsoluteclosepathcommand/) \| [`TParsedRelativeClosePathCommand`](/api/namespaces/util/type-aliases/tparsedrelativeclosepathcommand/) - -## Defined in - -[src/util/path/typedefs.ts:140](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L140) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedCommand.md deleted file mode 100644 index f048fdf04..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedCommand.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedCommand" ---- - -> **TParsedCommand**: [`string`] \| [`string`, `number`] \| [`string`, `number`, `number`] \| [`string`, `number`, `number`, `number`] \| [`string`, `number`, `number`, `number`, `number`] \| [`string`, `number`, `number`, `number`, `number`, `number`] \| [`string`, `number`, `number`, `number`, `number`, `number`, `number`] \| [`string`, `number`, `number`, `number`, `number`, `number`, `number`, `number`] - -A parsed command of any length (even impossible ones) - -## Defined in - -[src/util/path/typedefs.ts:51](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L51) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveCommand.md deleted file mode 100644 index f64bb5282..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedCubicCurveCommand" ---- - -> **TParsedCubicCurveCommand**: [`TParsedAbsoluteCubicCurveCommand`](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurvecommand/) \| [`TParsedRelativeCubicCurveCommand`](/api/namespaces/util/type-aliases/tparsedrelativecubiccurvecommand/) - -## Defined in - -[src/util/path/typedefs.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L164) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveShortcutCommand.md deleted file mode 100644 index 83a86af98..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedCubicCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedCubicCurveShortcutCommand" ---- - -> **TParsedCubicCurveShortcutCommand**: [`TParsedAbsoluteCubicCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) \| [`TParsedRelativeCubicCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedrelativecubiccurveshortcutcommand/) - -## Defined in - -[src/util/path/typedefs.ts:184](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L184) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedHorizontalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedHorizontalLineCommand.md deleted file mode 100644 index 2671acf6e..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedHorizontalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedHorizontalLineCommand" ---- - -> **TParsedHorizontalLineCommand**: [`TParsedAbsoluteHorizontalLineCommand`](/api/namespaces/util/type-aliases/tparsedabsolutehorizontallinecommand/) \| [`TParsedRelativeHorizontalLineCommand`](/api/namespaces/util/type-aliases/tparsedrelativehorizontallinecommand/) - -## Defined in - -[src/util/path/typedefs.ts:124](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L124) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedLineCommand.md deleted file mode 100644 index 231b89a82..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedLineCommand" ---- - -> **TParsedLineCommand**: [`TParsedAbsoluteLineCommand`](/api/namespaces/util/type-aliases/tparsedabsolutelinecommand/) \| [`TParsedRelativeLineCommand`](/api/namespaces/util/type-aliases/tparsedrelativelinecommand/) - -## Defined in - -[src/util/path/typedefs.ts:116](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L116) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedMoveToCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedMoveToCommand.md deleted file mode 100644 index 1adf0d475..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedMoveToCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedMoveToCommand" ---- - -> **TParsedMoveToCommand**: [`TParsedAbsoluteMoveToCommand`](/api/namespaces/util/type-aliases/tparsedabsolutemovetocommand/) \| [`TParsedRelativeMoveToCommand`](/api/namespaces/util/type-aliases/tparsedrelativemovetocommand/) - -## Defined in - -[src/util/path/typedefs.ts:108](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L108) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveCommand.md deleted file mode 100644 index 48671893d..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedQuadraticCurveCommand" ---- - -> **TParsedQuadraticCurveCommand**: [`TParsedAbsoluteQuadraticCurveCommand`](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurvecommand/) \| [`TParsedRelativeQuadraticCurveCommand`](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurvecommand/) - -## Defined in - -[src/util/path/typedefs.ts:205](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L205) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveShortcutCommand.md deleted file mode 100644 index 080da43c3..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedQuadraticCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedQuadraticCurveShortcutCommand" ---- - -> **TParsedQuadraticCurveShortcutCommand**: [`TParsedAbsoluteQuadraticCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) \| [`TParsedRelativeQuadraticCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) - -## Defined in - -[src/util/path/typedefs.ts:221](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L221) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeArcCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeArcCommand.md deleted file mode 100644 index 0c65f1046..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeArcCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeArcCommand" ---- - -> **TParsedRelativeArcCommand**: [`"a"`, `number`, `number`, [`TRadian`](/api/type-aliases/tradian/), `0` \| `1`, `0` \| `1`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:238](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L238) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeClosePathCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeClosePathCommand.md deleted file mode 100644 index 5fb9ca26b..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeClosePathCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeClosePathCommand" ---- - -> **TParsedRelativeClosePathCommand**: [`"z"`] - -## Defined in - -[src/util/path/typedefs.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L139) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveCommand.md deleted file mode 100644 index a338be4c9..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeCubicCurveCommand" ---- - -> **TParsedRelativeCubicCurveCommand**: [`"c"`, `number`, `number`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:155](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L155) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md deleted file mode 100644 index 798c04452..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeCubicCurveShortcutCommand" ---- - -> **TParsedRelativeCubicCurveShortcutCommand**: [`"s"`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:177](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L177) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeHorizontalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeHorizontalLineCommand.md deleted file mode 100644 index 072193ca4..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeHorizontalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeHorizontalLineCommand" ---- - -> **TParsedRelativeHorizontalLineCommand**: [`"h"`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:123](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L123) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeLineCommand.md deleted file mode 100644 index 4a96fb7e2..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeLineCommand" ---- - -> **TParsedRelativeLineCommand**: [`"l"`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L115) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeMoveToCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeMoveToCommand.md deleted file mode 100644 index 860abd8be..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeMoveToCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeMoveToCommand" ---- - -> **TParsedRelativeMoveToCommand**: [`"m"`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:103](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L103) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveCommand.md deleted file mode 100644 index 3810a2228..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeQuadraticCurveCommand" ---- - -> **TParsedRelativeQuadraticCurveCommand**: [`"q"`, `number`, `number`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:198](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L198) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md deleted file mode 100644 index d8b33cfb7..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeQuadraticCurveShortcutCommand" ---- - -> **TParsedRelativeQuadraticCurveShortcutCommand**: [`"t"`, `number`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:216](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L216) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeVerticalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeVerticalLineCommand.md deleted file mode 100644 index 22d6ad9d7..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedRelativeVerticalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedRelativeVerticalLineCommand" ---- - -> **TParsedRelativeVerticalLineCommand**: [`"v"`, `number`] - -## Defined in - -[src/util/path/typedefs.ts:131](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L131) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TParsedVerticalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TParsedVerticalLineCommand.md deleted file mode 100644 index 29d882807..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TParsedVerticalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TParsedVerticalLineCommand" ---- - -> **TParsedVerticalLineCommand**: [`TParsedAbsoluteVerticalLineCommand`](/api/namespaces/util/type-aliases/tparsedabsoluteverticallinecommand/) \| [`TParsedRelativeVerticalLineCommand`](/api/namespaces/util/type-aliases/tparsedrelativeverticallinecommand/) - -## Defined in - -[src/util/path/typedefs.ts:132](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L132) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentCommandInfo.md b/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentCommandInfo.md deleted file mode 100644 index e7d4c4e51..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentCommandInfo.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TPathSegmentCommandInfo" ---- - -> **TPathSegmentCommandInfo**: `object` - -Relevant info to calculate path length/points on path -for each command type in a simplified parsed path - -## Type declaration - -### C - -> **C**: [`TCurveInfo`](/api/namespaces/util/type-aliases/tcurveinfo/)\<`"C"`\> - -### L - -> **L**: [`TPathSegmentInfoCommon`](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/)\<`"L"`\> - -### M - -> **M**: [`TPathSegmentInfoCommon`](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/)\<`"M"`\> - -### Q - -> **Q**: [`TCurveInfo`](/api/namespaces/util/type-aliases/tcurveinfo/)\<`"Q"`\> - -### Z - -> **Z**: [`TEndPathInfo`](/api/namespaces/util/type-aliases/tendpathinfo/) - -## Defined in - -[src/util/path/typedefs.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L37) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfo.md b/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfo.md deleted file mode 100644 index 4ca98cca3..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfo.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TPathSegmentInfo" ---- - -> **TPathSegmentInfo**: [`TPathSegmentCommandInfo`](/api/namespaces/util/type-aliases/tpathsegmentcommandinfo/)\[keyof [`TPathSegmentCommandInfo`](/api/namespaces/util/type-aliases/tpathsegmentcommandinfo/)\] - -## Defined in - -[src/util/path/typedefs.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L45) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfoCommon.md b/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfoCommon.md deleted file mode 100644 index 563c9d61d..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TPathSegmentInfoCommon.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TPathSegmentInfoCommon" ---- - -> **TPathSegmentInfoCommon**\<`C`\>: `object` - -## Type Parameters - -• **C** *extends* `string` - -## Type declaration - -### command? - -> `optional` **command**: `C` - -### length - -> **length**: `number` - -### x - -> **x**: `number` - -### y - -> **y**: `number` - -## Defined in - -[src/util/path/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L4) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TPointAngle.md b/src/content/docs/api/namespaces/util/type-aliases/TPointAngle.md deleted file mode 100644 index 7e094ef4e..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TPointAngle.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TPointAngle" ---- - -> **TPointAngle**: [`XY`](/api/interfaces/xy/) & `object` - -A point (vector) and angle between the vector and x-axis - -## Type declaration - -### angle - -> **angle**: [`TRadian`](/api/type-aliases/tradian/) - -## Defined in - -[src/util/path/typedefs.ts:326](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L326) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md b/src/content/docs/api/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md deleted file mode 100644 index 9ecd537b6..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TProjectStrokeOnPointsOptions.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TProjectStrokeOnPointsOptions" ---- - -> **TProjectStrokeOnPointsOptions**: `object` - -## Type declaration - -### scaleX - -> **scaleX**: `number` - -### scaleY - -> **scaleY**: `number` - -### skewX - -> **skewX**: [`TDegree`](/api/type-aliases/tdegree/) - -### skewY - -> **skewY**: [`TDegree`](/api/type-aliases/tdegree/) - -### strokeLineCap - -> **strokeLineCap**: `CanvasLineCap` - -### strokeLineJoin - -> **strokeLineJoin**: `CanvasLineJoin` - -### strokeMiterLimit - -> **strokeMiterLimit**: `number` - -https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit - -### strokeUniform - -> **strokeUniform**: `boolean` - -### strokeWidth - -> **strokeWidth**: `number` - -## Defined in - -[src/util/misc/projectStroke/types.ts:4](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/projectStroke/types.ts#L4) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TProjection.md b/src/content/docs/api/namespaces/util/type-aliases/TProjection.md deleted file mode 100644 index d1619e80c..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TProjection.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TProjection" ---- - -> **TProjection**: `object` - -## Type declaration - -### angle? - -> `optional` **angle**: [`TRadian`](/api/type-aliases/tradian/) - -### bisector? - -> `optional` **bisector**: [`Point`](/api/classes/point/) - -### originPoint - -> **originPoint**: [`Point`](/api/classes/point/) - -### projectedPoint - -> **projectedPoint**: [`Point`](/api/classes/point/) - -## Defined in - -[src/util/misc/projectStroke/types.ts:19](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/projectStroke/types.ts#L19) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TQrDecomposeOut.md b/src/content/docs/api/namespaces/util/type-aliases/TQrDecomposeOut.md deleted file mode 100644 index 04ca64f60..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TQrDecomposeOut.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TQrDecomposeOut" ---- - -> **TQrDecomposeOut**: `Required`\<`Omit`\<[`TComposeMatrixArgs`](/api/namespaces/util/type-aliases/tcomposematrixargs/), `"flipX"` \| `"flipY"`\>\> - -## Defined in - -[src/util/misc/matrix.ts:31](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L31) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveCommand.md deleted file mode 100644 index 9aa4d74c1..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TQuadraticCurveCommand" ---- - -> **TQuadraticCurveCommand**: `TCommand5`\<[`TParsedQuadraticCurveCommand`](/api/namespaces/util/type-aliases/tparsedquadraticcurvecommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:209](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L209) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveShortcutCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveShortcutCommand.md deleted file mode 100644 index 5b3017b8c..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TQuadraticCurveShortcutCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TQuadraticCurveShortcutCommand" ---- - -> **TQuadraticCurveShortcutCommand**: `TCommand3`\<[`TParsedQuadraticCurveShortcutCommand`](/api/namespaces/util/type-aliases/tparsedquadraticcurveshortcutcommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:225](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L225) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TRotateMatrixArgs.md b/src/content/docs/api/namespaces/util/type-aliases/TRotateMatrixArgs.md deleted file mode 100644 index 94e690c17..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TRotateMatrixArgs.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TRotateMatrixArgs" ---- - -> **TRotateMatrixArgs**: `object` - -## Type declaration - -### angle? - -> `optional` **angle**: [`TDegree`](/api/type-aliases/tdegree/) - -## Defined in - -[src/util/misc/matrix.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L9) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TScaleMatrixArgs.md b/src/content/docs/api/namespaces/util/type-aliases/TScaleMatrixArgs.md deleted file mode 100644 index 50e901b2f..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TScaleMatrixArgs.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TScaleMatrixArgs" ---- - -> **TScaleMatrixArgs**: `object` - -## Type declaration - -### flipX? - -> `optional` **flipX**: `boolean` - -### flipY? - -> `optional` **flipY**: `boolean` - -### scaleX? - -> `optional` **scaleX**: `number` - -### scaleY? - -> `optional` **scaleY**: `number` - -### skewX? - -> `optional` **skewX**: [`TDegree`](/api/type-aliases/tdegree/) - -### skewY? - -> `optional` **skewY**: [`TDegree`](/api/type-aliases/tdegree/) - -## Defined in - -[src/util/misc/matrix.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L18) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TSimpleParseCommandType.md b/src/content/docs/api/namespaces/util/type-aliases/TSimpleParseCommandType.md deleted file mode 100644 index 77f2e6b72..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TSimpleParseCommandType.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TSimpleParseCommandType" ---- - -> **TSimpleParseCommandType**: `"L"` \| `"M"` \| `"C"` \| `"Q"` \| `"Z"` - -## Defined in - -[src/util/path/typedefs.ts:294](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L294) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TSimpleParsedCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TSimpleParsedCommand.md deleted file mode 100644 index d246f964c..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TSimpleParsedCommand.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TSimpleParsedCommand" ---- - -> **TSimpleParsedCommand**: [`TParsedAbsoluteMoveToCommand`](/api/namespaces/util/type-aliases/tparsedabsolutemovetocommand/) \| [`TParsedAbsoluteLineCommand`](/api/namespaces/util/type-aliases/tparsedabsolutelinecommand/) \| [`TParsedAbsoluteClosePathCommand`](/api/namespaces/util/type-aliases/tparsedabsoluteclosepathcommand/) \| [`TParsedAbsoluteCubicCurveCommand`](/api/namespaces/util/type-aliases/tparsedabsolutecubiccurvecommand/) \| [`TParsedAbsoluteQuadraticCurveCommand`](/api/namespaces/util/type-aliases/tparsedabsolutequadraticcurvecommand/) - -Any SVG command that all Fabric functions can understand - -## Defined in - -[src/util/path/typedefs.ts:287](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L287) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TSimplePathData.md b/src/content/docs/api/namespaces/util/type-aliases/TSimplePathData.md deleted file mode 100644 index 0f0121dd6..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TSimplePathData.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TSimplePathData" ---- - -> **TSimplePathData**: [`TSimpleParsedCommand`](/api/namespaces/util/type-aliases/tsimpleparsedcommand/)[] - -A series of simple paths - -## Defined in - -[src/util/path/typedefs.ts:321](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L321) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TTranslateMatrixArgs.md b/src/content/docs/api/namespaces/util/type-aliases/TTranslateMatrixArgs.md deleted file mode 100644 index 9f80ca1e3..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TTranslateMatrixArgs.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TTranslateMatrixArgs" ---- - -> **TTranslateMatrixArgs**: `object` - -## Type declaration - -### translateX? - -> `optional` **translateX**: `number` - -### translateY? - -> `optional` **translateY**: `number` - -## Defined in - -[src/util/misc/matrix.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/matrix.ts#L13) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TVerticalLineCommand.md b/src/content/docs/api/namespaces/util/type-aliases/TVerticalLineCommand.md deleted file mode 100644 index a925670c0..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TVerticalLineCommand.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TVerticalLineCommand" ---- - -> **TVerticalLineCommand**: `TCommand2`\<[`TParsedVerticalLineCommand`](/api/namespaces/util/type-aliases/tparsedverticallinecommand/)\> - -## Defined in - -[src/util/path/typedefs.ts:136](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L136) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TextStyleArray.md b/src/content/docs/api/namespaces/util/type-aliases/TextStyleArray.md deleted file mode 100644 index 5fff57e53..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/TextStyleArray.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "TextStyleArray" ---- - -> **TextStyleArray**: `object`[] - -## Defined in - -[src/util/misc/textStyles.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/misc/textStyles.ts#L9) diff --git a/src/content/docs/api/namespaces/util/type-aliases/ValueAnimationOptions.md b/src/content/docs/api/namespaces/util/type-aliases/ValueAnimationOptions.md deleted file mode 100644 index 12905a7c2..000000000 --- a/src/content/docs/api/namespaces/util/type-aliases/ValueAnimationOptions.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -editUrl: false -next: false -prev: false -title: "ValueAnimationOptions" ---- - -> **ValueAnimationOptions**: [`TAnimationOptions`](/api/namespaces/util/type-aliases/tanimationoptions/)\<`number`\> - -## Defined in - -[src/util/animation/types.ts:121](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/types.ts#L121) diff --git a/src/content/docs/api/type-aliases/Abortable.md b/src/content/docs/api/type-aliases/Abortable.md index 25faa585a..a3e2bff3d 100644 --- a/src/content/docs/api/type-aliases/Abortable.md +++ b/src/content/docs/api/type-aliases/Abortable.md @@ -5,20 +5,20 @@ prev: false title: "Abortable" --- -> **Abortable**: `object` +> **Abortable** = `object` -## Type declaration +Defined in: [src/typedefs.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L124) + +## Properties ### signal? > `optional` **signal**: `AbortSignal` +Defined in: [src/typedefs.ts:129](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L129) + handle aborting #### See https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal - -## Defined in - -[src/typedefs.ts:118](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L118) diff --git a/src/content/docs/api/type-aliases/CanvasPointerEvents.md b/src/content/docs/api/type-aliases/CanvasPointerEvents.md index 1572decd9..6a96eb757 100644 --- a/src/content/docs/api/type-aliases/CanvasPointerEvents.md +++ b/src/content/docs/api/type-aliases/CanvasPointerEvents.md @@ -5,8 +5,6 @@ prev: false title: "CanvasPointerEvents" --- -> **CanvasPointerEvents**: `TPointerEvents`\<`"mouse:"`\> +> **CanvasPointerEvents** = `TPointerEvents`\<`"mouse:"`\> -## Defined in - -[src/EventTypeDefs.ts:284](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L284) +Defined in: [src/EventTypeDefs.ts:279](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L279) diff --git a/src/content/docs/api/type-aliases/CircleBrushPoint.md b/src/content/docs/api/type-aliases/CircleBrushPoint.md index 6c428dfe9..feb1146dd 100644 --- a/src/content/docs/api/type-aliases/CircleBrushPoint.md +++ b/src/content/docs/api/type-aliases/CircleBrushPoint.md @@ -5,26 +5,38 @@ prev: false title: "CircleBrushPoint" --- -> **CircleBrushPoint**: `object` +> **CircleBrushPoint** = `object` -## Type declaration +Defined in: [src/brushes/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L6) + +## Properties ### fill > **fill**: `string` +Defined in: [src/brushes/typedefs.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L10) + +*** + ### radius > **radius**: `number` +Defined in: [src/brushes/typedefs.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L9) + +*** + ### x > **x**: `number` +Defined in: [src/brushes/typedefs.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L7) + +*** + ### y > **y**: `number` -## Defined in - -[src/brushes/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/typedefs.ts#L6) +Defined in: [src/brushes/typedefs.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L8) diff --git a/src/content/docs/api/type-aliases/CollectionChangeLayoutContext.md b/src/content/docs/api/type-aliases/CollectionChangeLayoutContext.md index 681b11635..42dcf2f2e 100644 --- a/src/content/docs/api/type-aliases/CollectionChangeLayoutContext.md +++ b/src/content/docs/api/type-aliases/CollectionChangeLayoutContext.md @@ -5,9 +5,11 @@ prev: false title: "CollectionChangeLayoutContext" --- -> **CollectionChangeLayoutContext**: [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` +> **CollectionChangeLayoutContext** = [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L91) + +## Type Declaration ### targets @@ -16,7 +18,3 @@ title: "CollectionChangeLayoutContext" ### type > **type**: *typeof* `LAYOUT_TYPE_ADDED` \| *typeof* `LAYOUT_TYPE_REMOVED` - -## Defined in - -[src/LayoutManager/types.ts:91](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L91) diff --git a/src/content/docs/api/type-aliases/ColorStop.md b/src/content/docs/api/type-aliases/ColorStop.md index 6d3f0bf8a..190e9068e 100644 --- a/src/content/docs/api/type-aliases/ColorStop.md +++ b/src/content/docs/api/type-aliases/ColorStop.md @@ -5,22 +5,22 @@ prev: false title: "ColorStop" --- -> **ColorStop**: `object` +> **ColorStop** = `object` -## Type declaration +Defined in: [src/gradient/typedefs.ts:9](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L9) + +## Properties ### color > **color**: `string` -### offset - -> **offset**: `number` +Defined in: [src/gradient/typedefs.ts:10](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L10) -### opacity? +*** -> `optional` **opacity**: `number` +### offset -## Defined in +> **offset**: `number` -[src/gradient/typedefs.ts:9](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L9) +Defined in: [src/gradient/typedefs.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L11) diff --git a/src/content/docs/api/type-aliases/CommonLayoutContext.md b/src/content/docs/api/type-aliases/CommonLayoutContext.md index 916a089cb..c466af530 100644 --- a/src/content/docs/api/type-aliases/CommonLayoutContext.md +++ b/src/content/docs/api/type-aliases/CommonLayoutContext.md @@ -5,28 +5,40 @@ prev: false title: "CommonLayoutContext" --- -> **CommonLayoutContext**: `object` +> **CommonLayoutContext** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L74) + +## Properties ### path? > `optional` **path**: [`Group`](/api/classes/group/)[] +Defined in: [src/LayoutManager/types.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L81) + array of objects starting from the object that triggered the call to the current one +*** + ### strategy? > `optional` **strategy**: [`LayoutStrategy`](/api/classes/layoutstrategy/) +Defined in: [src/LayoutManager/types.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L76) + +*** + ### target > **target**: [`Group`](/api/classes/group/) +Defined in: [src/LayoutManager/types.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L75) + +*** + ### type > **type**: [`LayoutTrigger`](/api/type-aliases/layouttrigger/) -## Defined in - -[src/LayoutManager/types.ts:74](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L74) +Defined in: [src/LayoutManager/types.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L77) diff --git a/src/content/docs/api/type-aliases/CompleteTextStyleDeclaration.md b/src/content/docs/api/type-aliases/CompleteTextStyleDeclaration.md index c0f3d511f..30359244a 100644 --- a/src/content/docs/api/type-aliases/CompleteTextStyleDeclaration.md +++ b/src/content/docs/api/type-aliases/CompleteTextStyleDeclaration.md @@ -5,8 +5,6 @@ prev: false title: "CompleteTextStyleDeclaration" --- -> **CompleteTextStyleDeclaration**: `Pick`\<[`FabricText`](/api/classes/fabrictext/), `StylePropertiesType`\> +> **CompleteTextStyleDeclaration** = `Pick`\<[`FabricText`](/api/classes/fabrictext/), `StylePropertiesType`\> -## Defined in - -[src/shapes/Text/StyledText.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L11) +Defined in: [src/shapes/Text/StyledText.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L11) diff --git a/src/content/docs/api/type-aliases/Constructor.md b/src/content/docs/api/type-aliases/Constructor.md index 70815ed3c..ded18912b 100644 --- a/src/content/docs/api/type-aliases/Constructor.md +++ b/src/content/docs/api/type-aliases/Constructor.md @@ -5,20 +5,22 @@ prev: false title: "Constructor" --- -> **Constructor**\<`T`\>: (...`args`) => `T` +> **Constructor**\<`T`\> = (...`args`) => `T` + +Defined in: [src/typedefs.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L20) ## Type Parameters -• **T** = `object` +### T + +`T` = `object` ## Parameters -• ...**args**: `any`[] +### args + +...`any`[] ## Returns `T` - -## Defined in - -[src/typedefs.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L20) diff --git a/src/content/docs/api/type-aliases/ControlActionHandler.md b/src/content/docs/api/type-aliases/ControlActionHandler.md index 89da1aced..a04f9a59f 100644 --- a/src/content/docs/api/type-aliases/ControlActionHandler.md +++ b/src/content/docs/api/type-aliases/ControlActionHandler.md @@ -5,11 +5,9 @@ prev: false title: "ControlActionHandler" --- -> **ControlActionHandler**: [`TransformAction`](/api/type-aliases/transformaction/)\<[`Transform`](/api/type-aliases/transform/), `any`\> +> **ControlActionHandler** = [`TransformAction`](/api/type-aliases/transformaction/)\<[`Transform`](/api/type-aliases/transform/), `any`\> + +Defined in: [src/EventTypeDefs.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L53) Control handlers that run on control click/down/up Those handlers run with or without a transform defined - -## Defined in - -[src/EventTypeDefs.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L52) diff --git a/src/content/docs/api/type-aliases/ControlCallback.md b/src/content/docs/api/type-aliases/ControlCallback.md index 689618e82..df331baaa 100644 --- a/src/content/docs/api/type-aliases/ControlCallback.md +++ b/src/content/docs/api/type-aliases/ControlCallback.md @@ -5,24 +5,30 @@ prev: false title: "ControlCallback" --- -> **ControlCallback**\<`R`\>: (`eventData`, `control`, `fabricObject`) => `R` +> **ControlCallback**\<`R`\> = (`eventData`, `control`, `fabricObject`) => `R` + +Defined in: [src/EventTypeDefs.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L55) ## Type Parameters -• **R** = `void` +### R + +`R` = `void` ## Parameters -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### eventData -• **control**: [`Control`](/api/classes/control/) +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -• **fabricObject**: [`FabricObject`](/api/classes/fabricobject/) +### control -## Returns +[`Control`](/api/classes/control/) -`R` +### fabricObject -## Defined in +[`FabricObject`](/api/classes/fabricobject/) -[src/EventTypeDefs.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L54) +## Returns + +`R` diff --git a/src/content/docs/api/type-aliases/ControlCursorCallback.md b/src/content/docs/api/type-aliases/ControlCursorCallback.md index 11a0b1499..6b51fa0e2 100644 --- a/src/content/docs/api/type-aliases/ControlCursorCallback.md +++ b/src/content/docs/api/type-aliases/ControlCursorCallback.md @@ -5,8 +5,34 @@ prev: false title: "ControlCursorCallback" --- -> **ControlCursorCallback**: [`ControlCallback`](/api/type-aliases/controlcallback/)\<`string`\> +> **ControlCursorCallback**\<`R`\> = (`eventData`, `control`, `fabricObject`, `coord`) => `R` -## Defined in +Defined in: [src/EventTypeDefs.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L61) -[src/EventTypeDefs.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L60) +## Type Parameters + +### R + +`R` = `string` + +## Parameters + +### eventData + +[`TPointerEvent`](/api/type-aliases/tpointerevent/) + +### control + +[`Control`](/api/classes/control/) + +### fabricObject + +[`FabricObject`](/api/classes/fabricobject/) + +### coord + +`TOCoord` + +## Returns + +`R` diff --git a/src/content/docs/api/type-aliases/CursorBoundaries.md b/src/content/docs/api/type-aliases/CursorBoundaries.md index 30dcfca0f..cf44c6086 100644 --- a/src/content/docs/api/type-aliases/CursorBoundaries.md +++ b/src/content/docs/api/type-aliases/CursorBoundaries.md @@ -5,26 +5,38 @@ prev: false title: "CursorBoundaries" --- -> **CursorBoundaries**: `object` +> **CursorBoundaries** = `object` -## Type declaration +Defined in: [src/shapes/IText/IText.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L25) + +## Properties ### left > **left**: `number` +Defined in: [src/shapes/IText/IText.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L26) + +*** + ### leftOffset > **leftOffset**: `number` +Defined in: [src/shapes/IText/IText.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L28) + +*** + ### top > **top**: `number` +Defined in: [src/shapes/IText/IText.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L27) + +*** + ### topOffset > **topOffset**: `number` -## Defined in - -[src/shapes/IText/IText.ts:22](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L22) +Defined in: [src/shapes/IText/IText.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L29) diff --git a/src/content/docs/api/type-aliases/CursorRenderingData.md b/src/content/docs/api/type-aliases/CursorRenderingData.md index f2e06300a..806ddb3f1 100644 --- a/src/content/docs/api/type-aliases/CursorRenderingData.md +++ b/src/content/docs/api/type-aliases/CursorRenderingData.md @@ -5,34 +5,54 @@ prev: false title: "CursorRenderingData" --- -> **CursorRenderingData**: `object` +> **CursorRenderingData** = `object` -## Type declaration +Defined in: [src/shapes/IText/IText.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L32) + +## Properties ### color > **color**: `string` +Defined in: [src/shapes/IText/IText.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L33) + +*** + ### height > **height**: `number` +Defined in: [src/shapes/IText/IText.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L38) + +*** + ### left > **left**: `number` +Defined in: [src/shapes/IText/IText.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L35) + +*** + ### opacity > **opacity**: `number` +Defined in: [src/shapes/IText/IText.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L34) + +*** + ### top > **top**: `number` +Defined in: [src/shapes/IText/IText.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L36) + +*** + ### width > **width**: `number` -## Defined in - -[src/shapes/IText/IText.ts:29](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/IText.ts#L29) +Defined in: [src/shapes/IText/IText.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/IText.ts#L37) diff --git a/src/content/docs/api/type-aliases/DrawContext.md b/src/content/docs/api/type-aliases/DrawContext.md new file mode 100644 index 000000000..d917c723c --- /dev/null +++ b/src/content/docs/api/type-aliases/DrawContext.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "DrawContext" +--- + +> **DrawContext** = \{ `cacheTranslationX`: `number`; `cacheTranslationY`: `number`; `height`: `number`; `parentClipPaths`: [`BaseFabricObject`](/api/classes/basefabricobject/)[]; `width`: `number`; `zoomX`: `number`; `zoomY`: `number`; \} \| `Record`\<`string`, `never`\> + +Defined in: [src/shapes/Object/Object.ts:138](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/Object.ts#L138) + +Exported so we can tweak default values diff --git a/src/content/docs/api/type-aliases/GradientCoordValue.md b/src/content/docs/api/type-aliases/GradientCoordValue.md index 91566e59e..121b5752b 100644 --- a/src/content/docs/api/type-aliases/GradientCoordValue.md +++ b/src/content/docs/api/type-aliases/GradientCoordValue.md @@ -5,8 +5,6 @@ prev: false title: "GradientCoordValue" --- -> **GradientCoordValue**: `number` \| [`Percent`](/api/type-aliases/percent/) \| `string` +> **GradientCoordValue** = `number` \| [`Percent`](/api/type-aliases/percent/) \| `string` -## Defined in - -[src/gradient/typedefs.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L7) +Defined in: [src/gradient/typedefs.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L7) diff --git a/src/content/docs/api/type-aliases/GradientCoords.md b/src/content/docs/api/type-aliases/GradientCoords.md index 8d074c4f6..8c84e45c3 100644 --- a/src/content/docs/api/type-aliases/GradientCoords.md +++ b/src/content/docs/api/type-aliases/GradientCoords.md @@ -5,12 +5,12 @@ prev: false title: "GradientCoords" --- -> **GradientCoords**\<`T`\>: `T` *extends* `"linear"` ? [`LinearGradientCoords`](/api/type-aliases/lineargradientcoords/)\<`number`\> : [`RadialGradientCoords`](/api/type-aliases/radialgradientcoords/)\<`number`\> +> **GradientCoords**\<`T`\> = `T` *extends* `"linear"` ? [`LinearGradientCoords`](/api/type-aliases/lineargradientcoords/)\<`number`\> : [`RadialGradientCoords`](/api/type-aliases/radialgradientcoords/)\<`number`\> -## Type Parameters +Defined in: [src/gradient/typedefs.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L60) -• **T** *extends* [`GradientType`](/api/type-aliases/gradienttype/) +## Type Parameters -## Defined in +### T -[src/gradient/typedefs.ts:61](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L61) +`T` *extends* [`GradientType`](/api/type-aliases/gradienttype/) diff --git a/src/content/docs/api/type-aliases/GradientOptions.md b/src/content/docs/api/type-aliases/GradientOptions.md index 1888b14d7..04c7e6a66 100644 --- a/src/content/docs/api/type-aliases/GradientOptions.md +++ b/src/content/docs/api/type-aliases/GradientOptions.md @@ -5,54 +5,84 @@ prev: false title: "GradientOptions" --- -> **GradientOptions**\<`T`\>: `object` +> **GradientOptions**\<`T`\> = `object` + +Defined in: [src/gradient/typedefs.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L64) ## Type Parameters -• **T** *extends* [`GradientType`](/api/type-aliases/gradienttype/) +### T + +`T` *extends* [`GradientType`](/api/type-aliases/gradienttype/) -## Type declaration +## Properties ### colorStops? > `optional` **colorStops**: [`ColorStop`](/api/type-aliases/colorstop/)[] +Defined in: [src/gradient/typedefs.ts:67](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L67) + +*** + ### coords? > `optional` **coords**: `Partial`\<[`GradientCoords`](/api/type-aliases/gradientcoords/)\<`T`\>\> +Defined in: [src/gradient/typedefs.ts:68](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L68) + +*** + ### gradientTransform? > `optional` **gradientTransform**: [`TMat2D`](/api/type-aliases/tmat2d/) +Defined in: [src/gradient/typedefs.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L72) + #### Todo rename? +*** + ### gradientUnits? > `optional` **gradientUnits**: [`GradientUnits`](/api/type-aliases/gradientunits/) +Defined in: [src/gradient/typedefs.ts:66](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L66) + +*** + ### id? > `optional` **id**: `string` +Defined in: [src/gradient/typedefs.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L73) + +*** + ### offsetX? > `optional` **offsetX**: `number` +Defined in: [src/gradient/typedefs.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L77) + SVG import compatibility +*** + ### offsetY? > `optional` **offsetY**: `number` +Defined in: [src/gradient/typedefs.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L81) + SVG import compatibility +*** + ### type? > `optional` **type**: `T` -## Defined in - -[src/gradient/typedefs.ts:65](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L65) +Defined in: [src/gradient/typedefs.ts:65](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L65) diff --git a/src/content/docs/api/type-aliases/GradientType.md b/src/content/docs/api/type-aliases/GradientType.md index 65d24c1d3..b6d840292 100644 --- a/src/content/docs/api/type-aliases/GradientType.md +++ b/src/content/docs/api/type-aliases/GradientType.md @@ -5,8 +5,6 @@ prev: false title: "GradientType" --- -> **GradientType**: `"linear"` \| `"radial"` +> **GradientType** = `"linear"` \| `"radial"` -## Defined in - -[src/gradient/typedefs.ts:5](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L5) +Defined in: [src/gradient/typedefs.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L5) diff --git a/src/content/docs/api/type-aliases/GradientUnits.md b/src/content/docs/api/type-aliases/GradientUnits.md index b2d887985..cbfb24b5f 100644 --- a/src/content/docs/api/type-aliases/GradientUnits.md +++ b/src/content/docs/api/type-aliases/GradientUnits.md @@ -5,8 +5,6 @@ prev: false title: "GradientUnits" --- -> **GradientUnits**: `"pixels"` \| `"percentage"` +> **GradientUnits** = `"pixels"` \| `"percentage"` -## Defined in - -[src/gradient/typedefs.ts:3](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L3) +Defined in: [src/gradient/typedefs.ts:3](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L3) diff --git a/src/content/docs/api/type-aliases/GraphemeBBox.md b/src/content/docs/api/type-aliases/GraphemeBBox.md index 71ffd216b..4ab2f3ddc 100644 --- a/src/content/docs/api/type-aliases/GraphemeBBox.md +++ b/src/content/docs/api/type-aliases/GraphemeBBox.md @@ -5,46 +5,74 @@ prev: false title: "GraphemeBBox" --- -> **GraphemeBBox**: `object` +> **GraphemeBBox** = `object` + +Defined in: [src/shapes/Text/Text.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L85) Measure and return the info of a single grapheme. needs the the info of previous graphemes already filled Override to customize measuring -## Type declaration +## Properties ### angle? > `optional` **angle**: `number` +Defined in: [src/shapes/Text/Text.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L93) + +*** + ### deltaY > **deltaY**: `number` +Defined in: [src/shapes/Text/Text.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L90) + +*** + ### height > **height**: `number` +Defined in: [src/shapes/Text/Text.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L87) + +*** + ### kernedWidth > **kernedWidth**: `number` +Defined in: [src/shapes/Text/Text.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L88) + +*** + ### left > **left**: `number` +Defined in: [src/shapes/Text/Text.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L89) + +*** + ### renderLeft? > `optional` **renderLeft**: `number` +Defined in: [src/shapes/Text/Text.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L91) + +*** + ### renderTop? > `optional` **renderTop**: `number` +Defined in: [src/shapes/Text/Text.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L92) + +*** + ### width > **width**: `number` -## Defined in - -[src/shapes/Text/Text.ts:83](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L83) +Defined in: [src/shapes/Text/Text.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L86) diff --git a/src/content/docs/api/type-aliases/GraphemeData.md b/src/content/docs/api/type-aliases/GraphemeData.md index eeddba3d7..556cc3772 100644 --- a/src/content/docs/api/type-aliases/GraphemeData.md +++ b/src/content/docs/api/type-aliases/GraphemeData.md @@ -5,18 +5,22 @@ prev: false title: "GraphemeData" --- -> **GraphemeData**: `object` +> **GraphemeData** = `object` -## Type declaration +Defined in: [src/shapes/Textbox.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L24) + +## Properties ### largestWordWidth > **largestWordWidth**: `number` +Defined in: [src/shapes/Textbox.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L29) + +*** + ### wordsData > **wordsData**: `object`[][] -## Defined in - -[src/shapes/Textbox.ts:24](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Textbox.ts#L24) +Defined in: [src/shapes/Textbox.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Textbox.ts#L25) diff --git a/src/content/docs/api/type-aliases/ITextEvents.md b/src/content/docs/api/type-aliases/ITextEvents.md index f464ddc61..d63c4ae87 100644 --- a/src/content/docs/api/type-aliases/ITextEvents.md +++ b/src/content/docs/api/type-aliases/ITextEvents.md @@ -5,30 +5,24 @@ prev: false title: "ITextEvents" --- -> **ITextEvents**: [`ObjectEvents`](/api/interfaces/objectevents/) & `object` +> **ITextEvents** = [`ObjectEvents`](/api/interfaces/objectevents/) & `object` -## Type declaration +Defined in: [src/shapes/IText/ITextBehavior.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/IText/ITextBehavior.ts#L30) -### changed - -> **changed**: `never` \| `object` +## Type Declaration ### editing:entered -> **editing:entered**: `never` \| `object` +> **editing:entered**: `never` \| \{ `e`: [`TPointerEvent`](/api/type-aliases/tpointerevent/); \} ### editing:exited > **editing:exited**: `never` -### selection:changed - -> **selection:changed**: `never` - -### tripleclick +### changed -> **tripleclick**: [`TPointerEventInfo`](/api/interfaces/tpointereventinfo/) +> **changed**: `never` \| \{ `action`: `string`; `index`: `number`; \} -## Defined in +### selection:changed -[src/shapes/IText/ITextBehavior.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/IText/ITextBehavior.ts#L34) +> **selection:changed**: `never` diff --git a/src/content/docs/api/type-aliases/ImageFormat.md b/src/content/docs/api/type-aliases/ImageFormat.md index d2f742f09..1e6034249 100644 --- a/src/content/docs/api/type-aliases/ImageFormat.md +++ b/src/content/docs/api/type-aliases/ImageFormat.md @@ -5,8 +5,9 @@ prev: false title: "ImageFormat" --- -> **ImageFormat**: `"jpeg"` \| `"png"` +> **ImageFormat** = `"jpeg"` \| `"png"` \| `"webp"` -## Defined in +Defined in: [src/typedefs.ts:50](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L50) -[src/typedefs.ts:46](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L46) +In order to support webp on node canvas a workaround is needed and is shared here: +https://github.com/Automattic/node-canvas/issues/1258 diff --git a/src/content/docs/api/type-aliases/ImageSource.md b/src/content/docs/api/type-aliases/ImageSource.md index 279ade87d..8d4aa20de 100644 --- a/src/content/docs/api/type-aliases/ImageSource.md +++ b/src/content/docs/api/type-aliases/ImageSource.md @@ -5,8 +5,6 @@ prev: false title: "ImageSource" --- -> **ImageSource**: `HTMLImageElement` \| `HTMLVideoElement` \| `HTMLCanvasElement` +> **ImageSource** = `HTMLImageElement` \| `HTMLVideoElement` \| `HTMLCanvasElement` -## Defined in - -[src/shapes/Image.ts:37](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Image.ts#L37) +Defined in: [src/shapes/Image.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Image.ts#L37) diff --git a/src/content/docs/api/type-aliases/ImperativeLayoutContext.md b/src/content/docs/api/type-aliases/ImperativeLayoutContext.md index 3ef0841d2..a666e213f 100644 --- a/src/content/docs/api/type-aliases/ImperativeLayoutContext.md +++ b/src/content/docs/api/type-aliases/ImperativeLayoutContext.md @@ -5,14 +5,12 @@ prev: false title: "ImperativeLayoutContext" --- -> **ImperativeLayoutContext**: [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `ImperativeLayoutCommonOptions` & `object` +> **ImperativeLayoutContext** = [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `ImperativeLayoutCommonOptions` & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L115) + +## Type Declaration ### type > **type**: *typeof* `LAYOUT_TYPE_IMPERATIVE` - -## Defined in - -[src/LayoutManager/types.ts:115](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L115) diff --git a/src/content/docs/api/type-aliases/ImperativeLayoutOptions.md b/src/content/docs/api/type-aliases/ImperativeLayoutOptions.md index 4f141d224..183e8a807 100644 --- a/src/content/docs/api/type-aliases/ImperativeLayoutOptions.md +++ b/src/content/docs/api/type-aliases/ImperativeLayoutOptions.md @@ -5,14 +5,12 @@ prev: false title: "ImperativeLayoutOptions" --- -> **ImperativeLayoutOptions**: `ImperativeLayoutCommonOptions` & `object` +> **ImperativeLayoutOptions** = `ImperativeLayoutCommonOptions` & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L70) + +## Type Declaration ### strategy? > `optional` **strategy**: [`LayoutStrategy`](/api/classes/layoutstrategy/) - -## Defined in - -[src/LayoutManager/types.ts:70](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L70) diff --git a/src/content/docs/api/type-aliases/InitializationLayoutContext.md b/src/content/docs/api/type-aliases/InitializationLayoutContext.md index 5c683358a..056ed7401 100644 --- a/src/content/docs/api/type-aliases/InitializationLayoutContext.md +++ b/src/content/docs/api/type-aliases/InitializationLayoutContext.md @@ -5,9 +5,11 @@ prev: false title: "InitializationLayoutContext" --- -> **InitializationLayoutContext**: [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` +> **InitializationLayoutContext** = [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L84) + +## Type Declaration ### targets @@ -24,7 +26,3 @@ title: "InitializationLayoutContext" ### y? > `optional` **y**: `number` - -## Defined in - -[src/LayoutManager/types.ts:84](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L84) diff --git a/src/content/docs/api/type-aliases/IntersectionType.md b/src/content/docs/api/type-aliases/IntersectionType.md index 263639337..44efcf5d8 100644 --- a/src/content/docs/api/type-aliases/IntersectionType.md +++ b/src/content/docs/api/type-aliases/IntersectionType.md @@ -5,8 +5,6 @@ prev: false title: "IntersectionType" --- -> **IntersectionType**: `"Intersection"` \| `"Coincident"` \| `"Parallel"` +> **IntersectionType** = `"Intersection"` \| `"Coincident"` \| `"Parallel"` -## Defined in - -[src/Intersection.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Intersection.ts#L6) +Defined in: [src/Intersection.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Intersection.ts#L6) diff --git a/src/content/docs/api/type-aliases/LayoutAfterEvent.md b/src/content/docs/api/type-aliases/LayoutAfterEvent.md index 3153b3017..9119b24f8 100644 --- a/src/content/docs/api/type-aliases/LayoutAfterEvent.md +++ b/src/content/docs/api/type-aliases/LayoutAfterEvent.md @@ -5,20 +5,24 @@ prev: false title: "LayoutAfterEvent" --- -> **LayoutAfterEvent**: `object` +> **LayoutAfterEvent** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L143) + +## Properties ### context > **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) +Defined in: [src/LayoutManager/types.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L144) + +*** + ### result? > `optional` **result**: [`LayoutResult`](/api/type-aliases/layoutresult/) -will be undefined if layout was skipped - -## Defined in +Defined in: [src/LayoutManager/types.ts:148](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L148) -[src/LayoutManager/types.ts:143](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L143) +will be undefined if layout was skipped diff --git a/src/content/docs/api/type-aliases/LayoutBeforeEvent.md b/src/content/docs/api/type-aliases/LayoutBeforeEvent.md index 558e57760..a8652fb21 100644 --- a/src/content/docs/api/type-aliases/LayoutBeforeEvent.md +++ b/src/content/docs/api/type-aliases/LayoutBeforeEvent.md @@ -5,14 +5,14 @@ prev: false title: "LayoutBeforeEvent" --- -> **LayoutBeforeEvent**: `object` +> **LayoutBeforeEvent** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L139) + +## Properties ### context > **context**: [`StrictLayoutContext`](/api/type-aliases/strictlayoutcontext/) -## Defined in - -[src/LayoutManager/types.ts:139](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L139) +Defined in: [src/LayoutManager/types.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L140) diff --git a/src/content/docs/api/type-aliases/LayoutContext.md b/src/content/docs/api/type-aliases/LayoutContext.md index 6a8282d1b..02aa8a606 100644 --- a/src/content/docs/api/type-aliases/LayoutContext.md +++ b/src/content/docs/api/type-aliases/LayoutContext.md @@ -5,8 +5,6 @@ prev: false title: "LayoutContext" --- -> **LayoutContext**: [`InitializationLayoutContext`](/api/type-aliases/initializationlayoutcontext/) \| [`CollectionChangeLayoutContext`](/api/type-aliases/collectionchangelayoutcontext/) \| [`ObjectModifiedLayoutContext`](/api/type-aliases/objectmodifiedlayoutcontext/) \| [`ObjectModifyingLayoutContext`](/api/type-aliases/objectmodifyinglayoutcontext/) \| [`ImperativeLayoutContext`](/api/type-aliases/imperativelayoutcontext/) +> **LayoutContext** = [`InitializationLayoutContext`](/api/type-aliases/initializationlayoutcontext/) \| [`CollectionChangeLayoutContext`](/api/type-aliases/collectionchangelayoutcontext/) \| [`ObjectModifiedLayoutContext`](/api/type-aliases/objectmodifiedlayoutcontext/) \| [`ObjectModifyingLayoutContext`](/api/type-aliases/objectmodifyinglayoutcontext/) \| [`ImperativeLayoutContext`](/api/type-aliases/imperativelayoutcontext/) -## Defined in - -[src/LayoutManager/types.ts:120](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L120) +Defined in: [src/LayoutManager/types.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L120) diff --git a/src/content/docs/api/type-aliases/LayoutResult.md b/src/content/docs/api/type-aliases/LayoutResult.md index 1c35d002d..06bc2687f 100644 --- a/src/content/docs/api/type-aliases/LayoutResult.md +++ b/src/content/docs/api/type-aliases/LayoutResult.md @@ -5,28 +5,40 @@ prev: false title: "LayoutResult" --- -> **LayoutResult**: `object` +> **LayoutResult** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L54) + +## Properties ### nextCenter > **nextCenter**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L57) + +*** + ### offset > **offset**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:61](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L61) + The vector used to offset objects by, as measured by the plane +*** + ### prevCenter > **prevCenter**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L56) + +*** + ### result? > `optional` **result**: [`LayoutStrategyResult`](/api/type-aliases/layoutstrategyresult/) -## Defined in - -[src/LayoutManager/types.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L54) +Defined in: [src/LayoutManager/types.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L55) diff --git a/src/content/docs/api/type-aliases/LayoutStrategyResult.md b/src/content/docs/api/type-aliases/LayoutStrategyResult.md index 670fad47d..d1c5b5dcf 100644 --- a/src/content/docs/api/type-aliases/LayoutStrategyResult.md +++ b/src/content/docs/api/type-aliases/LayoutStrategyResult.md @@ -5,38 +5,50 @@ prev: false title: "LayoutStrategyResult" --- -> **LayoutStrategyResult**: `object` +> **LayoutStrategyResult** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L28) + +## Properties ### center > **center**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L32) + new center point as measured by the **containing** plane (same as `left` with `originX` set to `center`) +*** + ### correction? > `optional` **correction**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L41) + correction vector to translate objects by, measured in the same plane as `center` Since objects are measured relative to the group's center, once the group's size changes we must apply a correction to the objects' positions so that they relate to the new center. In other words, this value makes it possible to layout objects relative to the tl corner, for instance, but not only. +*** + ### relativeCorrection? > `optional` **relativeCorrection**: [`Point`](/api/classes/point/) +Defined in: [src/LayoutManager/types.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L46) + correction vector to translate objects by as measured by the plane +*** + ### size > **size**: [`Point`](/api/classes/point/) -new width and height of the layout target +Defined in: [src/LayoutManager/types.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L51) -## Defined in - -[src/LayoutManager/types.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L28) +new width and height of the layout target diff --git a/src/content/docs/api/type-aliases/LayoutTrigger.md b/src/content/docs/api/type-aliases/LayoutTrigger.md index 7a4598708..38e7c0621 100644 --- a/src/content/docs/api/type-aliases/LayoutTrigger.md +++ b/src/content/docs/api/type-aliases/LayoutTrigger.md @@ -5,8 +5,6 @@ prev: false title: "LayoutTrigger" --- -> **LayoutTrigger**: *typeof* `LAYOUT_TYPE_INITIALIZATION` \| *typeof* `LAYOUT_TYPE_OBJECT_MODIFYING` \| *typeof* `LAYOUT_TYPE_OBJECT_MODIFIED` \| *typeof* `LAYOUT_TYPE_ADDED` \| *typeof* `LAYOUT_TYPE_REMOVED` \| *typeof* `LAYOUT_TYPE_IMPERATIVE` +> **LayoutTrigger** = *typeof* `LAYOUT_TYPE_INITIALIZATION` \| *typeof* `LAYOUT_TYPE_OBJECT_MODIFYING` \| *typeof* `LAYOUT_TYPE_OBJECT_MODIFIED` \| *typeof* `LAYOUT_TYPE_ADDED` \| *typeof* `LAYOUT_TYPE_REMOVED` \| *typeof* `LAYOUT_TYPE_IMPERATIVE` -## Defined in - -[src/LayoutManager/types.ts:20](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L20) +Defined in: [src/LayoutManager/types.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L20) diff --git a/src/content/docs/api/type-aliases/LinearGradientCoords.md b/src/content/docs/api/type-aliases/LinearGradientCoords.md index 66bbc1809..6dbf20d07 100644 --- a/src/content/docs/api/type-aliases/LinearGradientCoords.md +++ b/src/content/docs/api/type-aliases/LinearGradientCoords.md @@ -5,38 +5,52 @@ prev: false title: "LinearGradientCoords" --- -> **LinearGradientCoords**\<`T`\>: `object` +> **LinearGradientCoords**\<`T`\> = `object` + +Defined in: [src/gradient/typedefs.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L14) ## Type Parameters -• **T** *extends* [`GradientCoordValue`](/api/type-aliases/gradientcoordvalue/) +### T + +`T` *extends* [`GradientCoordValue`](/api/type-aliases/gradientcoordvalue/) -## Type declaration +## Properties ### x1 > **x1**: `T` +Defined in: [src/gradient/typedefs.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L18) + X coordiante of the first point +*** + ### x2 > **x2**: `T` +Defined in: [src/gradient/typedefs.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L26) + X coordiante of the second point +*** + ### y1 > **y1**: `T` +Defined in: [src/gradient/typedefs.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L22) + Y coordiante of the first point +*** + ### y2 > **y2**: `T` -Y coordiante of the second point +Defined in: [src/gradient/typedefs.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L30) -## Defined in - -[src/gradient/typedefs.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L15) +Y coordiante of the second point diff --git a/src/content/docs/api/type-aliases/ModifierKey.md b/src/content/docs/api/type-aliases/ModifierKey.md index 308dcab4d..040376a2c 100644 --- a/src/content/docs/api/type-aliases/ModifierKey.md +++ b/src/content/docs/api/type-aliases/ModifierKey.md @@ -5,8 +5,6 @@ prev: false title: "ModifierKey" --- -> **ModifierKey**: keyof `Pick`\<`MouseEvent` \| `PointerEvent` \| `TouchEvent`, `"altKey"` \| `"shiftKey"` \| `"ctrlKey"` \| `"metaKey"`\> +> **ModifierKey** = keyof `Pick`\<`MouseEvent` \| `PointerEvent` \| `TouchEvent`, `"altKey"` \| `"shiftKey"` \| `"ctrlKey"` \| `"metaKey"`\> -## Defined in - -[src/EventTypeDefs.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L25) +Defined in: [src/EventTypeDefs.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L26) diff --git a/src/content/docs/api/type-aliases/MultiSelectionStacking.md b/src/content/docs/api/type-aliases/MultiSelectionStacking.md index 399f040fa..fd46e336e 100644 --- a/src/content/docs/api/type-aliases/MultiSelectionStacking.md +++ b/src/content/docs/api/type-aliases/MultiSelectionStacking.md @@ -5,8 +5,6 @@ prev: false title: "MultiSelectionStacking" --- -> **MultiSelectionStacking**: `"canvas-stacking"` \| `"selection-order"` +> **MultiSelectionStacking** = `"canvas-stacking"` \| `"selection-order"` -## Defined in - -[src/shapes/ActiveSelection.ts:14](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/ActiveSelection.ts#L14) +Defined in: [src/shapes/ActiveSelection.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/ActiveSelection.ts#L14) diff --git a/src/content/docs/api/type-aliases/ObjectModificationEvents.md b/src/content/docs/api/type-aliases/ObjectModificationEvents.md index 1ee7b8985..848d7dd7f 100644 --- a/src/content/docs/api/type-aliases/ObjectModificationEvents.md +++ b/src/content/docs/api/type-aliases/ObjectModificationEvents.md @@ -5,42 +5,74 @@ prev: false title: "ObjectModificationEvents" --- -> **ObjectModificationEvents**: `object` +> **ObjectModificationEvents** = `object` -## Type declaration +Defined in: [src/EventTypeDefs.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L139) + +## Extended by + +- [`ObjectEvents`](/api/interfaces/objectevents/) + +## Properties ### modified > **modified**: [`ModifiedEvent`](/api/interfaces/modifiedevent/) +Defined in: [src/EventTypeDefs.ts:147](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L147) + +*** + ### modifyPath > **modifyPath**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) & [`ModifyPathEvent`](/api/interfaces/modifypathevent/) +Defined in: [src/EventTypeDefs.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L146) + +*** + ### modifyPoly > **modifyPoly**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) +Defined in: [src/EventTypeDefs.ts:145](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L145) + +*** + ### moving > **moving**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) +Defined in: [src/EventTypeDefs.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L140) + +*** + ### resizing > **resizing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) +Defined in: [src/EventTypeDefs.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L144) + +*** + ### rotating > **rotating**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) +Defined in: [src/EventTypeDefs.ts:142](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L142) + +*** + ### scaling > **scaling**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) +Defined in: [src/EventTypeDefs.ts:141](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L141) + +*** + ### skewing > **skewing**: [`BasicTransformEvent`](/api/interfaces/basictransformevent/) -## Defined in - -[src/EventTypeDefs.ts:130](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L130) +Defined in: [src/EventTypeDefs.ts:143](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L143) diff --git a/src/content/docs/api/type-aliases/ObjectModifiedLayoutContext.md b/src/content/docs/api/type-aliases/ObjectModifiedLayoutContext.md index 5c146ddac..a97f4aa06 100644 --- a/src/content/docs/api/type-aliases/ObjectModifiedLayoutContext.md +++ b/src/content/docs/api/type-aliases/ObjectModifiedLayoutContext.md @@ -5,9 +5,11 @@ prev: false title: "ObjectModifiedLayoutContext" --- -> **ObjectModifiedLayoutContext**: [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` +> **ObjectModifiedLayoutContext** = [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L96) + +## Type Declaration ### e @@ -20,7 +22,3 @@ title: "ObjectModifiedLayoutContext" ### type > **type**: *typeof* `LAYOUT_TYPE_OBJECT_MODIFIED` - -## Defined in - -[src/LayoutManager/types.ts:96](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L96) diff --git a/src/content/docs/api/type-aliases/ObjectModifyingLayoutContext.md b/src/content/docs/api/type-aliases/ObjectModifyingLayoutContext.md index 1eace5560..621b720d2 100644 --- a/src/content/docs/api/type-aliases/ObjectModifyingLayoutContext.md +++ b/src/content/docs/api/type-aliases/ObjectModifyingLayoutContext.md @@ -5,14 +5,12 @@ prev: false title: "ObjectModifyingLayoutContext" --- -> **ObjectModifyingLayoutContext**: [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` & `object` \| `object` +> **ObjectModifyingLayoutContext** = [`CommonLayoutContext`](/api/type-aliases/commonlayoutcontext/) & `object` & \{ `e`: [`BasicTransformEvent`](/api/interfaces/basictransformevent/); `trigger`: [`TModificationEvents`](/api/type-aliases/tmodificationevents/); \} \| \{ `e`: [`ITextEvents`](/api/type-aliases/itextevents/)\[`"changed"`\]; `trigger`: `"changed"`; \} -## Type declaration +Defined in: [src/LayoutManager/types.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L102) + +## Type Declaration ### type > **type**: *typeof* `LAYOUT_TYPE_OBJECT_MODIFYING` - -## Defined in - -[src/LayoutManager/types.ts:102](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L102) diff --git a/src/content/docs/api/type-aliases/ObjectPointerEvents.md b/src/content/docs/api/type-aliases/ObjectPointerEvents.md index 2a13e58a3..8ef4db9a7 100644 --- a/src/content/docs/api/type-aliases/ObjectPointerEvents.md +++ b/src/content/docs/api/type-aliases/ObjectPointerEvents.md @@ -5,8 +5,6 @@ prev: false title: "ObjectPointerEvents" --- -> **ObjectPointerEvents**: `TPointerEvents`\<`"mouse"`\> +> **ObjectPointerEvents** = `TPointerEvents`\<`"mouse"`\> -## Defined in - -[src/EventTypeDefs.ts:283](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L283) +Defined in: [src/EventTypeDefs.ts:278](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L278) diff --git a/src/content/docs/api/type-aliases/PatternOptions.md b/src/content/docs/api/type-aliases/PatternOptions.md index 8d0d38919..b9ce7f83d 100644 --- a/src/content/docs/api/type-aliases/PatternOptions.md +++ b/src/content/docs/api/type-aliases/PatternOptions.md @@ -5,14 +5,12 @@ prev: false title: "PatternOptions" --- -> **PatternOptions**: `Partial`\<`Pick`\<[`Pattern`](/api/classes/pattern/), `ExportedKeys`\>\> & `object` +> **PatternOptions** = `Partial`\<`Pick`\<[`Pattern`](/api/classes/pattern/), `ExportedKeys`\>\> & `object` -## Type declaration +Defined in: [src/Pattern/types.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/types.ts#L13) + +## Type Declaration ### source > **source**: `CanvasImageSource` - -## Defined in - -[src/Pattern/types.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/types.ts#L13) diff --git a/src/content/docs/api/type-aliases/PatternRepeat.md b/src/content/docs/api/type-aliases/PatternRepeat.md index 047d4ae0e..408c450a7 100644 --- a/src/content/docs/api/type-aliases/PatternRepeat.md +++ b/src/content/docs/api/type-aliases/PatternRepeat.md @@ -5,8 +5,6 @@ prev: false title: "PatternRepeat" --- -> **PatternRepeat**: `"repeat"` \| `"repeat-x"` \| `"repeat-y"` \| `"no-repeat"` +> **PatternRepeat** = `"repeat"` \| `"repeat-x"` \| `"repeat-y"` \| `"no-repeat"` -## Defined in - -[src/Pattern/types.ts:3](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/types.ts#L3) +Defined in: [src/Pattern/types.ts:3](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/types.ts#L3) diff --git a/src/content/docs/api/type-aliases/Percent.md b/src/content/docs/api/type-aliases/Percent.md index 5e9bebae6..224cf4699 100644 --- a/src/content/docs/api/type-aliases/Percent.md +++ b/src/content/docs/api/type-aliases/Percent.md @@ -5,8 +5,6 @@ prev: false title: "Percent" --- -> **Percent**: \`$\{number\}%\` +> **Percent** = `` `${number}%` `` -## Defined in - -[src/typedefs.ts:44](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L44) +Defined in: [src/typedefs.ts:44](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L44) diff --git a/src/content/docs/api/type-aliases/RadialGradientCoords.md b/src/content/docs/api/type-aliases/RadialGradientCoords.md index 6b9bb1eeb..3ce8e48ef 100644 --- a/src/content/docs/api/type-aliases/RadialGradientCoords.md +++ b/src/content/docs/api/type-aliases/RadialGradientCoords.md @@ -5,50 +5,72 @@ prev: false title: "RadialGradientCoords" --- -> **RadialGradientCoords**\<`T`\>: `object` +> **RadialGradientCoords**\<`T`\> = `object` + +Defined in: [src/gradient/typedefs.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L33) ## Type Parameters -• **T** *extends* [`GradientCoordValue`](/api/type-aliases/gradientcoordvalue/) +### T + +`T` *extends* [`GradientCoordValue`](/api/type-aliases/gradientcoordvalue/) -## Type declaration +## Properties ### r1 > **r1**: `T` +Defined in: [src/gradient/typedefs.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L53) + radius of the inner circle +*** + ### r2 > **r2**: `T` +Defined in: [src/gradient/typedefs.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L57) + radius of the outer circle +*** + ### x1 > **x1**: `T` +Defined in: [src/gradient/typedefs.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L37) + X coordinate of the first focal point +*** + ### x2 > **x2**: `T` +Defined in: [src/gradient/typedefs.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L45) + X coordiante of the second focal point +*** + ### y1 > **y1**: `T` +Defined in: [src/gradient/typedefs.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L41) + Y coordiante of the first focal point +*** + ### y2 > **y2**: `T` -Y coordiante of the second focal point - -## Defined in +Defined in: [src/gradient/typedefs.ts:49](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L49) -[src/gradient/typedefs.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L34) +Y coordiante of the second focal point diff --git a/src/content/docs/api/type-aliases/RegistrationContext.md b/src/content/docs/api/type-aliases/RegistrationContext.md index fbb4b25c9..b6f25b60f 100644 --- a/src/content/docs/api/type-aliases/RegistrationContext.md +++ b/src/content/docs/api/type-aliases/RegistrationContext.md @@ -5,18 +5,22 @@ prev: false title: "RegistrationContext" --- -> **RegistrationContext**: `object` +> **RegistrationContext** = `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:134](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L134) + +## Properties ### target > **target**: [`Group`](/api/classes/group/) +Defined in: [src/LayoutManager/types.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L136) + +*** + ### targets > **targets**: [`FabricObject`](/api/classes/fabricobject/)[] -## Defined in - -[src/LayoutManager/types.ts:134](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L134) +Defined in: [src/LayoutManager/types.ts:135](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L135) diff --git a/src/content/docs/api/type-aliases/SVGElementName.md b/src/content/docs/api/type-aliases/SVGElementName.md index 53eb17dc9..e455a9856 100644 --- a/src/content/docs/api/type-aliases/SVGElementName.md +++ b/src/content/docs/api/type-aliases/SVGElementName.md @@ -5,8 +5,6 @@ prev: false title: "SVGElementName" --- -> **SVGElementName**: `"linearGradient"` \| `"radialGradient"` \| `"stop"` +> **SVGElementName** = `"linearGradient"` \| `"radialGradient"` \| `"stop"` -## Defined in - -[src/typedefs.ts:48](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L48) +Defined in: [src/typedefs.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L52) diff --git a/src/content/docs/api/type-aliases/SVGOptions.md b/src/content/docs/api/type-aliases/SVGOptions.md index 062f16feb..6c9970440 100644 --- a/src/content/docs/api/type-aliases/SVGOptions.md +++ b/src/content/docs/api/type-aliases/SVGOptions.md @@ -5,38 +5,54 @@ prev: false title: "SVGOptions" --- -> **SVGOptions**: `object` +> **SVGOptions** = `object` -## Type declaration +Defined in: [src/gradient/typedefs.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L84) + +## Properties ### height > **height**: `number` +Defined in: [src/gradient/typedefs.ts:100](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L100) + height part of the svg tag if viewBox is not specified +*** + ### opacity > **opacity**: `string` \| `null` +Defined in: [src/gradient/typedefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L102) + +*** + ### viewBoxHeight > **viewBoxHeight**: `number` +Defined in: [src/gradient/typedefs.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L92) + height part of the viewBox attribute on svg +*** + ### viewBoxWidth > **viewBoxWidth**: `number` +Defined in: [src/gradient/typedefs.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L88) + width part of the viewBox attribute on svg +*** + ### width > **width**: `number` -width part of the svg tag if viewBox is not specified - -## Defined in +Defined in: [src/gradient/typedefs.ts:96](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L96) -[src/gradient/typedefs.ts:85](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/gradient/typedefs.ts#L85) +width part of the svg tag if viewBox is not specified diff --git a/src/content/docs/api/type-aliases/SerializedGradientProps.md b/src/content/docs/api/type-aliases/SerializedGradientProps.md new file mode 100644 index 000000000..87788f427 --- /dev/null +++ b/src/content/docs/api/type-aliases/SerializedGradientProps.md @@ -0,0 +1,16 @@ +--- +editUrl: false +next: false +prev: false +title: "SerializedGradientProps" +--- + +> **SerializedGradientProps**\<`T`\> = `Omit`\<[`GradientOptions`](/api/type-aliases/gradientoptions/)\<`T`\>, `"id"`\> + +Defined in: [src/gradient/typedefs.ts:105](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/gradient/typedefs.ts#L105) + +## Type Parameters + +### T + +`T` *extends* [`GradientType`](/api/type-aliases/gradienttype/) diff --git a/src/content/docs/api/type-aliases/SerializedLayoutManager.md b/src/content/docs/api/type-aliases/SerializedLayoutManager.md index 90170cdb5..c5ced8f7f 100644 --- a/src/content/docs/api/type-aliases/SerializedLayoutManager.md +++ b/src/content/docs/api/type-aliases/SerializedLayoutManager.md @@ -5,18 +5,22 @@ prev: false title: "SerializedLayoutManager" --- -> **SerializedLayoutManager**: `object` +> **SerializedLayoutManager** = `object` -## Type declaration +Defined in: [src/LayoutManager/LayoutManager.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L40) + +## Properties ### strategy > **strategy**: `string` +Defined in: [src/LayoutManager/LayoutManager.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L42) + +*** + ### type > **type**: `string` -## Defined in - -[src/LayoutManager/LayoutManager.ts:40](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/LayoutManager.ts#L40) +Defined in: [src/LayoutManager/LayoutManager.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/LayoutManager.ts#L41) diff --git a/src/content/docs/api/type-aliases/SerializedPatternOptions.md b/src/content/docs/api/type-aliases/SerializedPatternOptions.md index 4d7741f92..9e1f79163 100644 --- a/src/content/docs/api/type-aliases/SerializedPatternOptions.md +++ b/src/content/docs/api/type-aliases/SerializedPatternOptions.md @@ -5,9 +5,11 @@ prev: false title: "SerializedPatternOptions" --- -> **SerializedPatternOptions**: `Omit`\<[`PatternOptions`](/api/type-aliases/patternoptions/), `"source"`\> & `object` +> **SerializedPatternOptions** = `Omit`\<[`PatternOptions`](/api/type-aliases/patternoptions/), `"source"`\> & `object` -## Type declaration +Defined in: [src/Pattern/types.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Pattern/types.ts#L17) + +## Type Declaration ### source @@ -16,7 +18,3 @@ title: "SerializedPatternOptions" ### type > **type**: `"pattern"` - -## Defined in - -[src/Pattern/types.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Pattern/types.ts#L17) diff --git a/src/content/docs/api/type-aliases/SerializedShadowOptions.md b/src/content/docs/api/type-aliases/SerializedShadowOptions.md index e1ff3c0f8..0ee43dea8 100644 --- a/src/content/docs/api/type-aliases/SerializedShadowOptions.md +++ b/src/content/docs/api/type-aliases/SerializedShadowOptions.md @@ -5,38 +5,62 @@ prev: false title: "SerializedShadowOptions" --- -> **SerializedShadowOptions**: `object` +> **SerializedShadowOptions** = `object` -## Type declaration +Defined in: [src/Shadow.ts:53](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L53) + +## Properties ### affectStroke > **affectStroke**: `boolean` +Defined in: [src/Shadow.ts:58](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L58) + +*** + ### blur > **blur**: `number` +Defined in: [src/Shadow.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L55) + +*** + ### color > **color**: `string` +Defined in: [src/Shadow.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L54) + +*** + ### nonScaling > **nonScaling**: `boolean` +Defined in: [src/Shadow.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L59) + +*** + ### offsetX > **offsetX**: `number` +Defined in: [src/Shadow.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L56) + +*** + ### offsetY > **offsetY**: `number` +Defined in: [src/Shadow.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L57) + +*** + ### type > **type**: `string` -## Defined in - -[src/Shadow.ts:53](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/Shadow.ts#L53) +Defined in: [src/Shadow.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/Shadow.ts#L60) diff --git a/src/content/docs/api/type-aliases/SprayBrushPoint.md b/src/content/docs/api/type-aliases/SprayBrushPoint.md index 7b9b9f633..e6c63d49f 100644 --- a/src/content/docs/api/type-aliases/SprayBrushPoint.md +++ b/src/content/docs/api/type-aliases/SprayBrushPoint.md @@ -5,26 +5,38 @@ prev: false title: "SprayBrushPoint" --- -> **SprayBrushPoint**: `object` +> **SprayBrushPoint** = `object` -## Type declaration +Defined in: [src/brushes/typedefs.ts:13](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L13) + +## Properties ### opacity > **opacity**: `number` +Defined in: [src/brushes/typedefs.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L17) + +*** + ### width > **width**: `number` +Defined in: [src/brushes/typedefs.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L16) + +*** + ### x > **x**: `number` +Defined in: [src/brushes/typedefs.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L14) + +*** + ### y > **y**: `number` -## Defined in - -[src/brushes/typedefs.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/typedefs.ts#L13) +Defined in: [src/brushes/typedefs.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L15) diff --git a/src/content/docs/api/type-aliases/StrictLayoutContext.md b/src/content/docs/api/type-aliases/StrictLayoutContext.md index 9f951b500..18a2bb1a5 100644 --- a/src/content/docs/api/type-aliases/StrictLayoutContext.md +++ b/src/content/docs/api/type-aliases/StrictLayoutContext.md @@ -5,9 +5,11 @@ prev: false title: "StrictLayoutContext" --- -> **StrictLayoutContext**: [`LayoutContext`](/api/type-aliases/layoutcontext/) & `object` +> **StrictLayoutContext** = [`LayoutContext`](/api/type-aliases/layoutcontext/) & `object` -## Type declaration +Defined in: [src/LayoutManager/types.ts:127](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/LayoutManager/types.ts#L127) + +## Type Declaration ### bubbles @@ -23,10 +25,8 @@ title: "StrictLayoutContext" ### stopPropagation() +> **stopPropagation**(): `void` + #### Returns `void` - -## Defined in - -[src/LayoutManager/types.ts:127](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/LayoutManager/types.ts#L127) diff --git a/src/content/docs/api/type-aliases/SupportedSVGUnit.md b/src/content/docs/api/type-aliases/SupportedSVGUnit.md index d31fb6a67..918d39d8e 100644 --- a/src/content/docs/api/type-aliases/SupportedSVGUnit.md +++ b/src/content/docs/api/type-aliases/SupportedSVGUnit.md @@ -5,8 +5,6 @@ prev: false title: "SupportedSVGUnit" --- -> **SupportedSVGUnit**: `"mm"` \| `"cm"` \| `"in"` \| `"pt"` \| `"pc"` \| `"em"` +> **SupportedSVGUnit** = `"mm"` \| `"cm"` \| `"in"` \| `"pt"` \| `"pc"` \| `"em"` -## Defined in - -[src/typedefs.ts:50](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L50) +Defined in: [src/typedefs.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L54) diff --git a/src/content/docs/api/type-aliases/T2DPipelineState.md b/src/content/docs/api/type-aliases/T2DPipelineState.md index 653e2a211..bc95b29a0 100644 --- a/src/content/docs/api/type-aliases/T2DPipelineState.md +++ b/src/content/docs/api/type-aliases/T2DPipelineState.md @@ -5,46 +5,78 @@ prev: false title: "T2DPipelineState" --- -> **T2DPipelineState**: `object` +> **T2DPipelineState** = `object` -## Type declaration +Defined in: [src/filters/typedefs.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L35) + +## Properties ### canvasEl > **canvasEl**: `HTMLCanvasElement` +Defined in: [src/filters/typedefs.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L39) + +*** + ### ctx > **ctx**: `CanvasRenderingContext2D` +Defined in: [src/filters/typedefs.ts:43](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L43) + +*** + ### filterBackend > **filterBackend**: [`Canvas2dFilterBackend`](/api/classes/canvas2dfilterbackend/) +Defined in: [src/filters/typedefs.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L38) + +*** + ### helpLayer? > `optional` **helpLayer**: `HTMLCanvasElement` +Defined in: [src/filters/typedefs.ts:44](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L44) + +*** + ### imageData > **imageData**: `ImageData` +Defined in: [src/filters/typedefs.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L40) + +*** + ### originalEl > **originalEl**: `CanvasImageSource` +Defined in: [src/filters/typedefs.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L41) + +*** + ### originalImageData? > `optional` **originalImageData**: `ImageData` +Defined in: [src/filters/typedefs.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L42) + +*** + ### sourceHeight > **sourceHeight**: `number` +Defined in: [src/filters/typedefs.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L37) + +*** + ### sourceWidth > **sourceWidth**: `number` -## Defined in - -[src/filters/typedefs.ts:35](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L35) +Defined in: [src/filters/typedefs.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L36) diff --git a/src/content/docs/api/type-aliases/TArcCommand.md b/src/content/docs/api/type-aliases/TArcCommand.md new file mode 100644 index 000000000..ece776adc --- /dev/null +++ b/src/content/docs/api/type-aliases/TArcCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TArcCommand" +--- + +> **TArcCommand** = `TCommand8`\<[`TParsedArcCommand`](/api/type-aliases/tparsedarccommand/)\> \| [`TArcCommandSingleFlag`](/api/type-aliases/tarccommandsingleflag/)\<[`TParsedArcCommand`](/api/type-aliases/tparsedarccommand/)\> + +Defined in: [src/util/path/typedefs.ts:255](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L255) diff --git a/src/content/docs/api/type-aliases/TArcCommandSingleFlag.md b/src/content/docs/api/type-aliases/TArcCommandSingleFlag.md new file mode 100644 index 000000000..ad0be8b60 --- /dev/null +++ b/src/content/docs/api/type-aliases/TArcCommandSingleFlag.md @@ -0,0 +1,16 @@ +--- +editUrl: false +next: false +prev: false +title: "TArcCommandSingleFlag" +--- + +> **TArcCommandSingleFlag**\<`T`\> = `` `${T[0]} ${T[1]} ${T[2]} ${T[3]} ${T[4]}${T[5]} ${T[6]} ${T[7]}` `` + +Defined in: [src/util/path/typedefs.ts:253](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L253) + +## Type Parameters + +### T + +`T` *extends* [`TParsedArcCommand`](/api/type-aliases/tparsedarccommand/) diff --git a/src/content/docs/api/type-aliases/TAxis.md b/src/content/docs/api/type-aliases/TAxis.md index b310a01d9..74d2efc5d 100644 --- a/src/content/docs/api/type-aliases/TAxis.md +++ b/src/content/docs/api/type-aliases/TAxis.md @@ -5,8 +5,6 @@ prev: false title: "TAxis" --- -> **TAxis**: `"x"` \| `"y"` +> **TAxis** = `"x"` \| `"y"` -## Defined in - -[src/typedefs.ts:28](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L28) +Defined in: [src/typedefs.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L28) diff --git a/src/content/docs/api/type-aliases/TAxisKey.md b/src/content/docs/api/type-aliases/TAxisKey.md index a1905c756..ffb7592c6 100644 --- a/src/content/docs/api/type-aliases/TAxisKey.md +++ b/src/content/docs/api/type-aliases/TAxisKey.md @@ -5,12 +5,12 @@ prev: false title: "TAxisKey" --- -> **TAxisKey**\<`T`\>: \`$\{T\}$\{Capitalize\\}\` +> **TAxisKey**\<`T`\> = `` `${T}${Capitalize}` `` -## Type Parameters +Defined in: [src/typedefs.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L30) -• **T** *extends* `string` +## Type Parameters -## Defined in +### T -[src/typedefs.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L30) +`T` *extends* `string` diff --git a/src/content/docs/api/type-aliases/TBBox.md b/src/content/docs/api/type-aliases/TBBox.md index 744b842e6..93b89f867 100644 --- a/src/content/docs/api/type-aliases/TBBox.md +++ b/src/content/docs/api/type-aliases/TBBox.md @@ -5,9 +5,11 @@ prev: false title: "TBBox" --- -> **TBBox**: `object` & [`TSize`](/api/type-aliases/tsize/) +> **TBBox** = `object` & [`TSize`](/api/type-aliases/tsize/) -## Type declaration +Defined in: [src/typedefs.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L39) + +## Type Declaration ### left @@ -16,7 +18,3 @@ title: "TBBox" ### top > **top**: `number` - -## Defined in - -[src/typedefs.ts:39](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L39) diff --git a/src/content/docs/api/type-aliases/TBrushEventData.md b/src/content/docs/api/type-aliases/TBrushEventData.md index 374c2b797..f23e2dbc9 100644 --- a/src/content/docs/api/type-aliases/TBrushEventData.md +++ b/src/content/docs/api/type-aliases/TBrushEventData.md @@ -5,14 +5,12 @@ prev: false title: "TBrushEventData" --- -> **TBrushEventData**: [`TEvent`](/api/interfaces/tevent/) & `object` +> **TBrushEventData** = [`TEvent`](/api/interfaces/tevent/) & `object` -## Type declaration +Defined in: [src/brushes/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/brushes/typedefs.ts#L4) + +## Type Declaration ### pointer > **pointer**: [`Point`](/api/classes/point/) - -## Defined in - -[src/brushes/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/brushes/typedefs.ts#L4) diff --git a/src/content/docs/api/type-aliases/TCacheCanvasDimensions.md b/src/content/docs/api/type-aliases/TCacheCanvasDimensions.md index 6e57f59f4..1af2cf09e 100644 --- a/src/content/docs/api/type-aliases/TCacheCanvasDimensions.md +++ b/src/content/docs/api/type-aliases/TCacheCanvasDimensions.md @@ -5,17 +5,11 @@ prev: false title: "TCacheCanvasDimensions" --- -> **TCacheCanvasDimensions**: `object` +> **TCacheCanvasDimensions** = [`TSize`](/api/type-aliases/tsize/) & `object` -## Type declaration +Defined in: [src/typedefs.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L93) -### height - -> **height**: `number` - -### width - -> **width**: `number` +## Type Declaration ### x @@ -32,7 +26,3 @@ title: "TCacheCanvasDimensions" ### zoomY > **zoomY**: `number` - -## Defined in - -[src/typedefs.ts:89](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L89) diff --git a/src/content/docs/api/type-aliases/TCanvasSizeOptions.md b/src/content/docs/api/type-aliases/TCanvasSizeOptions.md index 9d0ee1a22..ad661b84b 100644 --- a/src/content/docs/api/type-aliases/TCanvasSizeOptions.md +++ b/src/content/docs/api/type-aliases/TCanvasSizeOptions.md @@ -5,11 +5,9 @@ prev: false title: "TCanvasSizeOptions" --- -> **TCanvasSizeOptions**: `object` \| `object` +> **TCanvasSizeOptions** = \{ `backstoreOnly?`: `true`; `cssOnly?`: `false`; \} \| \{ `backstoreOnly?`: `false`; `cssOnly?`: `true`; \} + +Defined in: [src/canvas/StaticCanvas.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L52) Having both options in TCanvasSizeOptions set to true transform the call in a calcOffset Better try to restrict with types to avoid confusion. - -## Defined in - -[src/canvas/StaticCanvas.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L52) diff --git a/src/content/docs/api/type-aliases/TClassProperties.md b/src/content/docs/api/type-aliases/TClassProperties.md index 0074d52ec..0d54df6d2 100644 --- a/src/content/docs/api/type-aliases/TClassProperties.md +++ b/src/content/docs/api/type-aliases/TClassProperties.md @@ -5,12 +5,12 @@ prev: false title: "TClassProperties" --- -> **TClassProperties**\<`T`\>: `Pick`\<`T`, `TNonFunctionPropertyNames`\<`T`\>\> +> **TClassProperties**\<`T`\> = `Pick`\<`T`, `TNonFunctionPropertyNames`\<`T`\>\> -## Type Parameters +Defined in: [src/typedefs.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L17) -• **T** +## Type Parameters -## Defined in +### T -[src/typedefs.ts:17](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L17) +`T` diff --git a/src/content/docs/api/type-aliases/TClosePathCommand.md b/src/content/docs/api/type-aliases/TClosePathCommand.md new file mode 100644 index 000000000..38f84efe7 --- /dev/null +++ b/src/content/docs/api/type-aliases/TClosePathCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TClosePathCommand" +--- + +> **TClosePathCommand** = `TCommand1`\<[`TParsedClosePathCommand`](/api/type-aliases/tparsedclosepathcommand/)\> + +Defined in: [src/util/path/typedefs.ts:144](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L144) diff --git a/src/content/docs/api/type-aliases/TColorArg.md b/src/content/docs/api/type-aliases/TColorArg.md index ea3333249..543306471 100644 --- a/src/content/docs/api/type-aliases/TColorArg.md +++ b/src/content/docs/api/type-aliases/TColorArg.md @@ -5,8 +5,6 @@ prev: false title: "TColorArg" --- -> **TColorArg**: `string` \| [`TRGBColorSource`](/api/type-aliases/trgbcolorsource/) \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/) \| [`Color`](/api/classes/color/) +> **TColorArg** = `string` \| [`TRGBColorSource`](/api/type-aliases/trgbcolorsource/) \| [`TRGBAColorSource`](/api/type-aliases/trgbacolorsource/) \| [`Color`](/api/classes/color/) -## Defined in - -[src/color/typedefs.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/typedefs.ts#L18) +Defined in: [src/color/typedefs.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/typedefs.ts#L18) diff --git a/src/content/docs/api/type-aliases/TComplexParsedCommand.md b/src/content/docs/api/type-aliases/TComplexParsedCommand.md new file mode 100644 index 000000000..980a2b087 --- /dev/null +++ b/src/content/docs/api/type-aliases/TComplexParsedCommand.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "TComplexParsedCommand" +--- + +> **TComplexParsedCommand** = [`TParsedMoveToCommand`](/api/type-aliases/tparsedmovetocommand/) \| [`TParsedLineCommand`](/api/type-aliases/tparsedlinecommand/) \| [`TParsedHorizontalLineCommand`](/api/type-aliases/tparsedhorizontallinecommand/) \| [`TParsedVerticalLineCommand`](/api/type-aliases/tparsedverticallinecommand/) \| [`TParsedClosePathCommand`](/api/type-aliases/tparsedclosepathcommand/) \| [`TParsedCubicCurveCommand`](/api/type-aliases/tparsedcubiccurvecommand/) \| [`TParsedCubicCurveShortcutCommand`](/api/type-aliases/tparsedcubiccurveshortcutcommand/) \| [`TParsedQuadraticCurveCommand`](/api/type-aliases/tparsedquadraticcurvecommand/) \| [`TParsedQuadraticCurveShortcutCommand`](/api/type-aliases/tparsedquadraticcurveshortcutcommand/) \| [`TParsedArcCommand`](/api/type-aliases/tparsedarccommand/) + +Defined in: [src/util/path/typedefs.ts:266](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L266) + +Any old valid SVG path command diff --git a/src/content/docs/api/type-aliases/TComplexParsedCommandType.md b/src/content/docs/api/type-aliases/TComplexParsedCommandType.md new file mode 100644 index 000000000..4846c761b --- /dev/null +++ b/src/content/docs/api/type-aliases/TComplexParsedCommandType.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TComplexParsedCommandType" +--- + +> **TComplexParsedCommandType** = `"M"` \| `"L"` \| `"C"` \| `"Q"` \| `"Z"` \| `"z"` \| `"m"` \| `"l"` \| `"h"` \| `"v"` \| `"c"` \| `"s"` \| `"q"` \| `"t"` \| `"a"` \| `"H"` \| `"V"` \| `"S"` \| `"T"` \| `"A"` + +Defined in: [src/util/path/typedefs.ts:296](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L296) diff --git a/src/content/docs/api/type-aliases/TComplexPathData.md b/src/content/docs/api/type-aliases/TComplexPathData.md new file mode 100644 index 000000000..e703ded31 --- /dev/null +++ b/src/content/docs/api/type-aliases/TComplexPathData.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "TComplexPathData" +--- + +> **TComplexPathData** = [`TComplexParsedCommand`](/api/type-aliases/tcomplexparsedcommand/)[] + +Defined in: [src/util/path/typedefs.ts:281](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L281) + +A series of path commands diff --git a/src/content/docs/api/type-aliases/TCornerPoint.md b/src/content/docs/api/type-aliases/TCornerPoint.md index 5ba06daf2..b83b9107e 100644 --- a/src/content/docs/api/type-aliases/TCornerPoint.md +++ b/src/content/docs/api/type-aliases/TCornerPoint.md @@ -5,26 +5,38 @@ prev: false title: "TCornerPoint" --- -> **TCornerPoint**: `object` +> **TCornerPoint** = `object` -## Type declaration +Defined in: [src/typedefs.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L82) + +## Properties ### bl > **bl**: [`Point`](/api/classes/point/) +Defined in: [src/typedefs.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L85) + +*** + ### br > **br**: [`Point`](/api/classes/point/) +Defined in: [src/typedefs.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L86) + +*** + ### tl > **tl**: [`Point`](/api/classes/point/) +Defined in: [src/typedefs.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L83) + +*** + ### tr > **tr**: [`Point`](/api/classes/point/) -## Defined in - -[src/typedefs.ts:78](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L78) +Defined in: [src/typedefs.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L84) diff --git a/src/content/docs/api/type-aliases/TCrossOrigin.md b/src/content/docs/api/type-aliases/TCrossOrigin.md index 6b54e999c..b0b04cbf3 100644 --- a/src/content/docs/api/type-aliases/TCrossOrigin.md +++ b/src/content/docs/api/type-aliases/TCrossOrigin.md @@ -5,14 +5,12 @@ prev: false title: "TCrossOrigin" --- -> **TCrossOrigin**: `""` \| `"anonymous"` \| `"use-credentials"` \| `null` +> **TCrossOrigin** = `""` \| `"anonymous"` \| `"use-credentials"` \| `null` + +Defined in: [src/typedefs.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L77) An invalid keyword and an empty string will be handled as the `anonymous` keyword. ## See https://developer.mozilla.org/en-US/docs/HTML/CORS_settings_attributes - -## Defined in - -[src/typedefs.ts:73](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L73) diff --git a/src/content/docs/api/type-aliases/TCubicCurveCommand.md b/src/content/docs/api/type-aliases/TCubicCurveCommand.md new file mode 100644 index 000000000..602a37a7f --- /dev/null +++ b/src/content/docs/api/type-aliases/TCubicCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TCubicCurveCommand" +--- + +> **TCubicCurveCommand** = `TCommand7`\<[`TParsedCubicCurveCommand`](/api/type-aliases/tparsedcubiccurvecommand/)\> + +Defined in: [src/util/path/typedefs.ts:168](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L168) diff --git a/src/content/docs/api/type-aliases/TCubicCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TCubicCurveShortcutCommand.md new file mode 100644 index 000000000..5cceca4ee --- /dev/null +++ b/src/content/docs/api/type-aliases/TCubicCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TCubicCurveShortcutCommand" +--- + +> **TCubicCurveShortcutCommand** = `TCommand5`\<[`TParsedCubicCurveShortcutCommand`](/api/type-aliases/tparsedcubiccurveshortcutcommand/)\> + +Defined in: [src/util/path/typedefs.ts:188](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L188) diff --git a/src/content/docs/api/namespaces/util/type-aliases/TCurveInfo.md b/src/content/docs/api/type-aliases/TCurveInfo.md similarity index 55% rename from src/content/docs/api/namespaces/util/type-aliases/TCurveInfo.md rename to src/content/docs/api/type-aliases/TCurveInfo.md index cbb8c683a..432a33f61 100644 --- a/src/content/docs/api/namespaces/util/type-aliases/TCurveInfo.md +++ b/src/content/docs/api/type-aliases/TCurveInfo.md @@ -5,9 +5,11 @@ prev: false title: "TCurveInfo" --- -> **TCurveInfo**\<`C`\>: [`TPathSegmentInfoCommon`](/api/namespaces/util/type-aliases/tpathsegmentinfocommon/)\<`C`\> & `object` +> **TCurveInfo**\<`C`\> = [`TPathSegmentInfoCommon`](/api/type-aliases/tpathsegmentinfocommon/)\<`C`\> & `object` -## Type declaration +Defined in: [src/util/path/typedefs.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L11) + +## Type Declaration ### angleFinder() @@ -17,7 +19,9 @@ Get the angle to a percent #### Parameters -• **pct**: `number` +##### pct + +`number` #### Returns @@ -31,7 +35,9 @@ Get the Point a certain percent distance along the curve #### Parameters -• **pct**: `number` +##### pct + +`number` #### Returns @@ -45,8 +51,6 @@ Total length of the curve ## Type Parameters -• **C** *extends* `string` - -## Defined in +### C -[src/util/path/typedefs.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/path/typedefs.ts#L11) +`C` *extends* `string` diff --git a/src/content/docs/api/type-aliases/TDataUrlOptions.md b/src/content/docs/api/type-aliases/TDataUrlOptions.md index 63f0f045d..a43c0859b 100644 --- a/src/content/docs/api/type-aliases/TDataUrlOptions.md +++ b/src/content/docs/api/type-aliases/TDataUrlOptions.md @@ -5,9 +5,11 @@ prev: false title: "TDataUrlOptions" --- -> **TDataUrlOptions**\<`T`\>: [`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/)\<`T`\> & `object` +> **TDataUrlOptions**\<`T`\> = [`TToCanvasElementOptions`](/api/type-aliases/ttocanvaselementoptions/)\<`T`\> & `object` -## Type declaration +Defined in: [src/typedefs.ts:116](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L116) + +## Type Declaration ### enableRetinaScaling? @@ -27,8 +29,6 @@ title: "TDataUrlOptions" ## Type Parameters -• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) = [`BaseFabricObject`](/api/classes/basefabricobject/) - -## Defined in +### T -[src/typedefs.ts:110](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L110) +`T` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) = [`BaseFabricObject`](/api/classes/basefabricobject/) diff --git a/src/content/docs/api/type-aliases/TDegree.md b/src/content/docs/api/type-aliases/TDegree.md index b40cb6f40..c4aba7a45 100644 --- a/src/content/docs/api/type-aliases/TDegree.md +++ b/src/content/docs/api/type-aliases/TDegree.md @@ -5,8 +5,6 @@ prev: false title: "TDegree" --- -> **TDegree**: `Nominal`\<`number`, `Degree`\> +> **TDegree** = `Nominal`\<`number`, `Degree`\> -## Defined in - -[src/typedefs.ts:25](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L25) +Defined in: [src/typedefs.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L25) diff --git a/src/content/docs/api/type-aliases/TEndPathInfo.md b/src/content/docs/api/type-aliases/TEndPathInfo.md new file mode 100644 index 000000000..ef885c78f --- /dev/null +++ b/src/content/docs/api/type-aliases/TEndPathInfo.md @@ -0,0 +1,20 @@ +--- +editUrl: false +next: false +prev: false +title: "TEndPathInfo" +--- + +> **TEndPathInfo** = [`TPathSegmentInfoCommon`](/api/type-aliases/tpathsegmentinfocommon/)\<`"Z"`\> & `object` + +Defined in: [src/util/path/typedefs.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L28) + +## Type Declaration + +### destX + +> **destX**: `number` + +### destY + +> **destY**: `number` diff --git a/src/content/docs/api/type-aliases/TEventsExtraData.md b/src/content/docs/api/type-aliases/TEventsExtraData.md new file mode 100644 index 000000000..3590f0ff4 --- /dev/null +++ b/src/content/docs/api/type-aliases/TEventsExtraData.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TEventsExtraData" +--- + +> **TEventsExtraData** = `Record`\<`PropertyKey`, `Record`\<`PropertyKey`, `never`\>\> & `Record`\<`"down"`, \{ `alreadySelected`: `boolean`; \}\> + +Defined in: [src/EventTypeDefs.ts:350](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L350) diff --git a/src/content/docs/api/type-aliases/TFabricObjectProps.md b/src/content/docs/api/type-aliases/TFabricObjectProps.md index 08f04e14e..bab31294e 100644 --- a/src/content/docs/api/type-aliases/TFabricObjectProps.md +++ b/src/content/docs/api/type-aliases/TFabricObjectProps.md @@ -5,8 +5,6 @@ prev: false title: "TFabricObjectProps" --- -> **TFabricObjectProps**: [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> +> **TFabricObjectProps** = [`TOptions`](/api/type-aliases/toptions/)\<[`FabricObjectProps`](/api/interfaces/fabricobjectprops/)\> -## Defined in - -[src/shapes/Object/types/index.ts:7](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Object/types/index.ts#L7) +Defined in: [src/shapes/Object/types/index.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Object/types/index.ts#L7) diff --git a/src/content/docs/api/type-aliases/TFiller.md b/src/content/docs/api/type-aliases/TFiller.md index 1ba7555f4..32b09a24d 100644 --- a/src/content/docs/api/type-aliases/TFiller.md +++ b/src/content/docs/api/type-aliases/TFiller.md @@ -5,8 +5,6 @@ prev: false title: "TFiller" --- -> **TFiller**: [`Gradient`](/api/classes/gradient/)\<`"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`\> \| [`Pattern`](/api/classes/pattern/) +> **TFiller** = [`Gradient`](/api/classes/gradient/)\<`"linear"`\> \| [`Gradient`](/api/classes/gradient/)\<`"radial"`\> \| [`Pattern`](/api/classes/pattern/) -## Defined in - -[src/typedefs.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L32) +Defined in: [src/typedefs.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L32) diff --git a/src/content/docs/api/type-aliases/THorizontalLineCommand.md b/src/content/docs/api/type-aliases/THorizontalLineCommand.md new file mode 100644 index 000000000..fe86e563b --- /dev/null +++ b/src/content/docs/api/type-aliases/THorizontalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "THorizontalLineCommand" +--- + +> **THorizontalLineCommand** = `TCommand2`\<[`TParsedHorizontalLineCommand`](/api/type-aliases/tparsedhorizontallinecommand/)\> + +Defined in: [src/util/path/typedefs.ts:128](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L128) diff --git a/src/content/docs/api/type-aliases/TLineCommand.md b/src/content/docs/api/type-aliases/TLineCommand.md new file mode 100644 index 000000000..9e1a8c6e5 --- /dev/null +++ b/src/content/docs/api/type-aliases/TLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TLineCommand" +--- + +> **TLineCommand** = `TCommand3`\<[`TParsedLineCommand`](/api/type-aliases/tparsedlinecommand/)\> + +Defined in: [src/util/path/typedefs.ts:120](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L120) diff --git a/src/content/docs/api/type-aliases/TMat2D.md b/src/content/docs/api/type-aliases/TMat2D.md index f28acee8e..16b6aadb4 100644 --- a/src/content/docs/api/type-aliases/TMat2D.md +++ b/src/content/docs/api/type-aliases/TMat2D.md @@ -5,19 +5,13 @@ prev: false title: "TMat2D" --- -> **TMat2D**: [`number`, `number`, `number`, `number`, `number`, `number`] +> **TMat2D** = \[`number`, `number`, `number`, `number`, `number`, `number`\] + +Defined in: [src/typedefs.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L64) A transform matrix. Basically a matrix in the form [ a c e ] [ b d f ] [ 0 0 1 ] -For more details, see - -## Link - -https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#matrix - -## Defined in - -[src/typedefs.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L60) +For more details, see [https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#matrix](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#matrix) diff --git a/src/content/docs/api/type-aliases/TMatColorMatrix.md b/src/content/docs/api/type-aliases/TMatColorMatrix.md index 1f8eff410..45c2ce547 100644 --- a/src/content/docs/api/type-aliases/TMatColorMatrix.md +++ b/src/content/docs/api/type-aliases/TMatColorMatrix.md @@ -5,8 +5,6 @@ prev: false title: "TMatColorMatrix" --- -> **TMatColorMatrix**: [`number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`] +> **TMatColorMatrix** = \[`number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`, `number`\] -## Defined in - -[src/filters/typedefs.ts:60](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L60) +Defined in: [src/filters/typedefs.ts:60](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L60) diff --git a/src/content/docs/api/type-aliases/TModificationEvents.md b/src/content/docs/api/type-aliases/TModificationEvents.md index 8471e641d..158a02cab 100644 --- a/src/content/docs/api/type-aliases/TModificationEvents.md +++ b/src/content/docs/api/type-aliases/TModificationEvents.md @@ -5,8 +5,6 @@ prev: false title: "TModificationEvents" --- -> **TModificationEvents**: *typeof* `MOVING` \| *typeof* `SCALING` \| *typeof* `ROTATING` \| *typeof* `SKEWING` \| *typeof* `RESIZING` \| *typeof* `MODIFY_POLY` \| *typeof* `MODIFY_PATH` +> **TModificationEvents** = *typeof* `MOVING` \| *typeof* `SCALING` \| *typeof* `ROTATING` \| *typeof* `SKEWING` \| *typeof* `RESIZING` \| *typeof* `MODIFY_POLY` \| *typeof* `MODIFY_PATH` -## Defined in - -[src/EventTypeDefs.ts:109](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L109) +Defined in: [src/EventTypeDefs.ts:118](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L118) diff --git a/src/content/docs/api/type-aliases/TMoveToCommand.md b/src/content/docs/api/type-aliases/TMoveToCommand.md new file mode 100644 index 000000000..51ccbaa05 --- /dev/null +++ b/src/content/docs/api/type-aliases/TMoveToCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TMoveToCommand" +--- + +> **TMoveToCommand** = `TCommand3`\<[`TParsedMoveToCommand`](/api/type-aliases/tparsedmovetocommand/)\> + +Defined in: [src/util/path/typedefs.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L112) diff --git a/src/content/docs/api/type-aliases/TOptionalModifierKey.md b/src/content/docs/api/type-aliases/TOptionalModifierKey.md index 869cad71a..a7a406f1d 100644 --- a/src/content/docs/api/type-aliases/TOptionalModifierKey.md +++ b/src/content/docs/api/type-aliases/TOptionalModifierKey.md @@ -5,8 +5,6 @@ prev: false title: "TOptionalModifierKey" --- -> **TOptionalModifierKey**: [`ModifierKey`](/api/type-aliases/modifierkey/) \| `null` \| `undefined` +> **TOptionalModifierKey** = [`ModifierKey`](/api/type-aliases/modifierkey/) \| `null` \| `undefined` -## Defined in - -[src/EventTypeDefs.ts:30](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L30) +Defined in: [src/EventTypeDefs.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L31) diff --git a/src/content/docs/api/type-aliases/TOptions.md b/src/content/docs/api/type-aliases/TOptions.md index 127a7b3fc..42d9711fa 100644 --- a/src/content/docs/api/type-aliases/TOptions.md +++ b/src/content/docs/api/type-aliases/TOptions.md @@ -5,12 +5,12 @@ prev: false title: "TOptions" --- -> **TOptions**\<`T`\>: `Partial`\<`T`\> & `Record`\<`string`, `any`\> +> **TOptions**\<`T`\> = `Partial`\<`T`\> & `Record`\<`string`, `any`\> -## Type Parameters +Defined in: [src/typedefs.ts:132](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L132) -• **T** +## Type Parameters -## Defined in +### T -[src/typedefs.ts:126](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L126) +`T` diff --git a/src/content/docs/api/type-aliases/TOriginX.md b/src/content/docs/api/type-aliases/TOriginX.md index b493b5504..a5fcf5d13 100644 --- a/src/content/docs/api/type-aliases/TOriginX.md +++ b/src/content/docs/api/type-aliases/TOriginX.md @@ -5,8 +5,6 @@ prev: false title: "TOriginX" --- -> **TOriginX**: `"center"` \| `"left"` \| `"right"` \| `number` +> **TOriginX** = `"center"` \| `"left"` \| `"right"` \| `number` -## Defined in - -[src/typedefs.ts:75](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L75) +Defined in: [src/typedefs.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L79) diff --git a/src/content/docs/api/type-aliases/TOriginY.md b/src/content/docs/api/type-aliases/TOriginY.md index 5af3d1108..ac8991a70 100644 --- a/src/content/docs/api/type-aliases/TOriginY.md +++ b/src/content/docs/api/type-aliases/TOriginY.md @@ -5,8 +5,6 @@ prev: false title: "TOriginY" --- -> **TOriginY**: `"center"` \| `"top"` \| `"bottom"` \| `number` +> **TOriginY** = `"center"` \| `"top"` \| `"bottom"` \| `number` -## Defined in - -[src/typedefs.ts:76](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L76) +Defined in: [src/typedefs.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L80) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteArcCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteArcCommand.md new file mode 100644 index 000000000..c0f8fe1fc --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteArcCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteArcCommand" +--- + +> **TParsedAbsoluteArcCommand** = \[`"A"`, `number`, `number`, [`TRadian`](/api/type-aliases/tradian/), `0` \| `1`, `0` \| `1`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:228](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L228) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteClosePathCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteClosePathCommand.md new file mode 100644 index 000000000..83bf294b4 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteClosePathCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteClosePathCommand" +--- + +> **TParsedAbsoluteClosePathCommand** = \[`"Z"`\] + +Defined in: [src/util/path/typedefs.ts:138](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L138) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveCommand.md new file mode 100644 index 000000000..a4f215902 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteCubicCurveCommand" +--- + +> **TParsedAbsoluteCubicCurveCommand** = \[`"C"`, `number`, `number`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:146](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L146) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md new file mode 100644 index 000000000..19dd4d83c --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteCubicCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteCubicCurveShortcutCommand" +--- + +> **TParsedAbsoluteCubicCurveShortcutCommand** = \[`"S"`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:170](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L170) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteHorizontalLineCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteHorizontalLineCommand.md new file mode 100644 index 000000000..3ecd18253 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteHorizontalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteHorizontalLineCommand" +--- + +> **TParsedAbsoluteHorizontalLineCommand** = \[`"H"`, `number`\] + +Defined in: [src/util/path/typedefs.ts:122](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L122) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteLineCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteLineCommand.md new file mode 100644 index 000000000..359179d2e --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteLineCommand" +--- + +> **TParsedAbsoluteLineCommand** = \[`"L"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:114](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L114) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteMoveToCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteMoveToCommand.md new file mode 100644 index 000000000..5d8f88eff --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteMoveToCommand.md @@ -0,0 +1,13 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteMoveToCommand" +--- + +> **TParsedAbsoluteMoveToCommand** = \[`"M"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:102](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L102) + +Begin parsed SVG path commands +Read about commands at [https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths\|MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths|MDN) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md new file mode 100644 index 000000000..06eeec86d --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteQuadraticCurveCommand" +--- + +> **TParsedAbsoluteQuadraticCurveCommand** = \[`"Q"`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:191](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L191) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md new file mode 100644 index 000000000..6988d00d6 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteQuadraticCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteQuadraticCurveShortcutCommand" +--- + +> **TParsedAbsoluteQuadraticCurveShortcutCommand** = \[`"T"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:211](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L211) diff --git a/src/content/docs/api/type-aliases/TParsedAbsoluteVerticalLineCommand.md b/src/content/docs/api/type-aliases/TParsedAbsoluteVerticalLineCommand.md new file mode 100644 index 000000000..9acd39ba8 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedAbsoluteVerticalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedAbsoluteVerticalLineCommand" +--- + +> **TParsedAbsoluteVerticalLineCommand** = \[`"V"`, `number`\] + +Defined in: [src/util/path/typedefs.ts:130](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L130) diff --git a/src/content/docs/api/type-aliases/TParsedArcCommand.md b/src/content/docs/api/type-aliases/TParsedArcCommand.md new file mode 100644 index 000000000..bed00e69f --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedArcCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedArcCommand" +--- + +> **TParsedArcCommand** = [`TParsedAbsoluteArcCommand`](/api/type-aliases/tparsedabsolutearccommand/) \| [`TParsedRelativeArcCommand`](/api/type-aliases/tparsedrelativearccommand/) + +Defined in: [src/util/path/typedefs.ts:249](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L249) diff --git a/src/content/docs/api/type-aliases/TParsedClosePathCommand.md b/src/content/docs/api/type-aliases/TParsedClosePathCommand.md new file mode 100644 index 000000000..2b043b4ef --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedClosePathCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedClosePathCommand" +--- + +> **TParsedClosePathCommand** = [`TParsedAbsoluteClosePathCommand`](/api/type-aliases/tparsedabsoluteclosepathcommand/) \| [`TParsedRelativeClosePathCommand`](/api/type-aliases/tparsedrelativeclosepathcommand/) + +Defined in: [src/util/path/typedefs.ts:140](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L140) diff --git a/src/content/docs/api/type-aliases/TParsedCommand.md b/src/content/docs/api/type-aliases/TParsedCommand.md new file mode 100644 index 000000000..4a099aac3 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedCommand.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedCommand" +--- + +> **TParsedCommand** = \[`string`\] \| \[`string`, `number`\] \| \[`string`, `number`, `number`\] \| \[`string`, `number`, `number`, `number`\] \| \[`string`, `number`, `number`, `number`, `number`\] \| \[`string`, `number`, `number`, `number`, `number`, `number`\] \| \[`string`, `number`, `number`, `number`, `number`, `number`, `number`\] \| \[`string`, `number`, `number`, `number`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:51](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L51) + +A parsed command of any length (even impossible ones) diff --git a/src/content/docs/api/type-aliases/TParsedCubicCurveCommand.md b/src/content/docs/api/type-aliases/TParsedCubicCurveCommand.md new file mode 100644 index 000000000..fd5958bf0 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedCubicCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedCubicCurveCommand" +--- + +> **TParsedCubicCurveCommand** = [`TParsedAbsoluteCubicCurveCommand`](/api/type-aliases/tparsedabsolutecubiccurvecommand/) \| [`TParsedRelativeCubicCurveCommand`](/api/type-aliases/tparsedrelativecubiccurvecommand/) + +Defined in: [src/util/path/typedefs.ts:164](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L164) diff --git a/src/content/docs/api/type-aliases/TParsedCubicCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedCubicCurveShortcutCommand.md new file mode 100644 index 000000000..b591ec6f0 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedCubicCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedCubicCurveShortcutCommand" +--- + +> **TParsedCubicCurveShortcutCommand** = [`TParsedAbsoluteCubicCurveShortcutCommand`](/api/type-aliases/tparsedabsolutecubiccurveshortcutcommand/) \| [`TParsedRelativeCubicCurveShortcutCommand`](/api/type-aliases/tparsedrelativecubiccurveshortcutcommand/) + +Defined in: [src/util/path/typedefs.ts:184](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L184) diff --git a/src/content/docs/api/type-aliases/TParsedHorizontalLineCommand.md b/src/content/docs/api/type-aliases/TParsedHorizontalLineCommand.md new file mode 100644 index 000000000..451fab04a --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedHorizontalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedHorizontalLineCommand" +--- + +> **TParsedHorizontalLineCommand** = [`TParsedAbsoluteHorizontalLineCommand`](/api/type-aliases/tparsedabsolutehorizontallinecommand/) \| [`TParsedRelativeHorizontalLineCommand`](/api/type-aliases/tparsedrelativehorizontallinecommand/) + +Defined in: [src/util/path/typedefs.ts:124](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L124) diff --git a/src/content/docs/api/type-aliases/TParsedLineCommand.md b/src/content/docs/api/type-aliases/TParsedLineCommand.md new file mode 100644 index 000000000..68533c0dc --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedLineCommand" +--- + +> **TParsedLineCommand** = [`TParsedAbsoluteLineCommand`](/api/type-aliases/tparsedabsolutelinecommand/) \| [`TParsedRelativeLineCommand`](/api/type-aliases/tparsedrelativelinecommand/) + +Defined in: [src/util/path/typedefs.ts:116](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L116) diff --git a/src/content/docs/api/type-aliases/TParsedMoveToCommand.md b/src/content/docs/api/type-aliases/TParsedMoveToCommand.md new file mode 100644 index 000000000..aef838c4b --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedMoveToCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedMoveToCommand" +--- + +> **TParsedMoveToCommand** = [`TParsedAbsoluteMoveToCommand`](/api/type-aliases/tparsedabsolutemovetocommand/) \| [`TParsedRelativeMoveToCommand`](/api/type-aliases/tparsedrelativemovetocommand/) + +Defined in: [src/util/path/typedefs.ts:108](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L108) diff --git a/src/content/docs/api/type-aliases/TParsedQuadraticCurveCommand.md b/src/content/docs/api/type-aliases/TParsedQuadraticCurveCommand.md new file mode 100644 index 000000000..abed5344a --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedQuadraticCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedQuadraticCurveCommand" +--- + +> **TParsedQuadraticCurveCommand** = [`TParsedAbsoluteQuadraticCurveCommand`](/api/type-aliases/tparsedabsolutequadraticcurvecommand/) \| [`TParsedRelativeQuadraticCurveCommand`](/api/type-aliases/tparsedrelativequadraticcurvecommand/) + +Defined in: [src/util/path/typedefs.ts:205](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L205) diff --git a/src/content/docs/api/type-aliases/TParsedQuadraticCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedQuadraticCurveShortcutCommand.md new file mode 100644 index 000000000..8a5931d5f --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedQuadraticCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedQuadraticCurveShortcutCommand" +--- + +> **TParsedQuadraticCurveShortcutCommand** = [`TParsedAbsoluteQuadraticCurveShortcutCommand`](/api/type-aliases/tparsedabsolutequadraticcurveshortcutcommand/) \| [`TParsedRelativeQuadraticCurveShortcutCommand`](/api/type-aliases/tparsedrelativequadraticcurveshortcutcommand/) + +Defined in: [src/util/path/typedefs.ts:221](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L221) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeArcCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeArcCommand.md new file mode 100644 index 000000000..c5d03d67b --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeArcCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeArcCommand" +--- + +> **TParsedRelativeArcCommand** = \[`"a"`, `number`, `number`, [`TRadian`](/api/type-aliases/tradian/), `0` \| `1`, `0` \| `1`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:238](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L238) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeClosePathCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeClosePathCommand.md new file mode 100644 index 000000000..f90f1934d --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeClosePathCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeClosePathCommand" +--- + +> **TParsedRelativeClosePathCommand** = \[`"z"`\] + +Defined in: [src/util/path/typedefs.ts:139](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L139) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveCommand.md new file mode 100644 index 000000000..62cafc332 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeCubicCurveCommand" +--- + +> **TParsedRelativeCubicCurveCommand** = \[`"c"`, `number`, `number`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:155](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L155) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md new file mode 100644 index 000000000..ff3f4b95f --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeCubicCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeCubicCurveShortcutCommand" +--- + +> **TParsedRelativeCubicCurveShortcutCommand** = \[`"s"`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:177](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L177) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeHorizontalLineCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeHorizontalLineCommand.md new file mode 100644 index 000000000..c38030fcc --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeHorizontalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeHorizontalLineCommand" +--- + +> **TParsedRelativeHorizontalLineCommand** = \[`"h"`, `number`\] + +Defined in: [src/util/path/typedefs.ts:123](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L123) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeLineCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeLineCommand.md new file mode 100644 index 000000000..1dd510fe1 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeLineCommand" +--- + +> **TParsedRelativeLineCommand** = \[`"l"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:115](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L115) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeMoveToCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeMoveToCommand.md new file mode 100644 index 000000000..7348ddcfd --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeMoveToCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeMoveToCommand" +--- + +> **TParsedRelativeMoveToCommand** = \[`"m"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:103](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L103) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveCommand.md new file mode 100644 index 000000000..d49640491 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeQuadraticCurveCommand" +--- + +> **TParsedRelativeQuadraticCurveCommand** = \[`"q"`, `number`, `number`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:198](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L198) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md new file mode 100644 index 000000000..5f0aa75e2 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeQuadraticCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeQuadraticCurveShortcutCommand" +--- + +> **TParsedRelativeQuadraticCurveShortcutCommand** = \[`"t"`, `number`, `number`\] + +Defined in: [src/util/path/typedefs.ts:216](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L216) diff --git a/src/content/docs/api/type-aliases/TParsedRelativeVerticalLineCommand.md b/src/content/docs/api/type-aliases/TParsedRelativeVerticalLineCommand.md new file mode 100644 index 000000000..b12eb727e --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedRelativeVerticalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedRelativeVerticalLineCommand" +--- + +> **TParsedRelativeVerticalLineCommand** = \[`"v"`, `number`\] + +Defined in: [src/util/path/typedefs.ts:131](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L131) diff --git a/src/content/docs/api/type-aliases/TParsedVerticalLineCommand.md b/src/content/docs/api/type-aliases/TParsedVerticalLineCommand.md new file mode 100644 index 000000000..4bebf37b0 --- /dev/null +++ b/src/content/docs/api/type-aliases/TParsedVerticalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TParsedVerticalLineCommand" +--- + +> **TParsedVerticalLineCommand** = [`TParsedAbsoluteVerticalLineCommand`](/api/type-aliases/tparsedabsoluteverticallinecommand/) \| [`TParsedRelativeVerticalLineCommand`](/api/type-aliases/tparsedrelativeverticallinecommand/) + +Defined in: [src/util/path/typedefs.ts:132](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L132) diff --git a/src/content/docs/api/type-aliases/TPathAlign.md b/src/content/docs/api/type-aliases/TPathAlign.md index 4b3228b9a..dce6191fb 100644 --- a/src/content/docs/api/type-aliases/TPathAlign.md +++ b/src/content/docs/api/type-aliases/TPathAlign.md @@ -5,8 +5,6 @@ prev: false title: "TPathAlign" --- -> **TPathAlign**: `"baseline"` \| `"center"` \| `"ascender"` \| `"descender"` +> **TPathAlign** = `"baseline"` \| `"center"` \| `"ascender"` \| `"descender"` -## Defined in - -[src/shapes/Text/Text.ts:69](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L69) +Defined in: [src/shapes/Text/Text.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L71) diff --git a/src/content/docs/api/type-aliases/TPathSegmentCommandInfo.md b/src/content/docs/api/type-aliases/TPathSegmentCommandInfo.md new file mode 100644 index 000000000..33ad620b1 --- /dev/null +++ b/src/content/docs/api/type-aliases/TPathSegmentCommandInfo.md @@ -0,0 +1,53 @@ +--- +editUrl: false +next: false +prev: false +title: "TPathSegmentCommandInfo" +--- + +> **TPathSegmentCommandInfo** = `object` + +Defined in: [src/util/path/typedefs.ts:37](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L37) + +Relevant info to calculate path length/points on path +for each command type in a simplified parsed path + +## Properties + +### C + +> **C**: [`TCurveInfo`](/api/type-aliases/tcurveinfo/)\<`"C"`\> + +Defined in: [src/util/path/typedefs.ts:40](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L40) + +*** + +### L + +> **L**: [`TPathSegmentInfoCommon`](/api/type-aliases/tpathsegmentinfocommon/)\<`"L"`\> + +Defined in: [src/util/path/typedefs.ts:39](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L39) + +*** + +### M + +> **M**: [`TPathSegmentInfoCommon`](/api/type-aliases/tpathsegmentinfocommon/)\<`"M"`\> + +Defined in: [src/util/path/typedefs.ts:38](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L38) + +*** + +### Q + +> **Q**: [`TCurveInfo`](/api/type-aliases/tcurveinfo/)\<`"Q"`\> + +Defined in: [src/util/path/typedefs.ts:41](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L41) + +*** + +### Z + +> **Z**: [`TEndPathInfo`](/api/type-aliases/tendpathinfo/) + +Defined in: [src/util/path/typedefs.ts:42](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L42) diff --git a/src/content/docs/api/type-aliases/TPathSegmentInfo.md b/src/content/docs/api/type-aliases/TPathSegmentInfo.md new file mode 100644 index 000000000..a6d376c09 --- /dev/null +++ b/src/content/docs/api/type-aliases/TPathSegmentInfo.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TPathSegmentInfo" +--- + +> **TPathSegmentInfo** = [`TPathSegmentCommandInfo`](/api/type-aliases/tpathsegmentcommandinfo/)\[keyof [`TPathSegmentCommandInfo`](/api/type-aliases/tpathsegmentcommandinfo/)\] + +Defined in: [src/util/path/typedefs.ts:45](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L45) diff --git a/src/content/docs/api/type-aliases/TPathSegmentInfoCommon.md b/src/content/docs/api/type-aliases/TPathSegmentInfoCommon.md new file mode 100644 index 000000000..8b3a78f65 --- /dev/null +++ b/src/content/docs/api/type-aliases/TPathSegmentInfoCommon.md @@ -0,0 +1,48 @@ +--- +editUrl: false +next: false +prev: false +title: "TPathSegmentInfoCommon" +--- + +> **TPathSegmentInfoCommon**\<`C`\> = `object` + +Defined in: [src/util/path/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L4) + +## Type Parameters + +### C + +`C` *extends* `string` + +## Properties + +### command? + +> `optional` **command**: `C` + +Defined in: [src/util/path/typedefs.ts:7](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L7) + +*** + +### length + +> **length**: `number` + +Defined in: [src/util/path/typedefs.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L8) + +*** + +### x + +> **x**: `number` + +Defined in: [src/util/path/typedefs.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L5) + +*** + +### y + +> **y**: `number` + +Defined in: [src/util/path/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L6) diff --git a/src/content/docs/api/type-aliases/TPathSide.md b/src/content/docs/api/type-aliases/TPathSide.md index d809a0266..af4e132cc 100644 --- a/src/content/docs/api/type-aliases/TPathSide.md +++ b/src/content/docs/api/type-aliases/TPathSide.md @@ -5,8 +5,6 @@ prev: false title: "TPathSide" --- -> **TPathSide**: `"left"` \| `"right"` +> **TPathSide** = `"left"` \| `"right"` -## Defined in - -[src/shapes/Text/Text.ts:67](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/Text.ts#L67) +Defined in: [src/shapes/Text/Text.ts:69](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/Text.ts#L69) diff --git a/src/content/docs/api/type-aliases/TPipelineResources.md b/src/content/docs/api/type-aliases/TPipelineResources.md index 510a1f63c..9737eafa6 100644 --- a/src/content/docs/api/type-aliases/TPipelineResources.md +++ b/src/content/docs/api/type-aliases/TPipelineResources.md @@ -5,9 +5,11 @@ prev: false title: "TPipelineResources" --- -> **TPipelineResources**: `object` & `Record`\<`string`, `unknown`\> +> **TPipelineResources** = `object` & `Record`\<`string`, `unknown`\> -## Type declaration +Defined in: [src/filters/typedefs.ts:8](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L8) + +## Type Declaration ### blendImage? @@ -24,7 +26,3 @@ title: "TPipelineResources" ### sliceByTwo? > `optional` **sliceByTwo**: `HTMLCanvasElement` - -## Defined in - -[src/filters/typedefs.ts:8](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L8) diff --git a/src/content/docs/api/type-aliases/TPointAngle.md b/src/content/docs/api/type-aliases/TPointAngle.md new file mode 100644 index 000000000..6881cfc78 --- /dev/null +++ b/src/content/docs/api/type-aliases/TPointAngle.md @@ -0,0 +1,18 @@ +--- +editUrl: false +next: false +prev: false +title: "TPointAngle" +--- + +> **TPointAngle** = [`XY`](/api/interfaces/xy/) & `object` + +Defined in: [src/util/path/typedefs.ts:326](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L326) + +A point (vector) and angle between the vector and x-axis + +## Type Declaration + +### angle + +> **angle**: [`TRadian`](/api/type-aliases/tradian/) diff --git a/src/content/docs/api/type-aliases/TPointerEvent.md b/src/content/docs/api/type-aliases/TPointerEvent.md index f8bc3e6d3..2c216a282 100644 --- a/src/content/docs/api/type-aliases/TPointerEvent.md +++ b/src/content/docs/api/type-aliases/TPointerEvent.md @@ -5,8 +5,6 @@ prev: false title: "TPointerEvent" --- -> **TPointerEvent**: `MouseEvent` \| `TouchEvent` \| `PointerEvent` +> **TPointerEvent** = `MouseEvent` \| `TouchEvent` \| `PointerEvent` -## Defined in - -[src/EventTypeDefs.ts:32](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L32) +Defined in: [src/EventTypeDefs.ts:33](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L33) diff --git a/src/content/docs/api/type-aliases/TPointerEventNames.md b/src/content/docs/api/type-aliases/TPointerEventNames.md index e05d9bbfa..021bfe7c8 100644 --- a/src/content/docs/api/type-aliases/TPointerEventNames.md +++ b/src/content/docs/api/type-aliases/TPointerEventNames.md @@ -5,8 +5,6 @@ prev: false title: "TPointerEventNames" --- -> **TPointerEventNames**: `WithBeforeSuffix`\<`"down"`\> \| `WithBeforeSuffix`\<`"move"`\> \| `WithBeforeSuffix`\<`"up"`\> \| `"dblclick"` \| `"wheel"` +> **TPointerEventNames** = `WithBeforeSuffix`\<`"down"`\> \| `WithBeforeSuffix`\<`"move"`\> \| `WithBeforeSuffix`\<`"up"`\> \| `"dblclick"` \| `"tripleclick"` \| `"wheel"` -## Defined in - -[src/EventTypeDefs.ts:276](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L276) +Defined in: [src/EventTypeDefs.ts:270](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L270) diff --git a/src/content/docs/api/type-aliases/TProgramCache.md b/src/content/docs/api/type-aliases/TProgramCache.md index 90a2dd3fb..3232cd4c3 100644 --- a/src/content/docs/api/type-aliases/TProgramCache.md +++ b/src/content/docs/api/type-aliases/TProgramCache.md @@ -5,8 +5,6 @@ prev: false title: "TProgramCache" --- -> **TProgramCache**: `any` +> **TProgramCache** = `any` -## Defined in - -[src/filters/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L4) +Defined in: [src/filters/typedefs.ts:4](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L4) diff --git a/src/content/docs/api/type-aliases/TQuadraticCurveCommand.md b/src/content/docs/api/type-aliases/TQuadraticCurveCommand.md new file mode 100644 index 000000000..0c5d6edc5 --- /dev/null +++ b/src/content/docs/api/type-aliases/TQuadraticCurveCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TQuadraticCurveCommand" +--- + +> **TQuadraticCurveCommand** = `TCommand5`\<[`TParsedQuadraticCurveCommand`](/api/type-aliases/tparsedquadraticcurvecommand/)\> + +Defined in: [src/util/path/typedefs.ts:209](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L209) diff --git a/src/content/docs/api/type-aliases/TQuadraticCurveShortcutCommand.md b/src/content/docs/api/type-aliases/TQuadraticCurveShortcutCommand.md new file mode 100644 index 000000000..98c8afbe3 --- /dev/null +++ b/src/content/docs/api/type-aliases/TQuadraticCurveShortcutCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TQuadraticCurveShortcutCommand" +--- + +> **TQuadraticCurveShortcutCommand** = `TCommand3`\<[`TParsedQuadraticCurveShortcutCommand`](/api/type-aliases/tparsedquadraticcurveshortcutcommand/)\> + +Defined in: [src/util/path/typedefs.ts:225](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L225) diff --git a/src/content/docs/api/type-aliases/TRGBAColorSource.md b/src/content/docs/api/type-aliases/TRGBAColorSource.md index 88b7230c5..ec6fa35bf 100644 --- a/src/content/docs/api/type-aliases/TRGBAColorSource.md +++ b/src/content/docs/api/type-aliases/TRGBAColorSource.md @@ -5,10 +5,8 @@ prev: false title: "TRGBAColorSource" --- -> **TRGBAColorSource**: [`number`, `number`, `number`, `number`] +> **TRGBAColorSource** = \[`number`, `number`, `number`, `number`\] -RGBA format - -## Defined in +Defined in: [src/color/typedefs.ts:11](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/typedefs.ts#L11) -[src/color/typedefs.ts:11](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/typedefs.ts#L11) +RGBA format diff --git a/src/content/docs/api/type-aliases/TRGBColorSource.md b/src/content/docs/api/type-aliases/TRGBColorSource.md index 7e5ed23d5..15e499180 100644 --- a/src/content/docs/api/type-aliases/TRGBColorSource.md +++ b/src/content/docs/api/type-aliases/TRGBColorSource.md @@ -5,10 +5,8 @@ prev: false title: "TRGBColorSource" --- -> **TRGBColorSource**: [`number`, `number`, `number`] +> **TRGBColorSource** = \[`number`, `number`, `number`\] -RGB format - -## Defined in +Defined in: [src/color/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/color/typedefs.ts#L6) -[src/color/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/color/typedefs.ts#L6) +RGB format diff --git a/src/content/docs/api/type-aliases/TRadian.md b/src/content/docs/api/type-aliases/TRadian.md index d7bbc60e0..6a9dc71b1 100644 --- a/src/content/docs/api/type-aliases/TRadian.md +++ b/src/content/docs/api/type-aliases/TRadian.md @@ -5,8 +5,6 @@ prev: false title: "TRadian" --- -> **TRadian**: `Nominal`\<`number`, `Radian`\> +> **TRadian** = `Nominal`\<`number`, `Radian`\> -## Defined in - -[src/typedefs.ts:26](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L26) +Defined in: [src/typedefs.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L26) diff --git a/src/content/docs/api/type-aliases/TRectBounds.md b/src/content/docs/api/type-aliases/TRectBounds.md index d12fffd4f..0d02c2611 100644 --- a/src/content/docs/api/type-aliases/TRectBounds.md +++ b/src/content/docs/api/type-aliases/TRectBounds.md @@ -5,8 +5,6 @@ prev: false title: "TRectBounds" --- -> **TRectBounds**: [[`XY`](/api/interfaces/xy/), [`XY`](/api/interfaces/xy/)] +> **TRectBounds** = \[[`XY`](/api/interfaces/xy/), [`XY`](/api/interfaces/xy/)\] -## Defined in - -[src/typedefs.ts:98](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L98) +Defined in: [src/typedefs.ts:104](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L104) diff --git a/src/content/docs/api/type-aliases/TSVGExportOptions.md b/src/content/docs/api/type-aliases/TSVGExportOptions.md index fd44de00e..7b8c43590 100644 --- a/src/content/docs/api/type-aliases/TSVGExportOptions.md +++ b/src/content/docs/api/type-aliases/TSVGExportOptions.md @@ -5,50 +5,70 @@ prev: false title: "TSVGExportOptions" --- -> **TSVGExportOptions**: `object` +> **TSVGExportOptions** = `object` -## Type declaration +Defined in: [src/canvas/StaticCanvas.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L62) + +## Properties ### encoding? > `optional` **encoding**: `"UTF-8"` +Defined in: [src/canvas/StaticCanvas.ts:70](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L70) + +*** + ### height? > `optional` **height**: `string` +Defined in: [src/canvas/StaticCanvas.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L72) + +*** + ### reviver? > `optional` **reviver**: [`TSVGReviver`](/api/type-aliases/tsvgreviver/) +Defined in: [src/canvas/StaticCanvas.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L73) + +*** + ### suppressPreamble? > `optional` **suppressPreamble**: `boolean` +Defined in: [src/canvas/StaticCanvas.ts:63](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L63) + +*** + ### viewBox? > `optional` **viewBox**: `object` -### viewBox.height +Defined in: [src/canvas/StaticCanvas.ts:64](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L64) + +#### height > **height**: `number` -### viewBox.width +#### width > **width**: `number` -### viewBox.x +#### x > **x**: `number` -### viewBox.y +#### y > **y**: `number` +*** + ### width? > `optional` **width**: `string` -## Defined in - -[src/canvas/StaticCanvas.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/canvas/StaticCanvas.ts#L62) +Defined in: [src/canvas/StaticCanvas.ts:71](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/canvas/StaticCanvas.ts#L71) diff --git a/src/content/docs/api/type-aliases/TSVGReviver.md b/src/content/docs/api/type-aliases/TSVGReviver.md index 1ef1bc724..7029c50bb 100644 --- a/src/content/docs/api/type-aliases/TSVGReviver.md +++ b/src/content/docs/api/type-aliases/TSVGReviver.md @@ -5,16 +5,16 @@ prev: false title: "TSVGReviver" --- -> **TSVGReviver**: (`markup`) => `string` +> **TSVGReviver** = (`markup`) => `string` -## Parameters +Defined in: [src/typedefs.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L89) -• **markup**: `string` +## Parameters -## Returns +### markup `string` -## Defined in +## Returns -[src/typedefs.ts:85](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L85) +`string` diff --git a/src/content/docs/api/type-aliases/TSimpleParseCommandType.md b/src/content/docs/api/type-aliases/TSimpleParseCommandType.md new file mode 100644 index 000000000..c444d6689 --- /dev/null +++ b/src/content/docs/api/type-aliases/TSimpleParseCommandType.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TSimpleParseCommandType" +--- + +> **TSimpleParseCommandType** = `"L"` \| `"M"` \| `"C"` \| `"Q"` \| `"Z"` + +Defined in: [src/util/path/typedefs.ts:294](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L294) diff --git a/src/content/docs/api/type-aliases/TSimpleParsedCommand.md b/src/content/docs/api/type-aliases/TSimpleParsedCommand.md new file mode 100644 index 000000000..2d5702a47 --- /dev/null +++ b/src/content/docs/api/type-aliases/TSimpleParsedCommand.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "TSimpleParsedCommand" +--- + +> **TSimpleParsedCommand** = [`TParsedAbsoluteMoveToCommand`](/api/type-aliases/tparsedabsolutemovetocommand/) \| [`TParsedAbsoluteLineCommand`](/api/type-aliases/tparsedabsolutelinecommand/) \| [`TParsedAbsoluteClosePathCommand`](/api/type-aliases/tparsedabsoluteclosepathcommand/) \| [`TParsedAbsoluteCubicCurveCommand`](/api/type-aliases/tparsedabsolutecubiccurvecommand/) \| [`TParsedAbsoluteQuadraticCurveCommand`](/api/type-aliases/tparsedabsolutequadraticcurvecommand/) + +Defined in: [src/util/path/typedefs.ts:287](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L287) + +Any SVG command that all Fabric functions can understand diff --git a/src/content/docs/api/type-aliases/TSimplePathData.md b/src/content/docs/api/type-aliases/TSimplePathData.md new file mode 100644 index 000000000..e779549a8 --- /dev/null +++ b/src/content/docs/api/type-aliases/TSimplePathData.md @@ -0,0 +1,12 @@ +--- +editUrl: false +next: false +prev: false +title: "TSimplePathData" +--- + +> **TSimplePathData** = [`TSimpleParsedCommand`](/api/type-aliases/tsimpleparsedcommand/)[] + +Defined in: [src/util/path/typedefs.ts:321](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L321) + +A series of simple paths diff --git a/src/content/docs/api/type-aliases/TSize.md b/src/content/docs/api/type-aliases/TSize.md index 98ddf50fd..aa011beed 100644 --- a/src/content/docs/api/type-aliases/TSize.md +++ b/src/content/docs/api/type-aliases/TSize.md @@ -5,18 +5,22 @@ prev: false title: "TSize" --- -> **TSize**: `object` +> **TSize** = `object` -## Type declaration +Defined in: [src/typedefs.ts:34](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L34) + +## Properties ### height > **height**: `number` +Defined in: [src/typedefs.ts:36](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L36) + +*** + ### width > **width**: `number` -## Defined in - -[src/typedefs.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L34) +Defined in: [src/typedefs.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L35) diff --git a/src/content/docs/api/type-aliases/TTextureCache.md b/src/content/docs/api/type-aliases/TTextureCache.md index dbe5ca2f1..780aeb4f7 100644 --- a/src/content/docs/api/type-aliases/TTextureCache.md +++ b/src/content/docs/api/type-aliases/TTextureCache.md @@ -5,8 +5,6 @@ prev: false title: "TTextureCache" --- -> **TTextureCache**: `Record`\<`string`, `WebGLTexture`\> +> **TTextureCache** = `Record`\<`string`, `WebGLTexture`\> -## Defined in - -[src/filters/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L6) +Defined in: [src/filters/typedefs.ts:6](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L6) diff --git a/src/content/docs/api/type-aliases/TToCanvasElementOptions.md b/src/content/docs/api/type-aliases/TToCanvasElementOptions.md index 257137d0b..41b494789 100644 --- a/src/content/docs/api/type-aliases/TToCanvasElementOptions.md +++ b/src/content/docs/api/type-aliases/TToCanvasElementOptions.md @@ -5,42 +5,62 @@ prev: false title: "TToCanvasElementOptions" --- -> **TToCanvasElementOptions**\<`T`\>: `object` +> **TToCanvasElementOptions**\<`T`\> = `object` + +Defined in: [src/typedefs.ts:106](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L106) ## Type Parameters -• **T** *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) = [`BaseFabricObject`](/api/classes/basefabricobject/) +### T + +`T` *extends* [`BaseFabricObject`](/api/classes/basefabricobject/) = [`BaseFabricObject`](/api/classes/basefabricobject/) -## Type declaration +## Properties ### filter()? > `optional` **filter**: (`object`) => `boolean` +Defined in: [src/typedefs.ts:113](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L113) + #### Parameters -• **object**: `T` +##### object + +`T` #### Returns `boolean` +*** + ### height? > `optional` **height**: `number` +Defined in: [src/typedefs.ts:112](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L112) + +*** + ### left? > `optional` **left**: `number` +Defined in: [src/typedefs.ts:109](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L109) + +*** + ### top? > `optional` **top**: `number` +Defined in: [src/typedefs.ts:110](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L110) + +*** + ### width? > `optional` **width**: `number` -## Defined in - -[src/typedefs.ts:100](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L100) +Defined in: [src/typedefs.ts:111](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L111) diff --git a/src/content/docs/api/type-aliases/TValidToObjectMethod.md b/src/content/docs/api/type-aliases/TValidToObjectMethod.md index 0e563027c..6336a994a 100644 --- a/src/content/docs/api/type-aliases/TValidToObjectMethod.md +++ b/src/content/docs/api/type-aliases/TValidToObjectMethod.md @@ -5,8 +5,6 @@ prev: false title: "TValidToObjectMethod" --- -> **TValidToObjectMethod**: `"toDatalessObject"` \| `"toObject"` +> **TValidToObjectMethod** = `"toDatalessObject"` \| `"toObject"` -## Defined in - -[src/typedefs.ts:87](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/typedefs.ts#L87) +Defined in: [src/typedefs.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/typedefs.ts#L91) diff --git a/src/content/docs/api/type-aliases/TVerticalLineCommand.md b/src/content/docs/api/type-aliases/TVerticalLineCommand.md new file mode 100644 index 000000000..7f3ce2470 --- /dev/null +++ b/src/content/docs/api/type-aliases/TVerticalLineCommand.md @@ -0,0 +1,10 @@ +--- +editUrl: false +next: false +prev: false +title: "TVerticalLineCommand" +--- + +> **TVerticalLineCommand** = `TCommand2`\<[`TParsedVerticalLineCommand`](/api/type-aliases/tparsedverticallinecommand/)\> + +Defined in: [src/util/path/typedefs.ts:136](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/path/typedefs.ts#L136) diff --git a/src/content/docs/api/type-aliases/TWebGLAttributeLocationMap.md b/src/content/docs/api/type-aliases/TWebGLAttributeLocationMap.md index 2637964ce..f68f170a6 100644 --- a/src/content/docs/api/type-aliases/TWebGLAttributeLocationMap.md +++ b/src/content/docs/api/type-aliases/TWebGLAttributeLocationMap.md @@ -5,8 +5,6 @@ prev: false title: "TWebGLAttributeLocationMap" --- -> **TWebGLAttributeLocationMap**: `Record`\<`string`, `number`\> +> **TWebGLAttributeLocationMap** = `Record`\<`string`, `number`\> -## Defined in - -[src/filters/typedefs.ts:52](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L52) +Defined in: [src/filters/typedefs.ts:52](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L52) diff --git a/src/content/docs/api/type-aliases/TWebGLPipelineState.md b/src/content/docs/api/type-aliases/TWebGLPipelineState.md index 59681032a..2b1d418a6 100644 --- a/src/content/docs/api/type-aliases/TWebGLPipelineState.md +++ b/src/content/docs/api/type-aliases/TWebGLPipelineState.md @@ -5,78 +5,142 @@ prev: false title: "TWebGLPipelineState" --- -> **TWebGLPipelineState**: `object` +> **TWebGLPipelineState** = `object` -## Type declaration +Defined in: [src/filters/typedefs.ts:15](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L15) + +## Properties ### aPosition > **aPosition**: `Float32Array` +Defined in: [src/filters/typedefs.ts:29](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L29) + +*** + ### context > **context**: `WebGLRenderingContext` +Defined in: [src/filters/typedefs.ts:23](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L23) + +*** + ### destinationHeight > **destinationHeight**: `number` +Defined in: [src/filters/typedefs.ts:22](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L22) + +*** + ### destinationWidth > **destinationWidth**: `number` +Defined in: [src/filters/typedefs.ts:21](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L21) + +*** + ### filterBackend > **filterBackend**: [`WebGLFilterBackend`](/api/classes/webglfilterbackend/) +Defined in: [src/filters/typedefs.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L16) + +*** + ### originalHeight > **originalHeight**: `number` +Defined in: [src/filters/typedefs.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L18) + +*** + ### originalTexture > **originalTexture**: `WebGLTexture` +Defined in: [src/filters/typedefs.ts:26](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L26) + +*** + ### originalWidth > **originalWidth**: `number` +Defined in: [src/filters/typedefs.ts:17](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L17) + +*** + ### pass > **pass**: `number` +Defined in: [src/filters/typedefs.ts:31](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L31) + +*** + ### passes > **passes**: `number` +Defined in: [src/filters/typedefs.ts:27](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L27) + +*** + ### programCache > **programCache**: [`TProgramCache`](/api/type-aliases/tprogramcache/) +Defined in: [src/filters/typedefs.ts:30](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L30) + +*** + ### sourceHeight > **sourceHeight**: `number` +Defined in: [src/filters/typedefs.ts:20](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L20) + +*** + ### sourceTexture > **sourceTexture**: `WebGLTexture` \| `null` +Defined in: [src/filters/typedefs.ts:24](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L24) + +*** + ### sourceWidth > **sourceWidth**: `number` +Defined in: [src/filters/typedefs.ts:19](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L19) + +*** + ### targetCanvas > **targetCanvas**: `HTMLCanvasElement` +Defined in: [src/filters/typedefs.ts:32](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L32) + +*** + ### targetTexture > **targetTexture**: `WebGLTexture` \| `null` +Defined in: [src/filters/typedefs.ts:25](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L25) + +*** + ### webgl > **webgl**: `boolean` -## Defined in - -[src/filters/typedefs.ts:15](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L15) +Defined in: [src/filters/typedefs.ts:28](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L28) diff --git a/src/content/docs/api/type-aliases/TWebGLProgramCacheItem.md b/src/content/docs/api/type-aliases/TWebGLProgramCacheItem.md index 47f83ab7a..262b8121b 100644 --- a/src/content/docs/api/type-aliases/TWebGLProgramCacheItem.md +++ b/src/content/docs/api/type-aliases/TWebGLProgramCacheItem.md @@ -5,22 +5,30 @@ prev: false title: "TWebGLProgramCacheItem" --- -> **TWebGLProgramCacheItem**: `object` +> **TWebGLProgramCacheItem** = `object` -## Type declaration +Defined in: [src/filters/typedefs.ts:54](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L54) + +## Properties ### attributeLocations > **attributeLocations**: [`TWebGLAttributeLocationMap`](/api/type-aliases/twebglattributelocationmap/) +Defined in: [src/filters/typedefs.ts:56](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L56) + +*** + ### program > **program**: `WebGLProgram` +Defined in: [src/filters/typedefs.ts:55](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L55) + +*** + ### uniformLocations > **uniformLocations**: [`TWebGLUniformLocationMap`](/api/type-aliases/twebgluniformlocationmap/) -## Defined in - -[src/filters/typedefs.ts:54](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L54) +Defined in: [src/filters/typedefs.ts:57](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L57) diff --git a/src/content/docs/api/type-aliases/TWebGLUniformLocationMap.md b/src/content/docs/api/type-aliases/TWebGLUniformLocationMap.md index 0787e607e..5bbf2bff5 100644 --- a/src/content/docs/api/type-aliases/TWebGLUniformLocationMap.md +++ b/src/content/docs/api/type-aliases/TWebGLUniformLocationMap.md @@ -5,8 +5,6 @@ prev: false title: "TWebGLUniformLocationMap" --- -> **TWebGLUniformLocationMap**: `Record`\<`string`, `WebGLUniformLocation` \| `null`\> +> **TWebGLUniformLocationMap** = `Record`\<`string`, `WebGLUniformLocation` \| `null`\> -## Defined in - -[src/filters/typedefs.ts:47](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/filters/typedefs.ts#L47) +Defined in: [src/filters/typedefs.ts:47](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/filters/typedefs.ts#L47) diff --git a/src/content/docs/api/type-aliases/TextStyle.md b/src/content/docs/api/type-aliases/TextStyle.md index 4aa687408..8c727787f 100644 --- a/src/content/docs/api/type-aliases/TextStyle.md +++ b/src/content/docs/api/type-aliases/TextStyle.md @@ -5,12 +5,10 @@ prev: false title: "TextStyle" --- -> **TextStyle**: `object` +> **TextStyle** = `object` -## Index Signature - - \[`line`: `number` \| `string`\]: `object` +Defined in: [src/shapes/Text/StyledText.ts:18](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L18) -## Defined in +## Index Signature -[src/shapes/Text/StyledText.ts:18](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L18) +\[`line`: `string` \| `number`\]: `object` diff --git a/src/content/docs/api/type-aliases/TextStyleDeclaration.md b/src/content/docs/api/type-aliases/TextStyleDeclaration.md index b51674cf2..9a7713a1c 100644 --- a/src/content/docs/api/type-aliases/TextStyleDeclaration.md +++ b/src/content/docs/api/type-aliases/TextStyleDeclaration.md @@ -5,8 +5,6 @@ prev: false title: "TextStyleDeclaration" --- -> **TextStyleDeclaration**: `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\> +> **TextStyleDeclaration** = `Partial`\<[`CompleteTextStyleDeclaration`](/api/type-aliases/completetextstyledeclaration/)\> -## Defined in - -[src/shapes/Text/StyledText.ts:16](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/shapes/Text/StyledText.ts#L16) +Defined in: [src/shapes/Text/StyledText.ts:16](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/shapes/Text/StyledText.ts#L16) diff --git a/src/content/docs/api/type-aliases/Transform.md b/src/content/docs/api/type-aliases/Transform.md index 58964006a..590eb7672 100644 --- a/src/content/docs/api/type-aliases/Transform.md +++ b/src/content/docs/api/type-aliases/Transform.md @@ -5,74 +5,118 @@ prev: false title: "Transform" --- -> **Transform**: `object` +> **Transform** = `object` + +Defined in: [src/EventTypeDefs.ts:72](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L72) relative to target's containing coordinate plane both agree on every point -## Type declaration +## Properties ### action? > `optional` **action**: `string` +Defined in: [src/EventTypeDefs.ts:74](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L74) + +*** + ### actionHandler? > `optional` **actionHandler**: [`TransformActionHandler`](/api/type-aliases/transformactionhandler/) +Defined in: [src/EventTypeDefs.ts:75](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L75) + +*** + ### actionPerformed > **actionPerformed**: `boolean` +Defined in: [src/EventTypeDefs.ts:98](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L98) + +*** + ### altKey > **altKey**: `boolean` +Defined in: [src/EventTypeDefs.ts:93](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L93) + +*** + ### corner > **corner**: `string` +Defined in: [src/EventTypeDefs.ts:76](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L76) + +*** + ### ex > **ex**: `number` +Defined in: [src/EventTypeDefs.ts:85](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L85) + +*** + ### ey > **ey**: `number` +Defined in: [src/EventTypeDefs.ts:86](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L86) + +*** + ### height > **height**: `number` +Defined in: [src/EventTypeDefs.ts:91](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L91) + +*** + ### lastX > **lastX**: `number` +Defined in: [src/EventTypeDefs.ts:87](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L87) + +*** + ### lastY > **lastY**: `number` +Defined in: [src/EventTypeDefs.ts:88](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L88) + +*** + ### offsetX > **offsetX**: `number` -### offsetY +Defined in: [src/EventTypeDefs.ts:81](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L81) -> **offsetY**: `number` +*** -### originX +### offsetY -> **originX**: [`TOriginX`](/api/type-aliases/toriginx/) +> **offsetY**: `number` -### originY +Defined in: [src/EventTypeDefs.ts:82](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L82) -> **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +*** ### original -> **original**: `ReturnType`\<*typeof* [`saveObjectTransform`](/api/namespaces/util/functions/saveobjecttransform/)\> & `object` +> **original**: `ReturnType`\<*typeof* [`saveObjectTransform`](/api/fabric/namespaces/util/functions/saveobjecttransform/)\> & `object` -#### Type declaration +Defined in: [src/EventTypeDefs.ts:94](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L94) + +#### Type Declaration ##### originX @@ -82,38 +126,82 @@ both agree on every point > **originY**: [`TOriginY`](/api/type-aliases/toriginy/) +*** + +### originX + +> **originX**: [`TOriginX`](/api/type-aliases/toriginx/) + +Defined in: [src/EventTypeDefs.ts:83](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L83) + +*** + +### originY + +> **originY**: [`TOriginY`](/api/type-aliases/toriginy/) + +Defined in: [src/EventTypeDefs.ts:84](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L84) + +*** + ### scaleX > **scaleX**: `number` +Defined in: [src/EventTypeDefs.ts:77](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L77) + +*** + ### scaleY > **scaleY**: `number` +Defined in: [src/EventTypeDefs.ts:78](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L78) + +*** + ### shiftKey > **shiftKey**: `boolean` +Defined in: [src/EventTypeDefs.ts:92](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L92) + +*** + ### skewX > **skewX**: `number` +Defined in: [src/EventTypeDefs.ts:79](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L79) + +*** + ### skewY > **skewY**: `number` +Defined in: [src/EventTypeDefs.ts:80](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L80) + +*** + ### target > **target**: [`FabricObject`](/api/classes/fabricobject/) +Defined in: [src/EventTypeDefs.ts:73](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L73) + +*** + ### theta > **theta**: [`TRadian`](/api/type-aliases/tradian/) +Defined in: [src/EventTypeDefs.ts:89](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L89) + +*** + ### width > **width**: `number` -## Defined in - -[src/EventTypeDefs.ts:66](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L66) +Defined in: [src/EventTypeDefs.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L90) diff --git a/src/content/docs/api/type-aliases/TransformAction.md b/src/content/docs/api/type-aliases/TransformAction.md index ab135d9b0..bfe06ffff 100644 --- a/src/content/docs/api/type-aliases/TransformAction.md +++ b/src/content/docs/api/type-aliases/TransformAction.md @@ -5,28 +5,38 @@ prev: false title: "TransformAction" --- -> **TransformAction**\<`T`, `R`\>: (`eventData`, `transform`, `x`, `y`) => `R` +> **TransformAction**\<`T`, `R`\> = (`eventData`, `transform`, `x`, `y`) => `R` + +Defined in: [src/EventTypeDefs.ts:35](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L35) ## Type Parameters -• **T** *extends* [`Transform`](/api/type-aliases/transform/) = [`Transform`](/api/type-aliases/transform/) +### T + +`T` *extends* [`Transform`](/api/type-aliases/transform/) = [`Transform`](/api/type-aliases/transform/) + +### R -• **R** = `void` +`R` = `void` ## Parameters -• **eventData**: [`TPointerEvent`](/api/type-aliases/tpointerevent/) +### eventData -• **transform**: `T` +[`TPointerEvent`](/api/type-aliases/tpointerevent/) -• **x**: `number` +### transform -• **y**: `number` +`T` -## Returns +### x -`R` +`number` -## Defined in +### y -[src/EventTypeDefs.ts:34](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L34) +`number` + +## Returns + +`R` diff --git a/src/content/docs/api/type-aliases/TransformActionHandler.md b/src/content/docs/api/type-aliases/TransformActionHandler.md index 789918fd5..bc6c80103 100644 --- a/src/content/docs/api/type-aliases/TransformActionHandler.md +++ b/src/content/docs/api/type-aliases/TransformActionHandler.md @@ -5,15 +5,15 @@ prev: false title: "TransformActionHandler" --- -> **TransformActionHandler**\<`T`\>: [`TransformAction`](/api/type-aliases/transformaction/)\<`T`, `boolean`\> +> **TransformActionHandler**\<`T`\> = [`TransformAction`](/api/type-aliases/transformaction/)\<`T`, `boolean`\> + +Defined in: [src/EventTypeDefs.ts:46](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/EventTypeDefs.ts#L46) Control handlers that define a transformation Those handlers run when the user starts a transform and during a transform ## Type Parameters -• **T** *extends* [`Transform`](/api/type-aliases/transform/) = [`Transform`](/api/type-aliases/transform/) - -## Defined in +### T -[src/EventTypeDefs.ts:45](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/EventTypeDefs.ts#L45) +`T` *extends* [`Transform`](/api/type-aliases/transform/) = [`Transform`](/api/type-aliases/transform/) diff --git a/src/content/docs/api/variables/cache.md b/src/content/docs/api/variables/cache.md index 567d95511..c611d06bc 100644 --- a/src/content/docs/api/variables/cache.md +++ b/src/content/docs/api/variables/cache.md @@ -7,6 +7,4 @@ title: "cache" > `const` **cache**: `Cache` -## Defined in - -[src/cache.ts:90](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/cache.ts#L90) +Defined in: [src/cache.ts:90](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/cache.ts#L90) diff --git a/src/content/docs/api/variables/classRegistry.md b/src/content/docs/api/variables/classRegistry.md index 95f567120..2360e42c4 100644 --- a/src/content/docs/api/variables/classRegistry.md +++ b/src/content/docs/api/variables/classRegistry.md @@ -7,6 +7,4 @@ title: "classRegistry" > `const` **classRegistry**: `ClassRegistry` -## Defined in - -[src/ClassRegistry.ts:62](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/ClassRegistry.ts#L62) +Defined in: [src/ClassRegistry.ts:62](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/ClassRegistry.ts#L62) diff --git a/src/content/docs/api/variables/config.md b/src/content/docs/api/variables/config.md index b3c4abb15..b58da3193 100644 --- a/src/content/docs/api/variables/config.md +++ b/src/content/docs/api/variables/config.md @@ -7,6 +7,4 @@ title: "config" > `const` **config**: `Configuration` -## Defined in - -[src/config.ts:164](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/config.ts#L164) +Defined in: [src/config.ts:158](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/config.ts#L158) diff --git a/src/content/docs/api/variables/iMatrix.md b/src/content/docs/api/variables/iMatrix.md index 8fb8bbc56..7ca0768e4 100644 --- a/src/content/docs/api/variables/iMatrix.md +++ b/src/content/docs/api/variables/iMatrix.md @@ -7,6 +7,4 @@ title: "iMatrix" > `const` **iMatrix**: [`TMat2D`](/api/type-aliases/tmat2d/) -## Defined in - -[src/constants.ts:13](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/constants.ts#L13) +Defined in: [src/constants.ts:14](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/constants.ts#L14) diff --git a/src/content/docs/api/variables/runningAnimations.md b/src/content/docs/api/variables/runningAnimations.md index 823a43b45..460eaf23f 100644 --- a/src/content/docs/api/variables/runningAnimations.md +++ b/src/content/docs/api/variables/runningAnimations.md @@ -7,6 +7,4 @@ title: "runningAnimations" > `const` **runningAnimations**: `AnimationRegistry` -## Defined in - -[src/util/animation/AnimationRegistry.ts:59](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/util/animation/AnimationRegistry.ts#L59) +Defined in: [src/util/animation/AnimationRegistry.ts:59](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/util/animation/AnimationRegistry.ts#L59) diff --git a/src/content/docs/api/variables/version.md b/src/content/docs/api/variables/version.md index 340481e26..d57c69621 100644 --- a/src/content/docs/api/variables/version.md +++ b/src/content/docs/api/variables/version.md @@ -7,6 +7,4 @@ title: "version" > `const` **version**: `string` -## Defined in - -[src/constants.ts:5](https://github.com/fabricjs/fabric.js/blob/5c1240d8b4662e45868dd33f385f941de21c8e9c/src/constants.ts#L5) +Defined in: [src/constants.ts:5](https://github.com/fabricjs/fabric.js/blob/9a792f4b7b8031f02ec7ea4ce8c99f810e45cfec/src/constants.ts#L5) diff --git a/src/content/docs/docs/Getting started/Installing.md b/src/content/docs/docs/Getting started/Installing.md index b74d115ba..05329aefe 100644 --- a/src/content/docs/docs/Getting started/Installing.md +++ b/src/content/docs/docs/Getting started/Installing.md @@ -1,14 +1,14 @@ --- date: '2015-03-10' title: 'Getting started' -description: 'Getting started with FabricJS' +description: 'Getting started with Fabric.js' sidebar: - order: 1 + order: 100 --- ## Installation -FabricJS can be made available via following approaches as suited by your project +Fabric.js can be made available via following approaches as suited by your project ### Using from CDN via script tag diff --git a/src/content/docs/docs/Getting started/helloworld.mdx b/src/content/docs/docs/Getting started/helloworld.mdx index 263869d7d..820d5d2a4 100644 --- a/src/content/docs/docs/Getting started/helloworld.mdx +++ b/src/content/docs/docs/Getting started/helloworld.mdx @@ -3,7 +3,7 @@ date: '2024-07-01' title: 'Your first app' description: 'Your hello world application' sidebar: - order: 2 + order: 200 --- import { CodeEditor } from '../../../../components/CodeEditor'; diff --git a/src/content/docs/docs/Old docs/changelog.md b/src/content/docs/docs/Old docs/changelog.md index 3a4ba9d40..61552cc02 100644 --- a/src/content/docs/docs/Old docs/changelog.md +++ b/src/content/docs/docs/Old docs/changelog.md @@ -387,29 +387,34 @@ Added strokeUniform property, that lets you scale objects without d Mostly svg fixes for this release, on input and output ``` - Fix: Shift click and onSelect function #5348 -- Fix: Load from Json from images with filters and resize filters #5346``` +- Fix: Load from Json from images with filters and resize filters #5346 +``` ### Version 2.5.0 Mostly svg fixes for this release, on input and output ``` - Fix: Shift click and onSelect function #5348 -- Fix: Load from Json from images with filters and resize filters #5346``` +- Fix: Load from Json from images with filters and resize filters #5346 +``` ### Version 2.4.6 Mostly svg fixes for this release, on input and output ``` - Fix: Shift click and onSelect function #5348 -- Fix: Load from Json from images with filters and resize filters #5346``` +- Fix: Load from Json from images with filters and resize filters #5346 +``` ### Version 2.4.5 Mostly svg fixes for this release, on input and output ``` - Fix: Shift click and onSelect function #5348 -- Fix: Load from Json from images with filters and resize filters #5346``` +- Fix: Load from Json from images with filters and resize filters #5346 +``` ### Version 2.4.4 ``` - Fix: add clipPath to stateful cache check. #5384 - Fix: restore draggability of small objects #5379 - Improvement: Added strokeDashOffset to objects and from SVG import. #5398 - Fix: do not mark objects as invisible if strokeWidth is > 0 #5382 -- Improvement: Better gradients parsing with xlink:href #5357``` +- Improvement: Better gradients parsing with xlink:href #5357 +``` ### Version 2.4.3 A handful of fixes for group and clipPaths, Image serializations and filters, click interactions ``` @@ -417,14 +422,16 @@ A handful of fixes for group and clipPaths, Image serializations and filters, cl - Fix: Load from Json from images with filters and resize filters #5346 - Fix: Remove special case of 1x1 rect #5345 - Fix: Group with clipPath restore #5344 -- Fix: Fix shift + click interaction with unselectable objects #5324``` +- Fix: Fix shift + click interaction with unselectable objects #5324 +``` ### Version 2.4.2 Clippath to SVG fixed, a couple of nice bugfixes for targeting in nested groups and svg loading in ie11 ``` - Fix: Better toSVG support to enable clipPath #5284 - Fix: Per pixel target find and groups and sub targets #5287 - Fix: Object clone as Image and shadow clipping #5308 -- Fix: IE11 loading SVG #5307``` +- Fix: IE11 loading SVG #5307 +``` ### Version 2.4.1 First round of feedback for clipPath bugs, plus other bugfixes that piled up while working on clipPaths ``` @@ -435,7 +442,8 @@ First round of feedback for clipPath bugs, plus other bugfixes that piled up whi - Fix: clipPath svg parsing in nodejs #5262 - Fix: Avoid running selection logic on mouse up #5259 - Fix: fix font size parsing on SVG #5258 -- Fix: Avoid extra renders on mouseUp/Down #5256``` +- Fix: Avoid extra renders on mouseUp/Down #5256 +``` ### Version 2.4.0 Launched clipPath support, check tutorial for more info ClipPath tutorials ### Version 2.3.6 @@ -490,12 +498,14 @@ Lot of small IText fixes and a group caching bug removed. - Fix: Enter edit on object selected programmatically. #5010 - Fix: Canvas.dispose was not removing all events properly. #5020 - Fix: Make rgba and hsla regex work case insensitive. #5017 - - Fix: Make group transitioning from not cached to cached work. #5021``` + - Fix: Make group transitioning from not cached to cached work. #5021 + ``` ### Version 2.3.0 Added new events and a performance improvement for pixel transparency on cached object. Cached objects gets now sampled directly on their cached to check for transparency without a repaint. Check the new events here ``` - Add and improve more events for transformations and mouse interaction #4979 -- Improvement: whenever possible use cache for target transparency sampling #4955``` +- Improvement: whenever possible use cache for target transparency sampling #4955 +``` ### Version 2.2.4 Just fixes to brushes, filters and events mostly coming from contributors. A new method is added isPartiallyOnscreen for objects, helps you identify when the object is crossing your viewport boundaries and an important bug in statefull processing is fixed that was causing type errors when comparing an array with null or an object with null or a string diff --git a/src/content/docs/docs/Old docs/control-api.md b/src/content/docs/docs/Old docs/control-api.md index b1022f217..f04c79de4 100644 --- a/src/content/docs/docs/Old docs/control-api.md +++ b/src/content/docs/docs/Old docs/control-api.md @@ -10,7 +10,7 @@ This api is for fabricJS 4.0, the api and the text is currently in beta. Some li This api lets the developer create its own custom controls without having to use overrides on standard fabricJS controls method. This makes customizaion supported, easy and makes update to the latest version always possible. -FabricJS uses the api internally to define the standard controls set with the same feature and customization that was possible in version 3 and below. +Fabric.js uses the api internally to define the standard controls set with the same feature and customization that was possible in version 3 and below. ### How does it work. @@ -45,7 +45,7 @@ Default controls are defined here: [standard controls definition](https://github #### visible and getVisibility -Before FabricJS 4.0 controls could be set as non visible, to be ignored. +Before Fabric.js 4.0 controls could be set as non visible, to be ignored. Now controls can either exist, non exist, but also be temporary invsisible depending on object status. The default `getVisibility` function of the control will either return the standard object `_controlsVisibility` property that has been mantained for compatibility reason, or in case that is not set will return the control `.visible` value. @@ -55,7 +55,7 @@ Controls are generally shared among instances, so setting a control to `.visible #### actioname and getActionName The property actionName gives the name of the action that the controll will likely execute. -This is used to fire the event during the action, and also 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 somewhere else in the code what is going on, you can use this string here and listen to the resulting event. +This is used to fire the event during the action, and also Fabric.js uses to identify what the user is doing for some extra optimizations. If you are writing a custom control and you want to know somewhere else in the code what is going on, you can use this string here and listen to the resulting event. The old naming convention of events is still respected. So a scale action will still fire the event `scaling` and `object:scaling`. But will also fire an extra event `scale` or `scaleX` because that is the action name. So when creating your custom action handler ( if needed ) you can choose if explicitly fire an event with the name you want in your action handler or let fabric fire an event with the same name of the action name. diff --git a/src/content/docs/docs/Old docs/fabric-filters.md b/src/content/docs/docs/Old docs/fabric-filters.md index debfd7a78..d46aed326 100644 --- a/src/content/docs/docs/Old docs/fabric-filters.md +++ b/src/content/docs/docs/Old docs/fabric-filters.md @@ -139,7 +139,7 @@ That's it. At this point the image data has been changed, the function does not #### The WEBGL version -The WEBGL version require to write a fragment shader insted of javascript function. FabricJS provides a standard function that does not change anything to start with. I will not go in detail of what you can do or not do with WEBGL, since i have not the necessary expertise an since there is much material out ther with lot of explanations. +The WEBGL version require to write a fragment shader insted of javascript function. Fabric.js provides a standard function that does not change anything to start with. I will not go in detail of what you can do or not do with WEBGL, since i have not the necessary expertise an since there is much material out ther with lot of explanations. The basic fragment shader looks like this: ```js /** diff --git a/src/content/docs/docs/Old docs/fabric-intro-part-1.md b/src/content/docs/docs/Old docs/fabric-intro-part-1.md index 0734faddc..b2a776fc1 100644 --- a/src/content/docs/docs/Old docs/fabric-intro-part-1.md +++ b/src/content/docs/docs/Old docs/fabric-intro-part-1.md @@ -1,6 +1,6 @@ --- date: '2012-06-25' -description: 'Understanding what FabricJS is in order to better use it in your projects' +description: 'Understanding what Fabric.js is in order to better use it in your projects' title: Introduction to Fabric.js. Part 1 --- diff --git a/src/content/docs/docs/Old docs/fabric-intro-part-2.md b/src/content/docs/docs/Old docs/fabric-intro-part-2.md index fb3835b27..9ac651a64 100644 --- a/src/content/docs/docs/Old docs/fabric-intro-part-2.md +++ b/src/content/docs/docs/Old docs/fabric-intro-part-2.md @@ -1,6 +1,6 @@ --- date: '2012-07-25' -description: 'Understanding what FabricJS is in order to better use it in your projects' +description: 'Understanding what Fabric.js is in order to better use it in your projects' title: Introduction to Fabric.js. Part 2 --- diff --git a/src/content/docs/docs/Old docs/fabric-intro-part-3.md b/src/content/docs/docs/Old docs/fabric-intro-part-3.md index 0522ff963..f2f447249 100644 --- a/src/content/docs/docs/Old docs/fabric-intro-part-3.md +++ b/src/content/docs/docs/Old docs/fabric-intro-part-3.md @@ -1,6 +1,6 @@ --- date: '2012-08-12' -description: 'Understanding what FabricJS is in order to better use it in your projects' +description: 'Understanding what Fabric.js is in order to better use it in your projects' title: Introduction to Fabric.js. Part 3 --- diff --git a/src/content/docs/docs/Old docs/fabric-intro-part-4.md b/src/content/docs/docs/Old docs/fabric-intro-part-4.md index 0918827c3..ee2a21891 100644 --- a/src/content/docs/docs/Old docs/fabric-intro-part-4.md +++ b/src/content/docs/docs/Old docs/fabric-intro-part-4.md @@ -1,6 +1,6 @@ --- date: '2012-12-21' -description: 'Understanding what FabricJS is in order to better use it in your projects' +description: 'Understanding what Fabric.js is in order to better use it in your projects' title: Introduction to Fabric.js. Part 4 --- diff --git a/src/content/docs/docs/Old docs/fabric-intro-part-5.md b/src/content/docs/docs/Old docs/fabric-intro-part-5.md index 4bb52672d..d4e0617f6 100644 --- a/src/content/docs/docs/Old docs/fabric-intro-part-5.md +++ b/src/content/docs/docs/Old docs/fabric-intro-part-5.md @@ -1,10 +1,10 @@ --- date: '2017-06-17' -description: 'Understanding what FabricJS is in order to better use it in your projects' +description: 'Understanding what Fabric.js is in order to better use it in your projects' title: Introduction to Fabric.js. Part 5 --- -## Zoom and pan, introduction to FabricJS part 5 +## Zoom and pan, introduction to Fabric.js part 5 We've covered so many topics in the previous series; from basic object manipulations to animations, events, filters, groups, and subclasses. But there's still couple of very interesting and useful things to discuss! diff --git a/src/content/docs/docs/Old docs/fabric-object-caching.mdx b/src/content/docs/docs/Old docs/fabric-object-caching.mdx deleted file mode 100644 index 3320fbe05..000000000 --- a/src/content/docs/docs/Old docs/fabric-object-caching.mdx +++ /dev/null @@ -1,177 +0,0 @@ ---- -date: '2016-11-26' -description: 'Caching of object, properties and beahvior' -title: Caching of object, properties and beahvior ---- -import { Example1, Example2, Example3 } from './fabric-object-caching/fabric-object-caching.jsx'; - -### How does it work? - -When fabric object caching is active, the objects you paint on canvas are actually pre painted on another smaller offscreen canvas, as big as the object pixel dimension itself. During the `render` method this pre painted canvas gets copied on the main canvas with a `drawImage` operation. - -That means that during `drag` `rotate` `skew` `scale` operations the object is not redrawn on canvas, but just its copied cached image gets drawn over the canvas. - -### How can I tweak/customize it? - -This feature comes with 3 properties to use it in different ways: -```js -/** - * When `true`, object is cached on an additional canvas. - * default to true - * since 1.7.0 - * @type Boolean - * @default - */ -objectCaching: objectCaching, - -/** - * When `true`, object properties are checked for cache invalidation. In some particular - * situation you may want this to be disabled ( spray brush, very big pathgroups, groups) - * or if your application does not allow you to modify properties for groups child you want - * to disable it for groups. - * default to false - * since 1.7.0 - * @type Boolean - * @default - */ -statefullCache: false, - -/** - * 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. - * default to false - * since 1.7.0 - * @type Boolean - * @default - */ -noScaleCache: true, - -/** - * List of properties to consider when checking if cache needs refresh - * Those properties are checked by statefullCache ON ( or lazy mode if we want ) or from single - * 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 - * @type Array - */ -cacheProperties: ( - 'fill stroke strokeWidth strokeDashArray width height stroke strokeWidth strokeDashArray' + - ' strokeLineCap strokeLineJoin strokeMiterLimit fillRule backgroundColor' -).split(' '), - -/** - * When set to `true`, object's cache will be rerendered next render call. - * @type Boolean - * @default true - */ -dirty: true, - -/** - * When return `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. - * since 1.7.12 - * @type function - * @return false - */ - needsItsOwnCache: function() { - return false; - }, - - /** - * Pixel limit for cache canvases. 1Mpx , 4Mpx should be fine. - * @since 1.7.14 - * @type Number - * @default - */ -fabric.perfLimitSizeTotal = 2097152; - -/** - * Pixel limit for cache canvases width or height. IE fixes the maximum at 5000 - * @since 1.7.14 - * @type Number - * @default - */ -fabric.maxCacheSideLimit = 4096; - -/** - * Lowest pixel limit for cache canvases, set at 256PX - * @since 1.7.14 - * @type Number - * @default - */ -fabric.minCacheSideLimit = 256; -``` - -`objectCaching` is the main properties, default to true for browsers, false for node, it enables objectCaching at object level. -`statefullCache` This property rule if fabric should autocheck if is time to redraw the cached copy or if the dev shoud manually invalidate it. this property is default to false. More on this later. -`noScaleCache` default to true, disable cache regeneration for scale operation. It can be enabled to avoid blurry effects for big scaling. -`cacheProperties` Every time Object.set(key, value) is called, key is searched in this array of properties. If found it mark the object as needing a re render. StatefullCache set to true instead exentesively compare all the keys with a copy of the old values at each render. -`dirty` is a simple flag that force a cache rerender at next render method, and is set to false automatically after cache regeneration. `fabric.perfLimitSizeTotal` Max size in pixel area of generated cache canvases. -`fabric.maxCacheSideLimit` Max size in pixel of the largest side of the cache canvas. ( numbers bigger than 5000 breaks IE ) -`fabric.minCacheSideLimit` Max size in pixel of the minimal side of the cache canvas. ( numbers smaller than 256 can disable gpu compositing. to be verified ) - -Example of a cache canvas that is bigger than the drawn object (256x256 is the minimum by default): - -![](/article_assets/carMinCache.png) - -Example of the biggest size cache canvas at default values ( 2 Mega pixels ). Scroll to see something: - -### How much performance gain I get, are there any problems? - -It depends on what your project looks like. Are you drawing just a bunch of circles, rects and simple polygons? Maybe you will not gain that much performance. -Are you importing and displaying large and complex svgs? well you will move from possibly shuttering to smooth. Is there any glich I should be aware of? Well you may not like the `noScaleCache` feature and that is why there is a flag to disable it. - -### What about compatibility problem with my current project? Should I update? Can I disable caching? - -I would say yes, switch to 1.7.0, check if everything is fine. If not report any visual problem to issue tracker, you can still completly disable the feature everywhere doing: - -fabric.Object.prototype.objectCaching = false; - -to override the standard value and cache will be disabled for your project. - -### Live samples - -Below you can see 2 fabric canvases. The left one is the default cached one, while the right one is drawn with cache disabled as it was on previous versions. -The canvases are loaded with heavy pathgroups, the snowwhite, the heaviest I could find is in 3 copies and makes the render speed cripple down. Try to drag around one of the shapes on the left or right canvas and notice the speed difference. - - - - -Also spot differences in scaling between `noScaleCache` with values true or false. -In canvases below Left canvas is `false`, that means that during the scaling tasnformation the obect is not regenerated. if you scale an object more than 3 times the original size you will notice blurring that then gets fixed with a new cached copy as soon as you perform a mouse up. Try it by yourself: - - - - -### When does the cache gets updated with a new version? - -Fabric has a hardcoded trigger to update the cache during the built in functions where the developer has no easy way to insert code. -Those situations are: `scaling`, `typing text`, `canvas global zoom`. -In all other cases, it's the developer that's changing some property of an object, and should therefore make sure to force a cache update by setting the object's `dirty` property to true when necessary. So calling `object.set('fill', 'red')` require no other actions. If for some reason you are not using the set method (for example in situation of text objects in which setting some properties triggers expensive functions) you will use the flag. -There is also a way to ask fabric to check at render time a change for properties. This is not expensive most of the time but I decided to leave it off because in crowded situations ( like spray brush or 1000+ svg paths ) it was expensive. -Groups and PathGroups are taken care of in this way: -When an object gets set a property, the property is checked, if it is in the `cacheProperties` array, the object and the group is set as dirty. If the property is in the `stateProperties` array, only the group is set as dirty. - -### How does fabric check for changes in custom subclasses with custom properties? - -Custom subclassing is one of the fabric strongest features in my opinion and object caching has been built with that in mind.. So there is an array defined called `cacheProperties` that contains a list of properties that get checked at every render when the property `statefullCache` is set true. (defaults to false). -The array looks like this: -```js - cacheProperties: ( - 'fill stroke strokeWidth strokeDashArray width height' + - ' strokeLineCap strokeLineJoin strokeMiterLimit fillRule backgroundColor' - ).split(' '), -``` -and gets more properties in different sublcasses, for example rect adds `rx` and `ry` and so on. The properties are checked recursively, that means that at every change detected a copy of the property is saved, and at next render is compared deeply. Normally properties that need deep checks are gradients, patterns, path array, strokeDash. If your application make no use of some properties at all you can remove them from the cacheProperties array and make the check faster, or you can add your custom properties that influence rendering to have them checked. - -### Gotchas - -Image is cut of of object bounding box: **YES**. There is an invisible canvas that keep a copy of the object. This canvas is sized with objects width/height. If width and height are not correct for the object we are trying to display, the image will be cut off. There is no other solution than disable the caching for the object or fix the problem. -Currently affected uses case: - -- (mainly solved since 1.7.7) sometimes things can look blurry -- (mainly solved since 1.7.8) paths with wrongly parsed command sequence (very few) -- (mainly solved since 1.7.3) Text using custom fonts with very big ascender/descender and of wich canvas is not able to measure extension. -- Groups not initialized correctly ( created empty and not updated after using the .add method, please use addWithUpdate) -- Scaling events that reset scale and modify width/height, disable `noScaleCache`, set it to false \ No newline at end of file diff --git a/src/content/docs/docs/Old docs/fabric-text.md b/src/content/docs/docs/Old docs/fabric-text.md index 9ed312a8d..683ecafd9 100644 --- a/src/content/docs/docs/Old docs/fabric-text.md +++ b/src/content/docs/docs/Old docs/fabric-text.md @@ -1,7 +1,7 @@ --- date: '2017-08-11' -description: 'FabricJS Text' -title: FabricJS Text +description: 'Fabric.js Text' +title: Fabric.js Text --- ### An introduction to fabricjs Text 2.0 diff --git a/src/content/docs/docs/Old docs/gotchas.md b/src/content/docs/docs/Old docs/gotchas.md index a62c370f8..3639925cd 100644 --- a/src/content/docs/docs/Old docs/gotchas.md +++ b/src/content/docs/docs/Old docs/gotchas.md @@ -33,13 +33,13 @@ This affects SVG export too. Sometimes in prototypes and quick proof of concepts, people change fabric objects properties with text inputs. Fabric documentation states that top, left, scaleX, angle and other properties requires numbers as values. -**Text inputs return strings.** FabricJS does not check types and does not convert them, when it does convert a string to a number is because of a side effect of some code and is not a feature to rely on. +**Text inputs return strings.** Fabric.js does not check types and does not convert them, when it does convert a string to a number is because of a side effect of some code and is not a feature to rely on. Use parseInt and parseFloat before assigning a value to a property that requires a number. ### Object does not update after changing property - objectCaching A common source of confusion is when a developer assigns a new property to fill and the objects does not update after a renderAll. -FabricJS does cache objects as images to speed up rendering. If you want fabricJS to know that something changed and that a particular object needs to be redrawn, use the `set` method. +Fabric.js does cache objects as images to speed up rendering. If you want fabricJS to know that something changed and that a particular object needs to be redrawn, use the `set` method. ```ts rect.set('fill', 'red'); @@ -54,9 +54,21 @@ or, as an alternative: ``` For more information and detailed explanation, check the [dedicated caching page](/docs/old-docs/fabric-object-caching/). + ### Objects have a transparent stroke of width 1 by default -By default, objects have a transparent stroke of width 1 that shift them by 0.5 pixel horizontally and vertically. This will make hard for you to position objects at exact position. There are a couple of reason for this: - if it had no strokeWidth, setting stroke color would bring no results - SVG have the same default so for svg import it made sense to do so - Before fabric v1.5 stroke wasn't part of the control bounding box and position so this wasn't an issue. To remove the stroke: +By default, objects have a transparent stroke of width 1 that shift their bounding box by 0.5 pixel horizontally and vertically from the fill. + +This is not apparent if you work with rect that have sizes of 200-300 and above, but when dealing with small rectangle this gap is clear and when streching the rectangle in one direction only is even more evident. + +This gap is the stroke, the border that is being drawn transparent. + +There are a couple of reason for this: +- if it had no strokeWidth, setting stroke color would bring no results +- SVG have the same default so for svg import it made sense to do so +- Before fabric v1.5 stroke wasn't part of the control bounding box and position so this wasn't an issue. + +To remove the stroke: ```js rect.set('strokeWidth', 0); diff --git a/src/content/docs/docs/Understanding FabricJS/index.md b/src/content/docs/docs/Understanding FabricJS/index.md deleted file mode 100644 index 199d16518..000000000 --- a/src/content/docs/docs/Understanding FabricJS/index.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -date: '2015-03-11' -title: 'Understanding FabricJS' -description: 'Understanding what FabricJS is in order to better use it in your projects' ---- - -In this guide, we'll get started with the basics of FabricJS - -## Understanding the HTML5 canvas - -Some intro to HTML-5 canvas and background about **immediate-mode-rendering** and how FabricJS provides methods similar to how **retained-mode-rendering** programs render. With retained-mode, the user basically manipulates the scene-graph and the rendering of the pixels is taken care by a utility, in this case FabricJS - -## Understanding FabricJS object model - -Include some info about the architecture of FabricJS and how it handles drawing on the canvas - -## External resources - -Some links to external resources on rendering, creative-programming and graphics-programming diff --git a/src/content/docs/docs/Upgrading/Upgrading to fabric 6.0.mdx b/src/content/docs/docs/Upgrading/Upgrading to fabric 6.0.mdx index d602b6709..773caa8a7 100644 --- a/src/content/docs/docs/Upgrading/Upgrading to fabric 6.0.mdx +++ b/src/content/docs/docs/Upgrading/Upgrading to fabric 6.0.mdx @@ -1,7 +1,7 @@ --- date: '2024-06-29' -title: 'Upgrading to FabricJS 6.0' -description: 'Understanding the general changes to FabricJS 6.0' +title: 'Upgrading to Fabric.js 6.0' +description: 'Understanding the general changes to Fabric.js 6.0' --- Fabric 6.0 has been a large rewrite and not all breaking changes have a suggested action items. @@ -10,7 +10,7 @@ This is a list of the largest conceptual changes. ## Typescript -FabricJS is now written in Typescript. Types will help you discover the api quickly, especially with things like events. +Fabric.js is now written in Typescript. Types will help you discover the api quickly, especially with things like events. As a consequence of this change if you are using `@types/fabric` you should remove it. ![](/article_assets/autocomplete.gif) @@ -59,7 +59,7 @@ Object.assign(Rect.prototype, { fill: 'black', }); ``` -The class was created with an utility, createKlass that took care of running the custom `initialize` method for every new instance that was created, and that took care of inheritance. +The class was created with an utility, createClass that took care of running the custom `initialize` method for every new instance that was created, and that took care of inheritance. As a result this was the situation: - Default values for properties were defined on the prototype exactly as method were - All Instances shared the same on the prototype for properties that weren't assigned diff --git a/src/content/docs/docs/Upgrading/Upgrading to fabric 7.0.mdx b/src/content/docs/docs/Upgrading/Upgrading to fabric 7.0.mdx new file mode 100644 index 000000000..86f81eb42 --- /dev/null +++ b/src/content/docs/docs/Upgrading/Upgrading to fabric 7.0.mdx @@ -0,0 +1,120 @@ +--- +date: '2025-08-24' +title: 'Upgrading to Fabric.js 7.0' +description: 'Updating your app for Fabric.js 7.0' +--- + +FabricJS 7.0 will be released shortly, this is a **preview** of the breaking changes and an upgrade guide. + +## Breaking changes + +Fabric 7.0 is basically Fabric 6.0 there is no large major change that should stop you from updating. + +The reason for the major version change was the will to move to canvas version 3 and higher, +that itself required jsdom 26 and that required at least node 18, it was bumped to 20 anyway. + +Node 18 was removed too since its support halted in April 2025 and while FabricJS can +still run ok on node 18, vitest 4 does not nor do the latest versions of jsdom. + +Since a major version bump was happening also the list of supported browsers was refreshed to allow +for better transpilation and usage of newer Canvas api. + +The current supported platform list looks like this + +- NodeJS >= 20 +- chrome >= 88 +- safari >= 13 +- firefox >= 85 +- edge >= 88 +- Opera >= 73 + +These browsers have been picked up with date of release of Jan 2021, +so browsers that at the moment of release are nearly 5 years old. + +On top of supported platform changes, there are some notable api changes: + +## Changed default values + +### fireMiddleClick, fireRightClick and stopContextMenu on Canvas + +These 3 booleans have been flipped to default `TRUE`. +This mean that mouse up and down even will fire also for these buttons. +If you have mouse events that have to be triggered only for the left button, you have to safeguard +your event with an early return inspecting the event `button` property OR changing back the default values to fault. + +FabricJS 8.0 will delete these property so changing the default value will not be an option in the future. + +## Removing Opacity from Gradient ColorStop + +FabricJS Gradient class supported ColorStop(s) that had a generic color and an opacity value, +mirroring SVG properties. Now this required that each render we would look at both the color value +for the color-stop and its opacity value and we would mix the 2, parsing a color value each render. + +We decided to drop support for the opacity value and left the only opacity at the color value. +This will still allow you to have semi transparent gradients, but the way you specify or animate the +transparency is different. + +The ColorStop type changes are: + +```diff +export type ColorStop = { + color: string; + offset: number; +- opacity?: number; +}; +``` +The color string supported an alpha value before and still does it, the double opacity is gone, +together with its confusion and performance hit. + +If your application was doing heavy usage of the opacity property and was saving user data, there +is an update you can use to keep the old data working. +You can find it in +```ts +import { installGradientUpdater } from 'fabric/extensions'; + +installGradientUpdater(); +``` +It will wrap the fromObject function of Gradient to take care of the difference. +It is still suggested to clean up your old data when possible. + +## Changes to findTarget + +`Canvas.findTarget` has been refactored. Its result is now cached for the duration of the event, +it finds all the possible targets and uses them where needed for drag actions or normal actions. +The refactor was done mainly to have clearer code since the existing `findTarget` function was hard +to read and maintain + +## Removed deprecations + +### Events +The data duplication between `pointer`/`absolutePointer` and `viewportPoint`/`scenePoint` has been removed. +Now you find only viewportPoint and scenePoint in the events + +### Canvas +- `getCenter` method has been removed, use only `getCenterPoint` +- The internal cache variables `_pointer` and `_absolutePointer` have been renamed to `_viewportPoint` and `_scenePoint` for clarity +- `preserveObjectStacking` is now default to `true`, if you want objects to break the stack when selected, set it to `false` +- `getPointer` deprecated method has been removed, is now a protected `_getPointerImpl` method. +- `setWidth` and `setHeight` are gone, use only `setDimensions({ width, height })` + + +### Objects +#### Text +- unused method `_getSVGLineTopOffset` has been deleted +#### Itext +- protected `_exitEditing` is merged with `exitEditingImpl` public +#### Image +- `CSS_CANVAS` static property from image is gone also with the `classList.Add` requirement + +### Utils +- `rotatePoint` is gone, use `point.rotate` instead +- `request` is gone. We use fetch, node 18 supports fetch. There is no reason to use the old request object and status +- `setStyle` is gone +- `parseAttributes`, `parseStyleAttribute`, `parseFontDeclaration`, `parsePointsAttribute`, `parseTransformAttribute` and `getCSSRules` +have been removed from the package. Those utils were meant for internal usage and never for exposing this part of the api. + +## Non breaking changes + +Thanks to the efforts of [@Smrtnyk](https://github.com/Smrtnyk) QUnit was remove and the unit tests have been migrated to vitest. +DevDependencies and lint rules have been cleaned up too and Github actions now works also on PR from forks. + diff --git a/src/content/docs/docs/configuring-controls.mdx b/src/content/docs/docs/configuring-controls.mdx index e19e43aec..b2797ab68 100644 --- a/src/content/docs/docs/configuring-controls.mdx +++ b/src/content/docs/docs/configuring-controls.mdx @@ -3,7 +3,7 @@ date: '2024-07-01' title: 'Configuring controls' description: '' sidebar: - order: 4 + order: 500 --- import { CodeEditor } from '../../../components/CodeEditor'; @@ -15,7 +15,7 @@ import code5 from './configuring-controls/code5.js?raw'; ## Configuring control handles -FabricJS object's controls have a default configuration that is defined by the control classes and objects' defaults. +Fabric.js object's controls have a default configuration that is defined by the control classes and objects' defaults. Those properties listed here [Object Props](https://github.com/fabricjs/fabric.js/blob/master/src/shapes/Object/types/ObjectProps.ts) and here [Border Props](https://github.com/fabricjs/fabric.js/blob/master/src/shapes/Object/types/BorderProps.ts) are the one influencing controls: ```ts @@ -134,7 +134,7 @@ Comment and change properties in the example below to see the effect: ## Configuring control defaults for every object -Now doing this for every object requires you to pass the options every single object creation, you can create a function to do so or you can change FabricJS default values. +Now doing this for every object requires you to pass the options every single object creation, you can create a function to do so or you can change Fabric.js default values. @@ -164,7 +164,7 @@ If you prefer to have shared controls among instances, you have to act on the de This will let you configure the controls once for all class types, and let you add controls globally at runtime. Each setup comes with pros and cons that depends on your personal preference and project's functionalities. -For this snippet you have to press the runMe button. Once you run it, the above snippets are affected too. +For this snippet you have to press the Run me button. Once you run it, the above snippets are affected too. diff --git a/src/content/docs/docs/configuring-defaults.mdx b/src/content/docs/docs/configuring-defaults.mdx index b20cd4411..82cba43db 100644 --- a/src/content/docs/docs/configuring-defaults.mdx +++ b/src/content/docs/docs/configuring-defaults.mdx @@ -3,7 +3,7 @@ date: '2024-07-01' title: 'Configuring defaults properties' description: '' sidebar: - order: 3 + order: 400 --- import { CodeEditor } from '../../../components/CodeEditor'; @@ -12,7 +12,8 @@ import code1 from './configuring-controls/code1.js?raw'; ## Configuring default controls for objects If you are looking for configuring default controls please check this other page [Configuring controls](/docs/configuring-controls/). -Every object in FabricJS ( rect, path, circle...) come with a serie of state properties that determine how the object looks like and some of the default interactive behaviours. + +Every object in Fabric.js ( rect, path, circle...) come with a serie of state properties that determine how the object looks like and some of the default interactive behaviours. You can configure those value when instantiating the object or you may want to set certain properties at project level and forget about them. There are a couple of common reasons why you would like to do that globally: @@ -43,7 +44,7 @@ new FabricText('Hello World!', { fontFamily: 'Arial' }) // Will have Arial font Take care you need to discover where FontFamily is defined before changing it. Changing FontFamily on FabricObject will have no effect because FabricText has its own default, while setting it on IText or Textbox will leave FabricText with the original default. -As a thumb rule you should change your own defaults once as a way to configure FabricJS to adapt to your application needs. +As a thumb rule you should change your own defaults once as a way to configure Fabric.js to adapt to your application needs. Configuring defaults instead of setting every option on every object instance is something that will reduce clutter in your code, but is not going to be faster or better from a performance point of view. There is a method called `getDefaults()` on the instances. @@ -53,9 +54,9 @@ This method is used on the `toObject` export to optionally avoid to export the d ## A note on Prototype -Differently from FabricJS version 5 and earlier, this won't affect already constructed instances. +Differently from Fabric.js version 5 and earlier, this won't affect already constructed instances. -Javascript Classes syntax does not support properties on the Prototype that FabricJS was leveraging with Objects before. +Javascript Classes syntax does not support properties on the Prototype that Fabric.js was leveraging with Objects before. If you really like the old behaviour you can still switch to it by writing some code. diff --git a/src/content/docs/docs/core-concepts.md b/src/content/docs/docs/core-concepts.md index f7e064ce5..840234542 100644 --- a/src/content/docs/docs/core-concepts.md +++ b/src/content/docs/docs/core-concepts.md @@ -1,54 +1,58 @@ --- date: '2023-08-20' -title: 'Core Concepts' -description: 'Core Concepts' +title: 'Core concepts' +description: 'Core concepts' +sidebar: + order: 300 --- -# Core Concepts +When working with Fabric.js there are many classes and concepts you will have to learn to know. +This is an overview of the main building blocks of Fabric.js -## State +## Canvas -State is comprised of 2 aspects. The **logical** state and the **visual** state. -The **visual** state is our end game, what the user sees, whereas the **logical** state is what exists under the hood. -The 2 are deeply intertwined. However, in many cases, looking at a problem with this concept in mind produces much simpler and performant solutions. +The main container for Fabric.js is the `StaticCanvas` or the interactive version called simply `Canvas`. +This is a class that provides you the surface where you will draw and will also provide the tools to: -Caching and erasing are 2 examples that utilize this concept. - -_Cheating_ the user to think something is happening by showing a visual outcome (that may not correlate to the **logical** state) is sometimes the best way to solve a problem. - -Since we are dealing with 2 states there are cases they fall out of sync. -Flagging an object as `dirty` will sync its visual state on the next render (invalidating its cache, if it is caching). - -```ts -object.set({ dirty: true }); -``` - -Syncing its **logical** state is needed for user interactions. - -```ts -object.setCoords(); -``` +- Handle selections and object interactions +- Reorder the stack of objects +- Render imperatively +- Serialize and Deserialize the state +- Export the graphic state to JSON or SVG or an image +- Handle the viewport of your current application ## Objects -Objects are shapes with a lifecycle that supports both the **logical** and the **visual** states. +Objects are the items we add on the Canvas or StaticCanvas. +The prebuilt objects offer some basic shapes and Text. +Each of these objects represent a visually different shape that can be added on the canvas and freely transformed or edited. - `Path` - `Polyline`, `Polygon` - `Rect` - `Circle`, `Ellipse` -- `Image` -- `Text`, `IText`, `Textbox` +- `FabricImage` +- `FabricText`, `IText`, `Textbox` -## Interactions +### Patterns, Gradients and Shadows + +On top of classes to represent shape/objects there are smaller classes that are used to paint object fills or strokes. +You can't add a `Gradient` or a `Shadow` to a canvas, you set those as properties of object to obtain determined effects -User interactions drive both **logical** and **visual** state changes. -The standard fabric app is built mainly on interactions. -As such there are many **events** to subscribe to in order to make it easier to achieve complex UX. +### Image filters -```ts -object.on('eventName', ...); -``` +FabricImage class represent a raster image on the canvas. +FabricImage can be filtered with one or more filters. +Filters are small programs written in WEBGL ( with an optional JS fallback ) that change image pixel value to obtain certain effects. +Fabric.js supports numerous prebuilt fitlers for common operations and also a stack to combine more than one filter to build a particular effect. + +## Interactions + +Fabric.js offers some prebuilt interactions between the objects on the canvas +- Selection +- Dragging +- Scaling, rotation, skewing through customizable controls +- Brushing ### Selection @@ -67,109 +71,56 @@ Fabric exposes the following controls: - rotating - resizing - skewing -- translating action -The `Control` API is designed especially for creating custom controls and customizing existing ones. +The `Control` Class and the API is designed especially for creating custom controls and customizing existing ones either in appearances or functionalities. More on `Controls` [here](/docs/configuring-controls/) ### Drawing & Brushes -The drawing interaction is controlled by `Canvas#freeDrawingBrush` and `Canvas#isDrawingMode`. -Once the interaction completes an object is created => listen to the `path:created` event for it. +The Canvas offer an embedded drawing mode in which the mouse move event is forwarded to a brush class that has the scope of creating an object that will represent your brush strokes. Brushing is based on the `Path` object or on a collection of circles/rect to represent a spray. Available brushes: -- `CircleBrush` -- `PatternBrush` -- `PencilBrush` -- `SprayBrush` - -### Zoom, Pan & Viewport interactions - -Fabric doesn't support these interaction out of the box. -Check out the demo. - -### Animations - -Animations are another form of state change. -It is possible to animate anything in fabric as long as you sync the state properly. -Remember to cleanup after yourself by aborting running animations. - -## Visual State - -### Rendering - -Rendering is the process in which a canvas or an object redraws itself. -By doing so it syncs the **visual** state. - -Keep in mind that rendering can be expensive and therefore can lead to a drop in performance. - -Rendering is performed in the parent plane, see [transformations](#transformations). - -Objects need a reference to canvas for proper rendering (handled by fabric under the hood). - -#### `renderAll` vs. `requestRenderAll` - -`renderAll` is sync, `requestRenderAll` is not, both render the canvas. -`requestRenderAll` first request an animation frame before rendering. -Calling `requestRenderAll` repeatedly will have no effect as long as rendering has not started. - -### Caching - -Caching means rendering an object onto a standalone canvas (called a cache). Then, when rendering occurs we can pull the cache and render it instead of redrawing the object. - -Caching is used for 2 reasons: +- `CircleBrush` and `SprayBrush` ( a spray example ) +- `PencilBrush` ( a classic pencil ) +- `PatternBrush` ( a pencil brush filled up with a pattern ) -- Performance\ - We save on redrawing the object if its state did not change. +## Events -- Context Isolation\ - Performing complex rendering such as clipping, filtering, using `globalCompositeOperation` etc. need an isolated context to render on in order for the operation to remain isolated and not to affect the entire canvas, so we use the cache. +Some interaction between the user of the application and the code written by the developer are handled through events. +You will get an event every time a final user interact with the canvas through Fabric.js embedded functionalities for low level events like: -## I/O +- mouse up/down/move +- mouse wheel +- mouse in/out +- drag and drop -Fabric supports `JSON` and `SVG` serialization. -Take a look at: +While you will also get some high level event that is the end result of embedded user experience built on top of standard mouse events -| | In | Out | -| ---------- | ------------- | --------------- | -| **`JSON`** | `fromObject` | `toObject` | -| **`SVG`** | `fromElement` | `toSVG` | -| **`PDF`** | `N/A` | Use node canvas | +- object selection created/destroyed/changed +- object added to canvas/group +- object remove from canvas/group +- object created from brushing -Use the `classRegistry` to register your own classes for parsing. +## Animations -If you encounter issues with serialization try changing `NUM_FRACTION_DIGITS`. +Fabric.js also support some basic animation utility. +You can use animation library that supports objects to work with fabricJS. +You can animate object positions, transform properties like scale, colors or matrices. +As long as you can change the state during time from a value to aother you can create an animation. -## Customization, Subclassing & Mutation +Fabric.js animation utility is barebone if you have some specific need for some specific animation effect you are better searching a specific library to do that. -```ts -// subclass -class MyRect extends Rect { +## Exports - // override methods - ... +Fabric supports `JSON` and `SVG` exports. - // override default values - getDefaults() { - return { - ...super.getDefaults(), - ... - } - } -} -// register subclass for I/O -classRegistry.setClass(MyRect); +### JSON -// prototype mutation -fabric.Object.prototype.someMethod = function() { - ... -} +JSON export is meant for saving and restoring visual state on the canvas. +Every fabricJS object is equipped with its own `toObject` method that will output a simple JS object that can be put in storage and used in pair with `fromObject` to get back an instance of the same type. +This state is supposed to restore the visual state of the canvas and not functionalities like controls. +Fabric.js assumes that custom controls and custom handler are set up in your codebase as part of your app and are not part of your state. -// override default values -fabric.Object.getDefaults = function() { - return { - ... - } -} +### SVG -``` +SVG export is meant to ouput your visual canvas to a vector format output that can be imported in other softwares or printed. SVG and Canvas share a lot of similarities but are not identical. As a result SVG import and SVG export are not 1:1. Some features are supported in SVG export but are not supported in SVG import for example like TSPAN or Patterns. \ No newline at end of file diff --git a/src/content/docs/docs/custom-controls.unfinished b/src/content/docs/docs/custom-controls.unfinished index 01498db74..68242f3ea 100644 --- a/src/content/docs/docs/custom-controls.unfinished +++ b/src/content/docs/docs/custom-controls.unfinished @@ -5,7 +5,7 @@ sidebar: order: 4 --- -FabricJS offers a series of functions and classes to build your own controls for the objects and custom functionalities. +Fabric.js offers a series of functions and classes to build your own controls for the objects and custom functionalities. The fabric Canvas code is built to look into any object `controls` property for a map of controls to render target and use. diff --git a/src/content/docs/docs/events.mdx b/src/content/docs/docs/events.mdx new file mode 100644 index 000000000..0f679c9af --- /dev/null +++ b/src/content/docs/docs/events.mdx @@ -0,0 +1,125 @@ +--- +date: '2024-12-22' +title: 'Working with events' +description: '' +sidebar: + order: 600 +--- + +### Why events + +Fabric.js offers hard coded interactions that are triggered by user interactions with the canvas. +During those actions the developer may want to react or run extra code, or even just update the state of the application. + +Simple examples are: +- When an object has been selected +- When an object is being hovered +- When a transformation is finished + +Events have been always part of fabric.js, way before the custom controls api and selection callbacks were introduced. +As a result events have also been used to modify standard fabric.js behaviours creating complex code flows. + +### When to use events + +Try to do *not* depend too much from events, is not a great pattern outisde mouse and selections. +At the time i joined the project events were already there and with time there have been additions but never cleanups. +Try to think in this way: In Fabric.sj events are meant to alert you of things happening that you +can't reach because are part of code you didn't write. +Events aren't a message system to activate or connect together functionalities of your app. + +There is an example i try to keep in mind when i decide to use or not use an event, the 'object:added' event. +The 'object:added' fires when an object is added to the canvas or is added inside a group. +So for example let's say that when a new object is added on the canvas you want it centered and selected. + +```ts +canvas.on('object:added', function(e) { + canvas.center(e.target); + canvas.setActiveObject(e.target); +}); +``` + +Now from any part of your application that adds an object the event will fire and this code will run. +It seems fine, but on the other side if you think that in order to add an object you need to write code for that to happen, +you may also just create a function that adds an object, center and selects it and then just call that function instead of calling `canvas.add`. + +**In general if you need to write code for something to happen** events from that something are unnecessary. + +The custom controls api made most of the transform event unnecessary as well. If you have to constrain scaling or rotation it will be easier + and more performant to do so in the control action rather than correct the behavior after the fact in the event. + Transform events run after the transformation already happened. + +Events around the selection actions are good to inform your UI framework that something has happened, but for example if you want to avoid + selecting an object based on some condition it is better to use the onSelect and onDeselect callbacks on the object that are made to influence the operation. + +### How events work + +Both the BaseFabricObject class and the StaticCanvas inherit from an Observable class. +This class expose 4 methods, `on`, `off`, `once` and `fire`. + +The `on`, `off`, `once` are used to register and unregister event listeners: + +```ts +const handler = function() { + console.log('circle has been clicked'); +} +// to register an event listener +const disposer = myCircle.on('mousedown', handler); + +// to unregister an event listener call off +myCircle.off('mousedown', handler); +// or use the return value of on +dispose(); +``` + + +**Be careful**: The `off` method can be called with only the event name, in this case all the listeners for that event + will be removed from the instance. This is bad since fabric.js does not have protected events and it is using events events for some functionalities. + For example removing all the mousedown events from a text instance will break text editing. This pattern and the more radical one `myObject.off()` + are deprecated and should be avoided. + +The disposer is a function that when called will remove the event listener, this may be easier +to use than keeping a reference to the handler function used with `on` as an alternative. + +The handlers are called bound on the instance, so in the handler funcion the `this` is either the fabric object or the fabric canvas. +Fat arrow functions can't be bound to anyhting else than the context in which they were created, so if you don't want unexpected + side effects **use functions for event handers**. + +Fabric.js calls `fire` to trigger event listeners, the listeners that are hosted on the instance are then called bound in order + of registration and with a data object as first and only argument. + +Events are fired twice, once on the object involved and once on the canvas, this allow a bit of freedom in writing your event listeners. +The fire order depends on the implementation of the particular event and is not a specification to take in account. +While firing twice the event is the same, with the same data object. The canvas event is enriched with an additional property referencing the `target` of the event. + +When events are triggered by mouse actions, the mouse or pointer event is forwarded along the data together with common properties that are usually useful to the consumer. +As an example the `mouse:down` event will have: +- `e` the original mouse event +- `scenePoint` the point where the event happened in the canvas coordinate system +- `viewportPoint` the point where the event happened in the viewport coordinate system +- `target` the object that was hit by the event, possibly undefimed +- `subTargets` an array of objects that were hit by the event, possibly empty, if the target has children +- `transform` the current ongoing transform action (if any, like scaling for example) + +### Events list + +There isn't an hand curated even list with descriptions and data passed in the argument. +One way to get to know the events is to look at the event demo here: [Events inspector](/demo/events-inspector/) or to use a type enabled ide and look at +auto completition for the on method. + +### Custom events + +You can fire custom events by using the `fire` method and passing the event name and the data you want, or no data at all. + +To keep your code typehinted, you can also extend the event list: + +```ts +// declare the events for typescript +declare module "fabric" { + interface CanvasEvents { + 'custom:event': Partial & { + target: FabricObject; + anydata: string; + }; + } +} +``` \ No newline at end of file diff --git a/src/content/docs/docs/fabric-object-caching.mdx b/src/content/docs/docs/fabric-object-caching.mdx new file mode 100644 index 000000000..669d2d0d1 --- /dev/null +++ b/src/content/docs/docs/fabric-object-caching.mdx @@ -0,0 +1,442 @@ +--- +date: '2016-11-26' +description: 'Caching of object, properties and beahvior' +title: Caching of object, properties and beahvior +sidebar: + order: 700 +--- + +import { Example1, Example2, Example3, Example4 } from './fabric-object-caching/fabric-object-caching.jsx'; + +## Caching in Fabric.js + +When fabric object caching is active, the objects you paint on canvas are actually pre painted on another smaller canvas, + outside of the DOM, as big as the object pixel dimension itself. +During the `render` method this pre painted canvas gets copied on the main canvas with a `drawImage` operation. + +That means that during `drag` `rotate` `skew` `scale` operations the object is not redrawn on canvas, but just its copied cached image gets drawn over the canvas. + +In general every top level object on the fabric.canvas ends up on its own image counterpart stored on a HTMLCanvas + of which a reference is saved in the property `_cacheCanvas`. Every render cycle the code checks if this object is dirty + and in case it refreshes the copy and then uses it for painting again. + +The caching strategy is very simple in Fabric.js and there are few properties on the objects or in the top level configuration to slightly tweak it. +In practice then this process has a lot of costrains and perfomance pitfalls. Please be sure to read this entire page to + understand the basics. + +## Tweaks and configuration + +### Object configuration + +Fabric.js objects have some top level properties to handle caching. + +```ts +myObject.objectCaching = true; +``` +objectCaching property is the main switch of caching per object. +When is false caching is skipped, unless is required because of some other constrain ( more on that later ) + +```ts +myObject.noScaleCache = true; +``` +noScaleCache is a boolean that will stop cache invalidation during a scaling operation with the mouse. +At the end of the scaling operation the object will be redrawn and a new cache will be created for that scale value. + +Also spot differences in scaling between `noScaleCache` true or false. +In canvases below left canvas is `true`, that means that during the scaling transformation the object is not regenerated. +The right canvas has scaling that invalidates the cache every scale change. +You can also open your developer tools and record scaling performances in both cases and compare. +Take care that the below yellow care is a large complex object made of 417 innner objects and gradients. +if you scale an object more than 3 times the original size you will notice blurring that then gets fixed with a new cached + copy as soon as you perform a mouse up. Try it by yourself by scaling the little yellow cars on both canvases: + +
+ + +
+ +```ts +myObject.dirty = true; +``` +This boolean flags the cache status as old/invalid/dirty and will cause a re-render at the next render cycle. +As of today there isn't a method to force cache refresh imperatively. + +Fabric.js takes care to set the dirty flag during the operations that will likely cause a cache invalidation, + like text typing for example. + +### Classes configuration + +On top of those per instance properties there are some that are at class level. +Each class has a static array of `cacheProperties` as this one below: + +```ts +static cacheProperties = [ + 'fill', + 'stroke', + 'strokeWidth', + 'strokeDashArray', + 'width', + 'height', + 'paintFirst', + 'strokeUniform', + 'strokeLineCap', + 'strokeDashOffset', + 'strokeLineJoin', + 'strokeMiterLimit', + 'backgroundColor', + 'clipPath', +]; +``` + +Being static you will find this array on the class definition like: + +```ts +import { Path } from 'fabric'; + +console.log(Path.cacheProperties); + +// outputs +['fill', 'stroke', 'strokeWidth', ...] +``` +This array is used from the `set` method to check on cache invalidation. +The moment you call: +```ts +myObject.set({ fill: 'red', name: 'John' }); +``` +Both keys fill and name get checked against the array and if one is found the object status is set to dirty. +It is suggested to always use the set method, with the object signature or the simpler one when you want to + change properties to your objects to avoid stale caches. + +If you are creating a custom class and you have some property that influences rendering you should add to your + new class `cacheProperties` all the properties of the base class and add your own. + +When a cache property is set in an object that is inside a group, all the parents of the object get invalidated as well. + +### Fabric.js configuration + +Caching has a list of compromises in order to be somehow convenient most of the time. +A cached canvas can't be too big or it will be too slow to be refreshed for example. +It can't be too small or it will not trigger certain GPU optmization paths in browsers + ( this information may be obsolete with browser changes ) + +In the Fabric.js configuration object there are 3 values that relate to caching: + +```ts + /** + * Pixel limit for cache canvases. 1Mpx , 4Mpx should be fine. + * @since 1.7.14 + * @type Number + * @default + */ + perfLimitSizeTotal = 2097152; + + /** + * Pixel limit for cache canvases width or height. IE11 was the historical reason why this number is below 5000 + * @since 1.7.14 + * @type Number + * @default + */ + maxCacheSideLimit = 4096; + + /** + * Lowest pixel limit for cache canvases, set at 256PX + * @since 1.7.14 + * @type Number + * @default + */ + minCacheSideLimit = 256; +``` + +minCacheSideLimit will determine the mini size of a side of the cache. At any object size the cache canvas will be at least 256 by 256 pixels. +If you are caching a Rect that is 1 by 1, you will have a 256 by 156 canvas with a single pixel filled. + +maxCacheSizeLimit and perfLimitSizeTotal are determining the maximum side and the maximum surface of the cache canvas. +So with a value of 4k pixels and a perfLimitSizeTotal of around 2 milion pixels, if your object is 5000 by 10000 it will cached to a size of + 4096 by (2097152 / 4096). The biggest side will be reduce to 4096 and the other one will be fit in what 2Milion pixels allow. + +You can change those value to experiment with what quality and speed fit best for your application by doing the follwing: + +```ts +import { config } from 'fabric'; +config.perfLimitSizeTotal = 4096 * 1024; +config.maxCacheSideLimit = 8192; +``` +Please continue reading for considerations of various kind, mobile performance, output quality when exporting and so on. + +### Caching and render loop + +This little paragraph will try to illustrate the current logic of handling cache in Fabric.js. + +When executing `Canvas.renderAll` the library loop over every top object on the canvas, everything that has been added to the canvas with `canvas.add` +For each object the code checks if the object should cache. +This `shouldCache()` check is not as straight forward as we would like: + +```ts + /** + * 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. + * Read as: cache if is needed, or if the feature is enabled but we are not already caching. + * @return {Boolean} + */ + shouldCache() { + this.ownCaching = (this.objectCaching && (!this.parent || !this.parent.isOnACache())) || + this.needsItsOwnCache(); + return this.ownCaching; + } + + /** + * 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 + * since 1.7.12 + * @returns Boolean + */ + needsItsOwnCache() { + if ( + this.paintFirst === STROKE && + this.hasFill() && + this.hasStroke() && + !!this.shadow + ) { + return true; + } + if (this.clipPath) { + return true; + } + return false; + } + + /** + * Check if this object will cast a shadow with an offset. + * used by Group.shouldCache to know if child has a shadow recursively + * @return {Boolean} + * @deprecated + */ + willDrawShadow() { + return ( + !!this.shadow && (this.shadow.offsetX !== 0 || this.shadow.offsetY !== 0) + ); + } + + + /** + * Check if instance or its group are caching, recursively up + * @return {Boolean} + */ + isOnACache(): boolean { + return this.ownCaching || (!!this.parent && this.parent.isOnACache()); + } +``` + +Let's read it as: +We will cache if objectCaching is true, unless we have a parent that is already on a cache. +Regardless if we need a cache we are going to cache anyway. +When do we need a cache? When there is a clipPath or if we have a shadow and we are painting stroke first. + +So in case of a plain object outside of a group it boils down to having cache enabled. +If paintFirst is set to stroke ( default is fill ) we need a cache to avoid that the paint + of fill would cast a shadow on the stroke. + +When an object is cached the painted copy is done without opacity or shadow. The resulting canvas then gets blended +with the correct opacity and cast the shadow realtime every draw. +The reasons behind those are that shadows in canvas keep the orientation regardless of the rotation. An object casting + a shadow south east will continue to cast a shadow in that direction also when you rotate it. If we want to have that + working we can't cache a shadow. The reasons behind opacity is that a semi transparent cache still needs to be blended + with the background, so caching or not caching the opacity is not giving us any speed advantage, on the other side not caching the opacity + allow us to reuse the cache when the user changes the opacity of an object. + +Now when caching a group things get more complicated. + +```ts + /** + * Decide if the group should cache or not. Create its own cache level + * needsItsOwnCache should be used when the object drawing method requires + * a cache step. + * Generally you do not cache objects in groups because the group is already cached. + * @return {Boolean} + */ + shouldCache() { + const ownCache = FabricObject.prototype.shouldCache.call(this); + if (ownCache) { + for (let i = 0; i < this._objects.length; i++) { + if (this._objects[i].willDrawShadow()) { + this.ownCaching = false; + return false; + } + } + } + return ownCache; + } + + /** + * Check if this object or a child object will cast a shadow + * @return {Boolean} + */ + willDrawShadow() { + if (super.willDrawShadow()) { + return true; + } + for (let i = 0; i < this._objects.length; i++) { + if (this._objects[i].willDrawShadow()) { + return true; + } + } + return false; + } +``` + +When caching the group we start with the same `shouldCache` check. If it returns true we will check every child + recursively for a **shadow with offset**. If a shadow with offset is found, we can't cache. A shadow without offset + can still be cached since the rotation won't affect the shadow cast. + +Running `shouldCache` will flag the group property `ownCache` that will tell us if the group is caching, when later on we are checking +each object for its own caching strategy it will be useful to determine if they are being cached already in the group. + +With the current code when caching a group, the group has first to check recursively down if it can cache, and every object has anyway to check + recursively up if it is already being cached. + +The above logic takes care only about the decision to cache. + +Then we need either to paint an object on the cache and then just render the cache on the canvas. + +Fabric.js has to understand if the cache is dirty first of all. +Is dirty when is dirty or when it doesn't exist or when it changed size. + +In case the cache needs to be created or painted, dimensions needs to be calculated. +A cache is going to be rendered on a zoomed canvas with retina scaling possibly and all of this needs to be taken in account. + +All of those parameters are accounted for in `_getCacheCanvasDimensions` and limited down to fit in the cache size configuration. + +```ts + _getCacheCanvasDimensions(): TCacheCanvasDimensions { + const objectScale = this.getTotalObjectScaling(), + // calculate dimensions without skewing + dim = this._getTransformedDimensions({ skewX: 0, skewY: 0 }), + neededX = (dim.x * objectScale.x) / this.scaleX, + neededY = (dim.y * objectScale.y) / this.scaleY; + return { + // for sure this ALIASING_LIMIT is slightly creating problem + // in situation in which the cache canvas gets an upper limit + // also objectScale contains already scaleX and scaleY + width: Math.ceil(neededX + ALIASING_LIMIT), + height: Math.ceil(neededY + ALIASING_LIMIT), + zoomX: objectScale.x, + zoomY: objectScale.y, + x: neededX, + y: neededY, + }; + } +``` + +If the canvas has the exact same dimension of the previous render cycle the canvas is going to be cleaned and repainted. +If the object grew bigger or smaller the canvas will be resized and repainted. + +Once painted and optimally centered the cache canvas is built and then painted on the canvas on the right place. + +### Performance pitfalls and issues + +Performance gains are not always there and there are also issues with blurryness rarely. + +Caching is beneficial depending on what your project looks like. +If Are you drawing just a bunch of circles, rects or simple polygons caching is not a big deal. Calling `ctx.fillRect` or `ctx.drawImage` +is mostly the same and if itsn't exactly the same you save on cache canvas creation and size comparision and a lot of ram. + +On the other side if you importing and displaying large and complex svgs or groups well in that case cache is helpful. + +You have always to keep in mind that if you are dealing with really static groups of objects you always have the option to export them to canvases +and use those canvases to instantiate some FabricImage and keep them fast and really static. +Also consider that complex SVG can also be not parsed and used as plain image. + +Cache is always really helpful with large text objects or with styled text objects. + +#### Viewport Zoom + +The first performance pitfall that is common to all caching situation is viewport zooming. Zoom causes a change in size of +all the canvas objects at once and so the resizing and repainting of all objects. + +The below flamegraph is from a canvas with 900 simple rects ( not a real use case ) and we are measuring the time used to during a zoom level change: + +**Rects are 50px:** +![performance flamegraph 50px](/article_assets/cache_min.png) + +**Rects are 130px:** +![performance flamegraph 130px](/article_assets/cache_normal.png) + +**Rects are 130px and uncached:** + +![performance flamegraph uncached 130px](/article_assets/uncached_normal.png) + +As you can see drawing 900 simple rects takes around 4-5ms on a modern laptop. As much as it would to render the cached copies. +Disabling cache for this synthetic test we skip all the overhead of checking the cache size and actually resizing the cache canvases. + +You can see that **50px are much faster than 130px** and this is because the 50px with retina scaling and 1.2 zoom is still under the minimum + cache size of 256px, so the caches are cleaned but not resized. The 130px rect breaks at 260 with retina scaling and every subsequent zoom + requires a canvas resize with a context lost and a new memory allocation. Of the 70+ms required around 30 are of garbage collecting. While no +major GC event happens when the canvas aren't resized. + +In general viewport zooming is a performance killer with many objects and cache. + +#### Object blurriness and anti aliasing + +The canvas vector drawing is anti aliased. This means that if you draw a black single pixel line at at position X, you will get + the line across pixel X and X-1. This across line means that both pixels will be grey and none black, you get a blurry line. +it is very important that things are drawn as crisp as possible in the cache canvas to avoid to add blurryness on top of blurryness. +To produce the below screenshot i created 2 cached rects, one wide 51px, another wide 51.5px, both with a 1px stroke. + +![Cache blurryness](/article_assets/cache_compare.png) + +Fabric.js is able to make both sides crisp in the case of the 51px rect, by pixel align the rect on a 256px surface, understanding that + we need to draw on integer pixels as much as possible. For the 51.5 pixel rect this is not possible and a single side is blurry. + This same issue would happen without caching, but in the moment we would translate our rectangle of fractions of pixels, the canvas would + reoptimize aliasing pixels trying to always produce a crisp line. This is not possible for the cached copy that has its peak crispness when + is pixel aligned and has sub optimal results when is not. + +This is easier to understand if we look at the cache of the triangle: + +![Cache blurryness](/article_assets/cache_triangle.png) + +When the triangles are put one near the other, the difference between the cached one and the non cached one are basically zero. +If we factor in rotation, things change a lot. When rotating of 26.57 degree the non cached triangle, one of the sides completely aligns + with the pixel grid and becomes a perfect black line. The cached anti-aliased line gets aligned vertically and anti-aliased again, + creating a blurry mess. This is not fixable and it is what is is. + +![Cache blurryness](/article_assets/triangle_rotated_cache.png) + +A nice effort has been done to ensure the cache is painted on the cache canvas with the most crisp pixels to lower the impact of double +anti aliasing, but some issues are part of the canvas itself and can't be fixed. + +### Sharp output and printing + +Because of the above details, Png or Jpeg exports with caching active is in general a bad idea. +If you are working to produce optimum print files you should disable caching before exporting and enabling it back after. +For the shapes that require caching enabled there is no embedded solution now, but one is planned + +### Caching in action + +Example of a cache canvas that is bigger than the drawn object (256x256 is the minimum by default): + +
+ +
+ +Example of the biggest size cache canvas at default values ( 2 Mega pixels ). Scroll inside the white area to see image at 100% zoom: + +
+ +
+ +The default cache setting is not small, is enough for crisp images on a standard screen. + +Below you can see 2 fabric canvases. The left one is the default cached, while the right one is drawn with cache disabled. +The canvases are loaded with heavy pathgroups, the snowman, the heaviest I could find is in 3 copies and makes the render speed cripple down. +Try to drag around one of the shapes on the left or right canvas and notice the speed difference. +On a modern machine without caching is still usable, at the time of writing this article for the first time ( around 2017 ) the difference was night and day. + + + + +As a reference, on my machine, an m1 pro from 2021 the cached canvas takes 0.8ms to render, while the non cached one takes 25ms. diff --git a/src/content/docs/docs/Old docs/fabric-object-caching/example1.js b/src/content/docs/docs/fabric-object-caching/example1.js similarity index 94% rename from src/content/docs/docs/Old docs/fabric-object-caching/example1.js rename to src/content/docs/docs/fabric-object-caching/example1.js index fa8fbcb7d..4cefaba0d 100644 --- a/src/content/docs/docs/Old docs/fabric-object-caching/example1.js +++ b/src/content/docs/docs/fabric-object-caching/example1.js @@ -1,7 +1,7 @@ import * as fabric from 'fabric'; export default function (id) { - var canvas1 = new fabric.Canvas(id, { width: 300, height: 300 }); + var canvas1 = new fabric.Canvas(id, { width: 350, height: 400 }); fabric.loadSVGFromURL('/assets/176.svg').then(({objects, options}) => { const svg1 = fabric.util.groupSVGElements(objects, options); diff --git a/src/content/docs/docs/Old docs/fabric-object-caching/example2.js b/src/content/docs/docs/fabric-object-caching/example2.js similarity index 78% rename from src/content/docs/docs/Old docs/fabric-object-caching/example2.js rename to src/content/docs/docs/fabric-object-caching/example2.js index 0f8e5a389..e2d1b45af 100644 --- a/src/content/docs/docs/Old docs/fabric-object-caching/example2.js +++ b/src/content/docs/docs/fabric-object-caching/example2.js @@ -1,28 +1,39 @@ import * as fabric from 'fabric'; +function disableCache(objects) { + objects.forEach((obj) => { + obj.objectCaching = false; + }); +} + export default function (id) { - var canvas2 = new fabric.Canvas(id, { width: 300, height: 300 }); + var canvas2 = new fabric.Canvas(id, { width: 350, height: 400 }); fabric.loadSVGFromURL('/assets/176.svg').then(({objects, options}) => { + disableCache(objects); const svg1 = fabric.util.groupSVGElements(objects, options); svg1.objectCaching = false; canvas2.add(svg1); }); fabric.loadSVGFromURL('/assets/48.svg').then(({ objects, options }) => { + disableCache(objects); const svg1 = fabric.util.groupSVGElements(objects, options); svg1.objectCaching = false; canvas2.add(svg1); }); fabric.loadSVGFromURL('/assets/48.svg').then(({ objects, options }) => { + disableCache(objects); const svg1 = fabric.util.groupSVGElements(objects, options); svg1.objectCaching = false; canvas2.add(svg1); }); fabric.loadSVGFromURL('/assets/48.svg').then(({ objects, options }) => { + disableCache(objects); const svg1 = fabric.util.groupSVGElements(objects, options); svg1.objectCaching = false; canvas2.add(svg1); }); fabric.loadSVGFromURL('/assets/171.svg').then(({ objects, options }) => { + disableCache(objects); const svg1 = fabric.util.groupSVGElements(objects, options); svg1.objectCaching = false; svg1.scale(0.4); diff --git a/src/content/docs/docs/Old docs/fabric-object-caching/example3.js b/src/content/docs/docs/fabric-object-caching/example3.js similarity index 90% rename from src/content/docs/docs/Old docs/fabric-object-caching/example3.js rename to src/content/docs/docs/fabric-object-caching/example3.js index 6f9d34c5d..bbe7e7597 100644 --- a/src/content/docs/docs/Old docs/fabric-object-caching/example3.js +++ b/src/content/docs/docs/fabric-object-caching/example3.js @@ -4,6 +4,7 @@ export default function (id) { var canvas3 = new fabric.Canvas(id, { width: 300, height: 300 }); fabric.loadSVGFromURL('/assets/171.svg').then(({ objects, options }) => { var svg1 = fabric.util.groupSVGElements(objects, options); + svg1.noScaleCache = true; svg1.scale(0.05); canvas3.add(svg1); }); diff --git a/src/content/docs/docs/fabric-object-caching/example4.js b/src/content/docs/docs/fabric-object-caching/example4.js new file mode 100644 index 000000000..8bc7ef2af --- /dev/null +++ b/src/content/docs/docs/fabric-object-caching/example4.js @@ -0,0 +1,11 @@ +import * as fabric from 'fabric'; + +export default function (id) { + var canvas3 = new fabric.Canvas(id, { width: 300, height: 300 }); + fabric.loadSVGFromURL('/assets/171.svg').then(({ objects, options }) => { + var svg1 = fabric.util.groupSVGElements(objects, options); + svg1.noScaleCache = false; + svg1.scale(0.05); + canvas3.add(svg1); + }); +} \ No newline at end of file diff --git a/src/content/docs/docs/Old docs/fabric-object-caching/fabric-object-caching.jsx b/src/content/docs/docs/fabric-object-caching/fabric-object-caching.jsx similarity index 67% rename from src/content/docs/docs/Old docs/fabric-object-caching/fabric-object-caching.jsx rename to src/content/docs/docs/fabric-object-caching/fabric-object-caching.jsx index d79c8e27b..5335a1f68 100644 --- a/src/content/docs/docs/Old docs/fabric-object-caching/fabric-object-caching.jsx +++ b/src/content/docs/docs/fabric-object-caching/fabric-object-caching.jsx @@ -1,12 +1,15 @@ -import { generateExample } from '../../../../../utils/generateExample'; +import { generateExample } from '../../../../utils/generateExample'; import example1 from './example1'; import example2 from './example2'; import example3 from './example3'; +import example4 from './example4'; import example1code from './example1?raw'; import example2code from './example2?raw'; import example3code from './example3?raw'; +import example4code from './example4?raw'; export const Example1 = generateExample(example1, 'example1', example1code); export const Example2 = generateExample(example2, 'example2', example2code); export const Example3 = generateExample(example3, 'example3', example3code); +export const Example4 = generateExample(example4, 'example4', example4code); diff --git a/src/content/docs/docs/index.md b/src/content/docs/docs/index.md index 3cb32e0f5..72c48fcd3 100644 --- a/src/content/docs/docs/index.md +++ b/src/content/docs/docs/index.md @@ -1,10 +1,10 @@ --- date: '2015-03-09' -title: 'Introduction to FabricJS' -description: 'A thorough guide to profeciently using FabricJS' +title: 'Introduction to Fabric.js' +description: 'A thorough guide to profeciently using Fabric.js' --- -A brief introduction to FabricJS and especially what the user can expect from this guide +A brief introduction to Fabric.js and especially what the user can expect from this guide ## Pre-requisites diff --git a/src/content/docs/docs/Understanding FabricJS/transformations.md b/src/content/docs/docs/transformations.md similarity index 100% rename from src/content/docs/docs/Understanding FabricJS/transformations.md rename to src/content/docs/docs/transformations.md diff --git a/src/content/docs/docs/using-custom-properties.mdx b/src/content/docs/docs/using-custom-properties.mdx index dbbd8c205..23cba70e7 100644 --- a/src/content/docs/docs/using-custom-properties.mdx +++ b/src/content/docs/docs/using-custom-properties.mdx @@ -2,7 +2,7 @@ date: '2024-08-04' title: 'Objects and custom properties' sidebar: - order: 4 + order: 600 --- ### Custom properties @@ -70,6 +70,10 @@ Rect.prototype.getText = function() { return 'none'; } Text.prototype.getText = function() { return this.text; } ``` +### Custom events + +If you are looking to fire or understand custom events, look here: [Events](/docs/events#custom-events). + ### Subclassing Subclassing is easier but is not always possible. @@ -117,4 +121,4 @@ But you can't subclass FabricObject and add it back in the prototype chain of th ### Warning You should add custom properties when they make your life simpler during rendering or event handling. -In general FabricJS classes/objects on the canvas shouldn't contain data that is not relevant to their rendering needs or behaviour configuration, they shouldn't become data stores of your application. +In general Fabric.js classes/objects on the canvas shouldn't contain data that is not relevant to their rendering needs or behaviour configuration, they shouldn't become data stores of your application. diff --git a/src/content/docs/docs/why-fabric.md b/src/content/docs/docs/why-fabric.md new file mode 100644 index 000000000..5578b4fdd --- /dev/null +++ b/src/content/docs/docs/why-fabric.md @@ -0,0 +1,13 @@ +--- +date: '2024-11-17' +title: 'Fabric.js' +description: 'Introductio to Fabric.js' +--- + +## What is Fabric.js + +Fabric.js is an abstraction layer on top of the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API). It offers an object based rendering api with an additional interaction and events layer a serialization mechanism, SVG export, animation tools and other utilities. + +## Why using Fabric.js + +You may want to use Fabric.js if you want to build an interactive application on top of a Canvas and you don't want to write code for basic functionalities like object detection and rendering stack handling. \ No newline at end of file diff --git a/src/css/demo-common.css b/src/css/demo-common.css new file mode 100644 index 000000000..cbe30b754 --- /dev/null +++ b/src/css/demo-common.css @@ -0,0 +1,11 @@ +/* controls is a box that contain buttons on top of a canvas */ +.controls { + display: flex; + column-gap: 16px; + margin-bottom: 16px; +} + +canvas { + border: 1px solid black; + box-sizing: content-box; +} \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index a15349068..1ae0b5cd6 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -2,28 +2,30 @@ import Header from '../components/Header/Header.astro'; import './style.css'; import './colorvars.css'; -import CarbonAd from '../components/CarbonAd/InlineCarbonAd'; +import CarbonAd from '../components/CarbonAd/InlineCarbonAd.astro'; interface Props { title: string; + description?: string; } -const { title } = Astro.props; +const { title, description } = Astro.props; --- - + + {title}
- + diff --git a/src/layouts/colorvars.css b/src/layouts/colorvars.css index 741601ac7..2cffc4921 100644 --- a/src/layouts/colorvars.css +++ b/src/layouts/colorvars.css @@ -1,4 +1,7 @@ :root { + /* --primary-color-high: #0A5D80; + --primary-color: #0C7CAC; + --primary-color-light: #76CEF4; */ --primary-color-high: #70A9FF; --primary-color: #76cef4; /*70A9FF - > 76CEF4 - > 7BF2EA*/ --primary-color-tint: #f0f8ff; @@ -13,12 +16,14 @@ --font-size-bigger3: 24px; --font-color-light2: #7b93ab; --font-color-light: #5a7896; - --font-color-normal: #445a71; + --font-color-normal: #171e26; /* #445a71; */ --font-color-dark: #2d3c4b; --font-color-dark2: #171e26; --border-radius-normal: 6px; --header-height: 0 /*50px*/; --bottom-nav-height: 50px; + --info-color: #0C7CAC; + --info-color-hover: #0A5D80; */ /** for starlight header */ @@ -29,11 +34,11 @@ :root[data-theme='light'] { /* for STARLIGHT */ --sl-color-white: var(--font-color-dark2); - --sl-color-accent-high: var(--primary-color); - --sl-color-accent: var(--primary-color); + --sl-color-accent-high: var(--info-color); + --sl-color-accent: var(--info-color); --sl-color-accent-low: var(--primary-color-tint); - --sl-color-text: var(--font-color-normal); + --sl-color-text: var(--font-color-dark2); --sl-color-text-accent: var(--sl-color-accent-high); --sl-color-text-invert: var(--sl-color-accent-low); @@ -96,11 +101,10 @@ a { text-decoration: none; - color: var(--primary-color); } - .sidebar-content a { - color: var(--font-color-normal); + a:hover { + text-decoration: none; } a:active, diff --git a/src/layouts/style.css b/src/layouts/style.css index 14e34f9e2..c24665f38 100644 --- a/src/layouts/style.css +++ b/src/layouts/style.css @@ -31,10 +31,6 @@ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'century gothic', sans-serif; - /*font-family:'Segoe UI','Roboto','century gothic',Verdana,Arial,Helvetica,sans-serif;*/ - /*letter-spacing:1px;*/ - background-color: #fff; /*#fafafa,fbfbfb,f8f8f8,eeeeef,eaedf1,ecf0f1,e8e8ea,e6e6e6;*/ - /*background:#fff url('img/miNote4msg.png') no-repeat fixed center/100% 100%;*/ direction: ltr; line-height: 1.6; cursor: default; /*forces a pointer type cursor instead of selecton caret*/ @@ -43,7 +39,7 @@ } a { text-decoration: none; - color: var(--primary-color); /*#0b9,05a;font-style:italic*/ + color: var(--font-color-dark2); /*#0b9,05a;font-style:italic*/ } a:active, *:active { @@ -72,10 +68,7 @@ h3 { color: var(--font-color-dark); } - - .darkBg { - background-color: var(--offwhite-color); - } + /* --------------------------- ### Main element styling | diff --git a/src/pages/404.astro b/src/pages/404.astro index 24b7573e1..8a65ad357 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -2,7 +2,7 @@ import Layout from '../layouts/Layout.astro'; --- - +

Page not found

diff --git a/src/pages/demos.astro b/src/pages/demos.astro index f1df5fe60..56a9d4e96 100644 --- a/src/pages/demos.astro +++ b/src/pages/demos.astro @@ -7,9 +7,10 @@ const collectionName = 'demo'; const demoEntries = await getCollection(collectionName); const images = import.meta.glob<{ default: ImageMetadata }>('/src/content/demo/**/*.{jpeg,jpg,png,gif}'); --- - -

-

FabricJS Demos

+ +
+

Fabric.js Demos

+

Looking for old Fabric.js v5 demos? click here. {demoEntries.map(({ data, id, slug }) => { const imgFullPath = `/src/content/${collectionName}/${id.replace(/index\.mdx?/, data.thumbnail)}`; diff --git a/src/pages/demos/[...slug].astro b/src/pages/demos/[...slug].astro index 63e888e6a..2c92786c2 100644 --- a/src/pages/demos/[...slug].astro +++ b/src/pages/demos/[...slug].astro @@ -3,29 +3,39 @@ import { getCollection } from 'astro:content'; import Layout from '../../layouts/Layout.astro'; import GithubEditLink from '../../components/GithubEditLink/index.astro'; +interface Entry { + render: () => Promise<{ Content: any }>; + data: { + title: string; + }; + slug: string; +} + // 1. Generate a new path for every collection entry export async function getStaticPaths() { - const demoEntries = await getCollection('demo'); - return demoEntries.map(entry => ({ - params: { slug: entry.slug }, props: { entry }, - })); + const demoEntries = await getCollection('demo'); + return demoEntries.map((entry) => ({ + params: { slug: entry.slug }, + props: { entry }, + })); } // 2. For your template, you can get the entry directly from the prop -const { entry } = Astro.props; +const { entry }: { entry: Entry } = Astro.props; const { Content } = await entry.render(); --- - -

-

{entry.data.title}

-
- -
- - -
- \ No newline at end of file +
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index ffce24bef..abdb0d9cf 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,14 +1,21 @@ --- import Layout from '../layouts/Layout.astro'; +import Companies from '../components/Companies/Companies.astro'; import FeaturedBanner from '../components/FeaturedBanner/FeaturedBanner.astro'; import Features from '../components/Features/Features.astro'; +import LatestRelease from '../components/LatestRelease/LatestRelease.astro'; import ContributorsList from '../components/ContributorsList/ContributorsList.astro'; --- - -
- - - -
+ +
+ + + + + +
diff --git a/src/pages/resources.astro b/src/pages/resources.astro new file mode 100644 index 000000000..f19b654b8 --- /dev/null +++ b/src/pages/resources.astro @@ -0,0 +1,13 @@ +--- +import Layout from '../layouts/Layout.astro'; +import ResourcesList from '../components/Resources/Resources.astro'; +--- + + +
+ +
+
diff --git a/src/pages/team.astro b/src/pages/team.astro index 58d2cbd69..151454939 100644 --- a/src/pages/team.astro +++ b/src/pages/team.astro @@ -4,11 +4,12 @@ import TeamMember from '../components/TeamMember/index.astro'; import TeamMemberName from '../components/TeamMemberName/index.astro'; --- -
+

Fabric.JS Team

was born @@ -27,53 +28,6 @@ import TeamMemberName from '../components/TeamMemberName/index.astro'; maintainer and the admin of the repo.

- -

- is from - Israel. -
- Since 2017 he has been developing front-end projects. -
- Shachar loves open source and contributes wherever and whenever he can. -
- In 2021, while researching solutions for a product he was developing for - his startup, he discovered Fabric.js. -
- After testing alternatives Fabric.js won 😉. -
- His tale began when he hit a wall because he had to support erasing, so - he created the EraserBrush. -
- Since then he has been actively contributing to fabric, taking down more - walls to make fabric better and easier. -
-

-
- -

- was born - in 1988 and lives in British Columbia, Canada. -
- He began experimenting with web design at age 12, and started coding on - his old TI-83 Plus graphing calculator, along with dabbling in 3d - graphics during the early days of Blender. -
- Steve now works as a developer for stoneycreekwinepress.com where he - handles frontend web development and builds internal production software - using C# and Adobe ExtendScript. He discovered Fabric in 2017, and used - it to build the company's LabelMaker Pro design platform. -
- You'll see him around here contributing features and helping with - bug reports and issues. -
-

-

Original team members and honorable mentions

@@ -128,5 +82,50 @@ import TeamMemberName from '../components/TeamMemberName/index.astro';

+ +

+ is from + Israel. +
+ Since 2017 he has been developing front-end projects. +
+ Shachar loves open source and contributes wherever and whenever he can. +
+ In 2021, while researching solutions for a product he was developing for + his startup, he discovered Fabric.js. +
+ After testing alternatives Fabric.js won 😉. +
+ His tale began when he hit a wall because he had to support erasing, so + he created the EraserBrush. +
+ Since then he has been actively contributing to fabric, taking down more + walls to make fabric better and easier. +
+

+
+ +

+ was born + in 1988 and lives in British Columbia, Canada. +
+ He began experimenting with web design at age 12, and started coding on + his old TI-83 Plus graphing calculator, along with dabbling in 3d + graphics during the early days of Blender. +
+ Steve now works as a developer for stoneycreekwinepress.com where he + handles frontend web development and builds internal production software + using C# and Adobe ExtendScript. He discovered Fabric in 2017, and used + it to build the company's LabelMaker Pro design platform. +
+ You'll see him around here contributing features and helping with + bug reports and issues. +
+

+
- \ No newline at end of file +