bill 1 Minggu lalu
induk
melakukan
aae4a2ef15
1 mengubah file dengan 8 tambahan dan 5 penghapusan
  1. 8 5
      src/example/platform/resource-swkk.ts

+ 8 - 5
src/example/platform/resource-swkk.ts

@@ -496,14 +496,17 @@ export const getAIBorderTaggingInfos = async (
     //   const curSubgroup = reg ? Number(reg[1]) : undefined;
     //   if (curSubgroup !== subgroup) continue;
     // }
-
-    const min = { x: shape.bbox[0][0], y: shape.bbox[0][2] };
-    const max = { x: shape.bbox[0][0], y: shape.bbox[0][2] };
+    for (const box of shape.bbox) {
+      box[1] *= -1
+      // console.log(box)
+    }
+    const min = { x: shape.bbox[0][0], y: shape.bbox[0][1] };
+    const max = { x: shape.bbox[0][0], y: shape.bbox[0][1] };
     for (const box of shape.bbox) {
       min.x = Math.min(box[0], min.x);
-      min.y = Math.min(box[2], min.y);
+      min.y = Math.min(box[1], min.y);
       max.x = Math.max(box[0], max.x);
-      max.y = Math.max(box[2], max.y);
+      max.y = Math.max(box[1], max.y);
     }
     min.x *= scale;
     min.y *= scale;