@glodon-aiot/dataset-annotation 3.3.1-beta.0 → 3.3.1-beta.1

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,5 +1,5 @@
1
- function k(e, u) {
2
- I(e);
1
+ function I(e, u) {
2
+ y(e);
3
3
  let h = -1, s = -1, n = 0, p = 0;
4
4
  e.on("mouse:down", (g) => {
5
5
  h = -1, s = -1, n = 0, p = 0;
@@ -11,35 +11,35 @@ function k(e, u) {
11
11
  const i = e.getZoom(), m = g.e.offsetX > e.getWidth() ? e.getWidth() / i : g.e.offsetX / i, w = g.e.offsetY > e.getHeight() ? e.getHeight() / i : g.e.offsetY / i;
12
12
  if (n = Math.abs(m - s), p = Math.abs(w - h), n === 0 || p === 0)
13
13
  return;
14
- const y = e.viewportTransform ? e.viewportTransform[4] / i : 0, T = e.viewportTransform ? e.viewportTransform[5] / i : 0;
14
+ const T = e.viewportTransform ? e.viewportTransform[4] / i : 0, X = e.viewportTransform ? e.viewportTransform[5] / i : 0;
15
15
  let f = h > w ? w : h, r = s > m ? m : s, l = n, d = p;
16
- f = f - T, r = r - y;
17
- const X = () => {
16
+ f = f - X, r = r - T;
17
+ const Y = () => {
18
18
  var o, b;
19
19
  const t = e.backgroundImage;
20
20
  t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (b = t.aCoords) != null && b.tl.y), t && typeof t != "string" && t.top !== void 0 && t.height !== void 0 && t.left !== void 0 && t.width !== void 0 && (f < t.top && (d = d - (t.top - f), f = t.top), f + d > t.top + t.height && (d = t.top + t.height - f + d - d, f = t.height + t.top - d), r < t.left && (l = l - (t.left - r), r = t.left), r + l > t.left + t.width && (l = t.left + t.width - r + l - l, r = t.width + t.left - l));
21
- }, Y = (t) => {
21
+ }, k = (t) => {
22
22
  const o = e.backgroundImage;
23
23
  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));
24
24
  };
25
- X();
25
+ Y();
26
26
  const c = [[r, f], [r + l, f], [r + l, f + d], [r, f + d]];
27
- u && c.every((t) => Y(t)) && u({
27
+ u && c.every((t) => k(t)) && u({
28
28
  id: "",
29
29
  color: "#cccccc",
30
30
  label: "未知",
31
31
  box: c
32
- }), e.skipTargetFind = !1;
32
+ }), e.skipTargetFind = !1, y(e);
33
33
  });
34
34
  }
35
- const I = (e) => {
35
+ const y = (e) => {
36
36
  e.off("mouse:down"), e.off("mouse:up");
37
37
  };
38
38
  function x(e, u, h) {
39
39
  if (!h)
40
- return k(e, u), e;
40
+ return I(e, u), e;
41
41
  }
42
42
  export {
43
43
  x as drawable,
44
- I as stopDraw
44
+ y as stopDraw
45
45
  };
@@ -1,5 +1,5 @@
1
- var p = Object.defineProperty, u = Object.defineProperties;
2
- var m = Object.getOwnPropertyDescriptors;
1
+ var p = Object.defineProperty, m = Object.defineProperties;
2
+ var u = Object.getOwnPropertyDescriptors;
3
3
  var b = Object.getOwnPropertySymbols;
4
4
  var w = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
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) => {
@@ -9,7 +9,7 @@ var g = (l, e, s) => e in l ? p(l, e, { enumerable: !0, configurable: !0, writab
9
9
  for (var s of b(e))
10
10
  C.call(e, s) && g(l, s, e[s]);
11
11
  return l;
12
- }, v = (l, e) => u(l, m(e));
12
+ }, v = (l, e) => m(l, u(e));
13
13
  var f = (l, e, s) => (g(l, typeof e != "symbol" ? e + "" : e, s), s);
14
14
  import { fabric as d } from "fabric";
15
15
  import y from "./FabricCustomize.mjs";
@@ -209,7 +209,7 @@ class F {
209
209
  this.hover = !0;
210
210
  }), this._fabricRect.on("mouseout", (o) => {
211
211
  this.hover = !1;
212
- }), this._fabricRect.on("mouseup", () => {
212
+ }), this._fabricRect.on("mousedown", () => {
213
213
  this._fabricRect && this.canvas.setActiveObject(this._fabricRect);
214
214
  });
215
215
  const s = (o) => {