fix(parser): dynamically extract OLE2FRAME 4-corner coordinates from binary OLE stream header; remove hardcoded coordinates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user