@glodon-aiot/dataset-annotation 3.10.0-alpha.21 → 3.10.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- function Y(e, n) {
1
+ function X(e, n) {
2
2
  T(e);
3
3
  let h = -1, s = -1, p = 0, m = 0, w = !1;
4
4
  e.on("mouse:down:before", (d) => {
5
5
  const f = d.target, u = e.getActiveObject();
6
- if (f && f !== e.backgroundImage && u === f) {
7
- e.skipTargetFind = !1;
6
+ if (f && f !== e.backgroundImage) {
7
+ u !== f && (e.setActiveObject(f), e.requestRenderAll()), e.skipTargetFind = !1;
8
8
  return;
9
9
  }
10
10
  u && (e.discardActiveObject(), e.renderAll()), e.skipTargetFind = !0;
@@ -20,20 +20,20 @@ function Y(e, n) {
20
20
  const f = e.getZoom(), u = d.e.offsetX > e.getWidth() ? e.getWidth() / f : d.e.offsetX / f, b = d.e.offsetY > e.getHeight() ? e.getHeight() / f : d.e.offsetY / f;
21
21
  if (p = Math.abs(u - s), m = Math.abs(b - h), p === 0 || m === 0)
22
22
  return;
23
- const y = e.viewportTransform ? e.viewportTransform[4] / f : 0, F = e.viewportTransform ? e.viewportTransform[5] / f : 0;
23
+ const y = e.viewportTransform ? e.viewportTransform[4] / f : 0, A = e.viewportTransform ? e.viewportTransform[5] / f : 0;
24
24
  let r = h > b ? b : h, i = s > u ? u : s, l = p, g = m;
25
- r = r - F, i = i - y;
26
- const I = () => {
25
+ r = r - A, i = i - y;
26
+ const F = () => {
27
27
  var o, k;
28
28
  const t = e.backgroundImage;
29
29
  t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (k = t.aCoords) != null && k.tl.y), t && typeof t != "string" && t.top !== void 0 && t.height !== void 0 && t.left !== void 0 && t.width !== void 0 && (r < t.top && (g = g - (t.top - r), r = t.top), r + g > t.top + t.height && (g = t.top + t.height - r + g - g, r = t.height + t.top - g), i < t.left && (l = l - (t.left - i), i = t.left), i + l > t.left + t.width && (l = t.left + t.width - i + l - l, i = t.width + t.left - l));
30
- }, X = (t) => {
30
+ }, I = (t) => {
31
31
  const o = e.backgroundImage;
32
32
  return !(o && typeof o != "string" && o.top !== void 0 && o.height !== void 0 && o.left !== void 0 && o.width !== void 0 && (t[0] < o.left || t[1] < o.top || t[0] > o.left + o.width || t[1] > o.top + o.height));
33
33
  };
34
- I();
34
+ F();
35
35
  const c = [[i, r], [i + l, r], [i + l, r + g], [i, r + g]];
36
- n && c.every((t) => X(t)) && n({
36
+ n && c.every((t) => I(t)) && n({
37
37
  id: "",
38
38
  color: "#cccccc",
39
39
  label: "未知",
@@ -44,11 +44,11 @@ function Y(e, n) {
44
44
  const T = (e) => {
45
45
  e.off("mouse:down"), e.off("mouse:down:before"), e.off("mouse:up"), e.skipTargetFind = !1;
46
46
  };
47
- function j(e, n, h) {
47
+ function Y(e, n, h) {
48
48
  if (!h)
49
- return Y(e, n), e;
49
+ return X(e, n), e;
50
50
  }
51
51
  export {
52
- j as drawable,
52
+ Y as drawable,
53
53
  T as stopDraw
54
54
  };
@@ -1,20 +1,20 @@
1
- var p = Object.defineProperty, m = Object.defineProperties;
2
- var u = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var w = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
- var g = (l, e, s) => e in l ? p(l, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[e] = s, n = (l, e) => {
6
- for (var s in e || (e = {}))
7
- w.call(e, s) && g(l, s, e[s]);
8
- if (b)
9
- for (var s of b(e))
10
- C.call(e, s) && g(l, s, e[s]);
1
+ var j = Object.defineProperty, A = Object.defineProperties;
2
+ var B = Object.getOwnPropertyDescriptors;
3
+ var F = Object.getOwnPropertySymbols;
4
+ var T = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
+ var w = (l, i, s) => i in l ? j(l, i, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[i] = s, f = (l, i) => {
6
+ for (var s in i || (i = {}))
7
+ T.call(i, s) && w(l, s, i[s]);
8
+ if (F)
9
+ for (var s of F(i))
10
+ I.call(i, s) && w(l, s, i[s]);
11
11
  return l;
12
- }, v = (l, e) => m(l, u(e));
13
- var f = (l, e, s) => (g(l, typeof e != "symbol" ? e + "" : e, s), s);
14
- import { fabric as d } from "fabric";
15
- import y from "./FabricCustomize.mjs";
16
- import { formatColorToArray as _ } from "../../../../utils/color.mjs";
17
- const $ = {
12
+ }, C = (l, i) => A(l, B(i));
13
+ var d = (l, i, s) => (w(l, typeof i != "symbol" ? i + "" : i, s), s);
14
+ import { fabric as g } from "fabric";
15
+ import O from "./FabricCustomize.mjs";
16
+ import { formatColorToArray as X } from "../../../../utils/color.mjs";
17
+ const z = {
18
18
  borderWidth: 2,
19
19
  controls: ["TL", "BL", "TR", "BR"],
20
20
  cornerStrokeColor: "#84868C",
@@ -22,16 +22,16 @@ const $ = {
22
22
  visible: !0,
23
23
  active: !1
24
24
  };
25
- class F {
26
- constructor(e, s, h) {
27
- f(this, "config");
28
- f(this, "color");
29
- f(this, "_active", !1);
30
- f(this, "_fabricRect", null);
31
- f(this, "_label", null);
32
- f(this, "_hover", !1);
33
- f(this, "_strokeRect");
34
- this._canvas = s, this.handlers = h, d.Rect.prototype.cornerColor = "blue", this.config = n(n({}, $), e), this.color = _(e.color), this._active = this.config.active || !1, s && this.render(s);
25
+ class M {
26
+ constructor(i, s, a) {
27
+ d(this, "config");
28
+ d(this, "color");
29
+ d(this, "_active", !1);
30
+ d(this, "_fabricRect", null);
31
+ d(this, "_label", null);
32
+ d(this, "_hover", !1);
33
+ d(this, "_strokeRect");
34
+ this._canvas = s, this.handlers = a, g.Rect.prototype.cornerColor = "blue", this.config = f(f({}, z), i), this.color = X(i.color), this._active = this.config.active || !1, s && this.render(s);
35
35
  }
36
36
  get object() {
37
37
  return this._fabricRect;
@@ -39,22 +39,22 @@ class F {
39
39
  get active() {
40
40
  return this._active;
41
41
  }
42
- set active(e) {
42
+ set active(i) {
43
43
  var s;
44
- this._active = e, (s = this._fabricRect) != null && s.canvas && (e && !this.config.hideDelete ? (this._fabricRect.set(this.activeStyle), this.canvas.setActiveObject(this._fabricRect)) : (this.canvas.discardActiveObject(), this.hover || this._fabricRect.set(this.normalStyle)), this.canvas.requestRenderAll());
44
+ this._active = i, (s = this._fabricRect) != null && s.canvas && (i && !this.config.hideDelete ? (this._fabricRect.set(this.activeStyle), this.canvas.setActiveObject(this._fabricRect)) : (this.canvas.discardActiveObject(), this.hover || this._fabricRect.set(this.normalStyle)), this.canvas.requestRenderAll());
45
45
  }
46
46
  get hover() {
47
47
  return this._hover;
48
48
  }
49
- set hover(e) {
50
- var s, h;
51
- this._hover = e, e ? (s = this._fabricRect) == null || s.set(this.hoverStyle) : this.active || (h = this._fabricRect) == null || h.set(this.normalStyle), this.canvas.requestRenderAll();
49
+ set hover(i) {
50
+ var s, a;
51
+ this._hover = i, i ? (s = this._fabricRect) == null || s.set(this.hoverStyle) : this.active || (a = this._fabricRect) == null || a.set(this.normalStyle), this.canvas.requestRenderAll();
52
52
  }
53
53
  get canvas() {
54
54
  return this._canvas;
55
55
  }
56
- set canvas(e) {
57
- this._canvas !== e && (this._canvas = e, this.render(e));
56
+ set canvas(i) {
57
+ this._canvas !== i && (this._canvas = i, this.render(i));
58
58
  }
59
59
  get normalStyle() {
60
60
  return {
@@ -68,7 +68,7 @@ class F {
68
68
  };
69
69
  }
70
70
  get activeStyle() {
71
- return v(n({}, this.normalStyle), {
71
+ return C(f({}, this.normalStyle), {
72
72
  content: `<svg height="500" width="500"><text fill="#ffffff" font-size="45" x="50" y="86">${this.config.name}</text></svg>`,
73
73
  fill: `rgba(${this.color[0]},${this.color[1]}, ${this.color[2]}, 0.1)`
74
74
  });
@@ -77,37 +77,40 @@ class F {
77
77
  return this.activeStyle;
78
78
  }
79
79
  createRect() {
80
- const e = {
80
+ const i = {
81
81
  hasBorders: !1,
82
82
  cornerSize: 6,
83
83
  cornerStrokeColor: "#84868C",
84
84
  cornerColor: "#FFFFFF",
85
85
  transparentCorners: !1
86
- }, s = 0, h = new d.Rect(
86
+ }, s = 0, a = new g.Rect(
87
87
  // this.config.points?.map((p) => ({ x: p[0], y: p[1] })),
88
- n(n({
88
+ C(f(f({
89
89
  left: this.config.points[0][0],
90
90
  top: this.config.points[0][1],
91
91
  width: this.config.points[2][0] - this.config.points[0][0] - s,
92
92
  height: this.config.points[2][1] - this.config.points[0][1] - s
93
- }, e), this.normalStyle)
93
+ }, i), this.normalStyle), {
94
+ // 禁止缩放时翻转
95
+ lockScalingFlip: !0
96
+ })
94
97
  );
95
- h.setControlsVisibility({
98
+ a.setControlsVisibility({
96
99
  mtr: !1
97
100
  });
98
- const a = () => {
99
- if (h.canvas !== this.canvas) {
100
- this.canvas.off("after:render", a);
101
+ const c = () => {
102
+ if (a.canvas !== this.canvas) {
103
+ this.canvas.off("after:render", c);
101
104
  return;
102
105
  }
103
106
  this.canvas.contextContainer.strokeStyle = `rgb(${this.color[0]},${this.color[1]}, ${this.color[2]})`;
104
- const o = h.getBoundingRect();
107
+ const o = a.getBoundingRect();
105
108
  this._strokeRect = this.canvas.contextContainer.strokeRect(o.left + 0.5, o.top + 0.5, o.width, o.height);
106
109
  };
107
- return this.canvas.on("after:render", a), h;
110
+ return this.canvas.on("after:render", c), a;
108
111
  }
109
- scaledNumber(e) {
110
- return e / this.canvas.getZoom();
112
+ scaledNumber(i) {
113
+ return i / this.canvas.getZoom();
111
114
  }
112
115
  // getPolyVertices(poly: fabric.Rect) {
113
116
  // const points = poly.points,
@@ -130,25 +133,28 @@ class F {
130
133
  // });
131
134
  // }
132
135
  createLabelName() {
133
- const [e, s, h] = this.color, a = new d.Text(this.handlers.renderLabelItem ? this.handlers.renderLabelItem(this.config) : this.config.name, {
136
+ const [i, s, a] = this.color, c = new g.Text(this.handlers.renderLabelItem ? this.handlers.renderLabelItem(this.config) : this.config.name, {
134
137
  fill: "#FFFFFF",
135
138
  fontSize: 12,
136
139
  selectable: !1,
140
+ evented: !1,
137
141
  top: 4,
138
142
  left: 8
139
- }), o = new d.Rect({
143
+ }), o = new g.Rect({
140
144
  selectable: !1,
145
+ evented: !1,
141
146
  strokeWidth: 0,
142
- fill: `rgb(${e},${s},${h})`,
147
+ fill: `rgb(${i},${s},${a})`,
143
148
  rx: 2,
144
149
  ry: 2,
145
- width: (a.width || 0) + 16,
146
- height: (a.height || 0) + 8,
150
+ width: (c.width || 0) + 16,
151
+ height: (c.height || 0) + 8,
147
152
  left: 0,
148
153
  top: 0
149
154
  });
150
- return new d.Group([o, a], {
155
+ return new g.Group([o, c], {
151
156
  selectable: !1,
157
+ evented: !1,
152
158
  // lockScalingX: false,
153
159
  // lockScalingY: false,
154
160
  scaleX: 1 / this.canvas.getZoom(),
@@ -156,25 +162,25 @@ class F {
156
162
  });
157
163
  }
158
164
  renderLabel() {
159
- var e, s;
165
+ var i, s;
160
166
  if (this._fabricRect) {
161
167
  if (this._label || (this._label = this.createLabelName(), this.setLabelPosition()), this._label.canvas === this.canvas) {
162
- const h = this._label.getObjects().find((o) => o.type === "rect"), a = this._label.getObjects().find((o) => o.type === "text");
163
- if (a) {
164
- a.set({
168
+ const a = this._label.getObjects().find((o) => o.type === "rect"), c = this._label.getObjects().find((o) => o.type === "text");
169
+ if (c) {
170
+ c.set({
165
171
  text: this.handlers.renderLabelItem ? this.handlers.renderLabelItem(this.config) : this.config.name,
166
172
  left: 8
167
173
  // fontSize: this.scaledNumber(12),
168
174
  });
169
- const o = (a.getBoundingRect().width || 0) + 16;
170
- h == null || h.set({
175
+ const o = (c.getBoundingRect().width || 0) + 16;
176
+ a == null || a.set({
171
177
  fill: `rgba(${this.color[0]},${this.color[1]}, ${this.color[2]}, 1)`,
172
178
  width: o,
173
179
  left: -o / 2
174
- }), a.set({
180
+ }), c.set({
175
181
  left: -o / 2 + 8
176
182
  });
177
- const r = ((e = this._fabricRect.aCoords) == null ? void 0 : e.tl.x) !== void 0 ? (s = this._fabricRect.aCoords) == null ? void 0 : s.tl.x : void 0;
183
+ const r = ((i = this._fabricRect.aCoords) == null ? void 0 : i.tl.x) !== void 0 ? (s = this._fabricRect.aCoords) == null ? void 0 : s.tl.x : void 0;
178
184
  this._label.set({
179
185
  left: r,
180
186
  width: o
@@ -186,26 +192,26 @@ class F {
186
192
  }
187
193
  }
188
194
  setLabelPosition() {
189
- var r, t, i, c;
195
+ var r, t, e, h;
190
196
  if (!this._fabricRect || !this._label)
191
197
  return;
192
- const e = this._label.getObjects().find((R) => R.type === "rect");
193
- if (!e)
198
+ const i = this._label.getObjects().find((b) => b.type === "rect");
199
+ if (!i)
194
200
  return;
195
- const s = e.height ? e.height : void 0, h = e.width ? e.width : void 0, a = ((r = this._fabricRect.aCoords) == null ? void 0 : r.tl.y) !== void 0 && s !== void 0 && e.scaleY ? ((t = this._fabricRect.aCoords) == null ? void 0 : t.tl.y) - s / this.canvas.getZoom() : void 0, o = ((i = this._fabricRect.aCoords) == null ? void 0 : i.tl.x) !== void 0 ? (c = this._fabricRect.aCoords) == null ? void 0 : c.tl.x : void 0;
201
+ const s = i.height ? i.height : void 0, a = i.width ? i.width : void 0, c = ((r = this._fabricRect.aCoords) == null ? void 0 : r.tl.y) !== void 0 && s !== void 0 && i.scaleY ? ((t = this._fabricRect.aCoords) == null ? void 0 : t.tl.y) - s / this.canvas.getZoom() : void 0, o = ((e = this._fabricRect.aCoords) == null ? void 0 : e.tl.x) !== void 0 ? (h = this._fabricRect.aCoords) == null ? void 0 : h.tl.x : void 0;
196
202
  this._label.set({
197
- top: a,
203
+ top: c,
198
204
  left: o,
199
205
  height: s,
200
- width: h,
206
+ width: a,
201
207
  scaleX: 1 / this.canvas.getZoom(),
202
208
  scaleY: 1 / this.canvas.getZoom()
203
- }), this.config = n({}, this.config);
209
+ }), this.config = f({}, this.config);
204
210
  }
205
- addToCanvas(e) {
211
+ addToCanvas(i) {
206
212
  if (!this._fabricRect)
207
213
  return;
208
- this.canvas = e, this.canvas.add(this._fabricRect), this._fabricRect.on("mouseover", (o) => {
214
+ this.canvas = i, this.canvas.add(this._fabricRect), this._fabricRect.on("mouseover", (o) => {
209
215
  this.hover = !0;
210
216
  }), this._fabricRect.on("mouseout", (o) => {
211
217
  this.hover = !1;
@@ -219,65 +225,87 @@ class F {
219
225
  this.canvas.on("selection:created", s), this.canvas.on("selection:updated", s), this.canvas.on("selection:cleared", (o) => {
220
226
  this.active && (this.active = !1);
221
227
  });
222
- const h = (o) => {
228
+ const a = (o) => {
229
+ var b, y, x, S, $, L;
223
230
  const r = o.transform.action;
224
231
  o.transform.corner;
225
- const t = o.transform.target, i = o.transform.target.canvas.backgroundImage, c = 0;
226
- i && (r === "drag" && (t.top < i.top && t.set({
227
- top: i.top
228
- }), t.top + (t.height + c) * t.scaleY > i.top + i.height && t.set({
229
- top: i.height + i.top - (t.height + c) * t.scaleY
230
- }), t.left < i.left && t.set({
231
- left: i.left
232
- }), t.left + (t.width + c) * t.scaleX > i.left + i.width && t.set({
233
- left: i.width + i.left - (t.width + c) * t.scaleX
234
- })), r === "scale" && (t.top + (t.height + c) * t.scaleY > i.top + i.height && t.set({
235
- top: (t.height + c) * t.scaleY > i.height ? i.top : i.top + i.height - (t.height + c) * t.scaleY,
236
- height: (t.height + c) * t.scaleY > i.height ? i.height - c : t.height + c
237
- }), t.left + (t.width + c) * t.scaleX > i.left + i.width && t.set({
238
- left: i.width + i.left - (t.width + c) * t.scaleX
239
- })), r === "scaleX" && (t.left + (t.width + c) * t.scaleX > i.left + i.width && t.set({
240
- left: t.left - (t.left + (t.width + c) * t.scaleX - (i.left + i.width))
241
- }), t.left < i.left && t.set({
242
- left: i.left
243
- })), r === "scaleY" && (t.top + (t.height + c) * t.scaleY > i.top + i.height && t.set({
244
- top: t.top - (t.top + (t.height + c) * t.scaleY - (i.top + i.height))
245
- }), t.top < i.top && t.set({
246
- top: i.top
247
- })), (t.width + c) * t.scaleX > i.width && t.set({
248
- left: i.left,
249
- width: (i.width - c) / t.scaleX
250
- }), (t.height + c) * t.scaleY > i.height && t.set({
251
- top: i.top,
252
- height: (i.height - c) / t.scaleY
253
- })), this.canvas.renderAll();
254
- }, a = (o) => {
255
- h(o), this.setLabelPosition();
232
+ const t = o.transform.target, e = o.transform.target.canvas.backgroundImage, h = 0;
233
+ if (e && (r === "drag" && (t.top < e.top && t.set({
234
+ top: e.top
235
+ }), t.top + (t.height + h) * t.scaleY > e.top + e.height && t.set({
236
+ top: e.height + e.top - (t.height + h) * t.scaleY
237
+ }), t.left < e.left && t.set({
238
+ left: e.left
239
+ }), t.left + (t.width + h) * t.scaleX > e.left + e.width && t.set({
240
+ left: e.width + e.left - (t.width + h) * t.scaleX
241
+ })), r === "scale" && (t.top + (t.height + h) * t.scaleY > e.top + e.height && t.set({
242
+ top: (t.height + h) * t.scaleY > e.height ? e.top : e.top + e.height - (t.height + h) * t.scaleY,
243
+ height: (t.height + h) * t.scaleY > e.height ? e.height - h : t.height + h
244
+ }), t.left + (t.width + h) * t.scaleX > e.left + e.width && t.set({
245
+ left: e.width + e.left - (t.width + h) * t.scaleX
246
+ })), r === "scaleX" && (t.left + (t.width + h) * t.scaleX > e.left + e.width && t.set({
247
+ left: t.left - (t.left + (t.width + h) * t.scaleX - (e.left + e.width))
248
+ }), t.left < e.left && t.set({
249
+ left: e.left
250
+ })), r === "scaleY" && (t.top + (t.height + h) * t.scaleY > e.top + e.height && t.set({
251
+ top: t.top - (t.top + (t.height + h) * t.scaleY - (e.top + e.height))
252
+ }), t.top < e.top && t.set({
253
+ top: e.top
254
+ })), (t.width + h) * t.scaleX > e.width && t.set({
255
+ left: e.left,
256
+ width: (e.width - h) / t.scaleX
257
+ }), (t.height + h) * t.scaleY > e.height && t.set({
258
+ top: e.top,
259
+ height: (e.height - h) / t.scaleY
260
+ })), e) {
261
+ const v = t.getBoundingRect(!0), R = (b = e.left) != null ? b : 0, m = (y = e.top) != null ? y : 0, k = R + ((x = e.width) != null ? x : 0), Y = m + ((S = e.height) != null ? S : 0);
262
+ if (v.width > (($ = e.width) != null ? $ : v.width)) {
263
+ const u = (e.width - h) / Math.max(t.width, 1);
264
+ t.set({
265
+ scaleX: Math.min(t.scaleX, u)
266
+ });
267
+ }
268
+ if (v.height > ((L = e.height) != null ? L : v.height)) {
269
+ const u = (e.height - h) / Math.max(t.height, 1);
270
+ t.set({
271
+ scaleY: Math.min(t.scaleY, u)
272
+ });
273
+ }
274
+ const n = t.getBoundingRect(!0);
275
+ let _ = 0, p = 0;
276
+ n.left < R ? _ = R - n.left : n.left + n.width > k && (_ = k - (n.left + n.width)), n.top < m ? p = m - n.top : n.top + n.height > Y && (p = Y - (n.top + n.height)), (_ !== 0 || p !== 0) && t.set({
277
+ left: t.left + _,
278
+ top: t.top + p
279
+ });
280
+ }
281
+ this.canvas.renderAll();
282
+ }, c = (o) => {
283
+ a(o), this.setLabelPosition();
256
284
  };
257
- this._fabricRect.on("moving", a), this._fabricRect.on("scaling", a), this._fabricRect.on("rotating", a), this._fabricRect.on("skewing", a), this._fabricRect.on("resizing", a), this.canvas.on("object:removed", (o) => {
285
+ this._fabricRect.on("moving", c), this._fabricRect.on("scaling", c), this._fabricRect.on("rotating", c), this._fabricRect.on("skewing", c), this._fabricRect.on("resizing", c), this.canvas.on("object:removed", (o) => {
258
286
  o.target === this._fabricRect && this.destroy();
259
287
  }), this.canvas.on("object:modified", (o) => {
260
288
  o.target === this._fabricRect && (this.setLabelPosition(), this.handlers.onChange && this.handlers.onChange(this));
261
289
  });
262
290
  }
263
- render(e) {
264
- y(d), this._fabricRect || (this._fabricRect = this.createRect()), this._fabricRect.canvas === this.canvas ? this._fabricRect.set({
291
+ render(i) {
292
+ O(g), this._fabricRect || (this._fabricRect = this.createRect()), this._fabricRect.canvas === this.canvas ? this._fabricRect.set({
265
293
  fill: `rgba(${this.color[0]},${this.color[1]}, ${this.color[2]}, 0)`,
266
294
  stroke: `rgba(${this.color[0]},${this.color[1]}, ${this.color[2]}, 1)`
267
- }) : this.addToCanvas(e), this.renderLabel();
295
+ }) : this.addToCanvas(i), this.renderLabel();
268
296
  try {
269
297
  this.canvas.renderAll();
270
298
  } catch (s) {
271
299
  console.log("render failed");
272
300
  }
273
301
  }
274
- set labelConfig(e) {
275
- this.config = n(n({}, this.config), e), this.color = _(e.color), this.render(this.canvas), this.handlers.onChange && this.handlers.onChange(this);
302
+ set labelConfig(i) {
303
+ this.config = f(f({}, this.config), i), this.color = X(i.color), this.render(this.canvas), this.handlers.onChange && this.handlers.onChange(this);
276
304
  }
277
305
  destroy() {
278
306
  this._fabricRect && this.canvas.remove(this._fabricRect), this._label && this.canvas.remove(this._label), this._label = null, this._fabricRect = null, this.canvas.requestRenderAll(), this.handlers.onDelete && this.handlers.onDelete(this);
279
307
  }
280
308
  }
281
309
  export {
282
- F as default
310
+ M as default
283
311
  };