customized-fabric 1.6.2 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,7 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
23
23
  textAlign: "center",
24
24
  objectCaching: false,
25
25
  ...text,
26
+ fontFamily: "",
26
27
  });
27
28
  const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
28
29
  this.set(group);
@@ -51,9 +52,6 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
51
52
  layerId: options?.personalizeId ?? options?.layerId,
52
53
  objectCaching: false,
53
54
  });
54
- this.textObject.set({
55
- width: this.width,
56
- });
57
55
  if (options?.isOriginal) {
58
56
  this.rectObject?.set({ strokeWidth: 0 });
59
57
  }
@@ -61,14 +59,9 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
61
59
  if (options?.hideStroke) {
62
60
  this.rectObject?.set({ strokeWidth: 0 });
63
61
  }
64
- if (options?.fontUrl) {
65
- (0, utils_1.loadFontFromUrl)(options?.fontUrl, text?.fontFamily ?? "").then(() => {
66
- this.autoChangeFontSize(0.1);
67
- this.canvas?.renderAll?.();
68
- });
69
- }
62
+ this.setFontFamily(text?.fontFamily ?? "", options?.fontUrl);
70
63
  }
71
- this.autoChangeFontSize(0.1);
64
+ this.fire("scaling");
72
65
  },
73
66
  autoChangeFontSize: function (changeSpeed) {
74
67
  if (this.width <= this.textObject.__lineWidths ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",