|
|
|
|
@ -165,18 +165,21 @@ class AnnotationsFilter {
|
|
|
|
|
let xbr = Number.MIN_SAFE_INTEGER;
|
|
|
|
|
let ytl = Number.MAX_SAFE_INTEGER;
|
|
|
|
|
let ybr = Number.MIN_SAFE_INTEGER;
|
|
|
|
|
let [width, height] = [null, null];
|
|
|
|
|
|
|
|
|
|
if (state.objectType !== 'tag') {
|
|
|
|
|
state.points.forEach((coord, idx) => {
|
|
|
|
|
if (idx % 2) { // y
|
|
|
|
|
ytl = Math.min(ytl, coord);
|
|
|
|
|
ybr = Math.max(ybr, coord);
|
|
|
|
|
} else { // x
|
|
|
|
|
xtl = Math.min(xtl, coord);
|
|
|
|
|
xbr = Math.max(xbr, coord);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
[width, height] = [xbr - xtl, ybr - ytl];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state.points.forEach((coord, idx) => {
|
|
|
|
|
if (idx % 2) { // y
|
|
|
|
|
ytl = Math.min(ytl, coord);
|
|
|
|
|
ybr = Math.max(ybr, coord);
|
|
|
|
|
} else { // x
|
|
|
|
|
xtl = Math.min(xtl, coord);
|
|
|
|
|
xbr = Math.max(xbr, coord);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const [width, height] = [xbr - xtl, ybr - ytl];
|
|
|
|
|
const attributes = {};
|
|
|
|
|
Object.keys(state.attributes).reduce((acc, key) => {
|
|
|
|
|
const attr = labelAttributes[key];
|
|
|
|
|
|