fix(capture): align masked tape calibration with #99
This commit is contained in:
@@ -1117,3 +1117,18 @@ test('buildOverlayPlan: tapered tips (~20% max width) included; length span ≥
|
||||
const tipSpanSrc = tipHi - tipLo;
|
||||
assert.ok(tipSpanSrc <= woodSpan + 2, `tips must not overshoot wood (${tipSpanSrc} vs ${woodSpan})`);
|
||||
});
|
||||
|
||||
test('inventory source map rotates dimension graphics with the calibration slab', () => {
|
||||
const width = 6, height = 4;
|
||||
const bitset = new Uint8Array(width * height);
|
||||
for (let y = 1; y <= 2; y++) for (let x = 1; x <= 4; x++) bitset[y * width + x] = 1;
|
||||
const map = inventorySourceMap(
|
||||
{ x: 1, y: 1, w: 4, h: 2 },
|
||||
{ widthPx: width, heightPx: height },
|
||||
2, 3, 1, bitset, 90,
|
||||
).mapToInventory;
|
||||
const a = map(1, 1.5);
|
||||
const b = map(4, 1.5);
|
||||
assert.ok(Math.abs(b[0] - a[0]) < 1e-8, 'horizontal source axis maps vertical after clockwise rotation');
|
||||
assert.ok(b[1] > a[1]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user