Skip to content

Commit 42b8259

Browse files
authored
fix(): tweaks to type getter (#9022)
1 parent fe813e1 commit 42b8259

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

.codesandbox/templates/vanilla/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fabric from 'fabric';
22
import './styles.css';
33

44
const el = document.getElementById('canvas');
5-
const canvas = new fabric.Canvas(el);
5+
const canvas = (window.canvas = new fabric.Canvas(el));
66

77
// edit from here
88
canvas.setDimensions({

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [next]
44

5+
- fix(): tweaks to type getter [#9022](https://github.com/fabricjs/fabric.js/pull/9022)
56
- ci() Refactor GHA actions for caching and reuse [#9029](https://github.com/fabricjs/fabric.js/pull/9029)
67
- ci(): install dev deps types [#9039](https://github.com/fabricjs/fabric.js/pull/9039)
78

src/filters/ColorMatrixFilters.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { classRegistry } from '../ClassRegistry';
33

44
export function createColorMatrixFilter(key: string, matrix: number[]) {
55
const newClass = class extends ColorMatrix {
6-
get type() {
7-
return key;
8-
}
9-
106
static type = key;
117

128
static defaults = {

src/shapes/IText/IText.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ export class IText<
205205
static type = 'IText';
206206

207207
get type() {
208-
return 'i-text';
208+
const type = super.type;
209+
// backward compatibility
210+
return type === 'itext' ? 'i-text' : type;
209211
}
210212

211213
/**

0 commit comments

Comments
 (0)