@glodon-aiot/dataset-annotation 3.3.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,51 +1,45 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
let
|
|
4
|
-
e.on("mouse:down", (
|
|
5
|
-
|
|
1
|
+
function I(e, u) {
|
|
2
|
+
y(e);
|
|
3
|
+
let h = -1, s = -1, n = 0, p = 0;
|
|
4
|
+
e.on("mouse:down", (g) => {
|
|
5
|
+
h = -1, s = -1, n = 0, p = 0;
|
|
6
|
+
const i = e.getZoom();
|
|
7
|
+
s = g.e.offsetX / i, h = g.e.offsetY / i;
|
|
8
|
+
}), e.on("mouse:up", (g) => {
|
|
9
|
+
if (s === -1 && h === -1)
|
|
6
10
|
return;
|
|
7
|
-
i =
|
|
8
|
-
|
|
9
|
-
h = s.e.offsetX / l, i = s.e.offsetY / l;
|
|
10
|
-
}), e.on("mouse:up", (s) => {
|
|
11
|
-
if (e.getActiveObject()) {
|
|
12
|
-
i = -1, h = -1, u = 0, n = 0;
|
|
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
|
+
if (n = Math.abs(m - s), p = Math.abs(w - h), n === 0 || p === 0)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
if (u = Math.abs(m - h), n = Math.abs(w - i), u === 0 || n === 0)
|
|
19
|
-
return;
|
|
20
|
-
const y = e.viewportTransform ? e.viewportTransform[4] / l : 0, T = e.viewportTransform ? e.viewportTransform[5] / l : 0;
|
|
21
|
-
let f = i > w ? w : i, r = h > m ? m : h, d = u, g = n;
|
|
22
|
-
f = f - T, r = r - y;
|
|
23
|
-
const X = () => {
|
|
14
|
+
const T = e.viewportTransform ? e.viewportTransform[4] / i : 0, X = e.viewportTransform ? e.viewportTransform[5] / i : 0;
|
|
15
|
+
let f = h > w ? w : h, r = s > m ? m : s, l = n, d = p;
|
|
16
|
+
f = f - X, r = r - T;
|
|
17
|
+
const Y = () => {
|
|
24
18
|
var o, b;
|
|
25
19
|
const t = e.backgroundImage;
|
|
26
|
-
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 && (
|
|
27
|
-
},
|
|
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
|
+
}, k = (t) => {
|
|
28
22
|
const o = e.backgroundImage;
|
|
29
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));
|
|
30
24
|
};
|
|
31
|
-
|
|
32
|
-
const c = [[r, f], [r +
|
|
33
|
-
|
|
25
|
+
Y();
|
|
26
|
+
const c = [[r, f], [r + l, f], [r + l, f + d], [r, f + d]];
|
|
27
|
+
u && c.every((t) => k(t)) && u({
|
|
34
28
|
id: "",
|
|
35
29
|
color: "#cccccc",
|
|
36
30
|
label: "未知",
|
|
37
31
|
box: c
|
|
38
|
-
}), e.skipTargetFind = !1;
|
|
32
|
+
}), e.skipTargetFind = !1, y(e);
|
|
39
33
|
});
|
|
40
34
|
}
|
|
41
|
-
const
|
|
35
|
+
const y = (e) => {
|
|
42
36
|
e.off("mouse:down"), e.off("mouse:up");
|
|
43
37
|
};
|
|
44
|
-
function x(e,
|
|
45
|
-
if (!
|
|
46
|
-
return
|
|
38
|
+
function x(e, u, h) {
|
|
39
|
+
if (!h)
|
|
40
|
+
return I(e, u), e;
|
|
47
41
|
}
|
|
48
42
|
export {
|
|
49
43
|
x as drawable,
|
|
50
|
-
|
|
44
|
+
y as stopDraw
|
|
51
45
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var p = Object.defineProperty,
|
|
2
|
-
var
|
|
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) =>
|
|
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("
|
|
212
|
+
}), this._fabricRect.on("mousedown", () => {
|
|
213
213
|
this._fabricRect && this.canvas.setActiveObject(this._fabricRect);
|
|
214
214
|
});
|
|
215
215
|
const s = (o) => {
|