fix(parser): dynamically extract OLE2FRAME 4-corner coordinates from binary OLE stream header; remove hardcoded coordinates

This commit is contained in:
minsung
2026-07-30 16:10:43 +09:00
parent 963a90319e
commit 76f3e20582
12 changed files with 4865 additions and 17 deletions
+7 -17
View File
@@ -796,23 +796,13 @@ export class Viewer2D {
const appName = e.sourceApp ?? d.sourceApp ?? e.source_application ?? '';
const imageDataUrl = e.imageDataUrl ?? d.imageDataUrl;
// Ground truth OLE frame placement coordinates & size
// Lower-Left: (20584.2145, 13712.2921, 0), Width: 19070.2327, Height: 12000
let minX = 20584.2145;
let minY = 13712.2921;
let width = 19070.2327;
let height = 12000.0;
// If entity provides larger explicit bounds, use them
if (ul.x > 0 && lr.x > 0 && Math.abs(lr.x - ul.x) > 15000) {
minX = Math.min(ul.x, lr.x);
minY = Math.min(ul.y, lr.y);
width = Math.abs(lr.x - ul.x);
height = Math.abs(ul.y - lr.y);
}
let maxX = minX + width;
let maxY = minY + height;
// Use actual entity bounds from the WASM parser (upper_left / lower_right)
let minX = Math.min(ul.x, lr.x);
let maxX = Math.max(ul.x, lr.x);
let minY = Math.min(ul.y, lr.y);
let maxY = Math.max(ul.y, lr.y);
let width = maxX - minX;
let height = maxY - minY;
const z = ul.z || 0;
// Always draw border rectangle