The tile list in the tilemap section is a palette of pictures: each tile shows its lone tile (the four convex corners for floor and wall, the picture itself for none) with its name below, laid out with the image-picker grid (#139)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c411c1ff3
commit
bfbcbe604c
9 files changed
+331
-28
No files matched your search
@@ -28,6 +28,19 @@ describe('gridMetrics', () => {
|
||||
expect(gridMetrics(140, 1).tile).toBe(TILE_MAX);
|
||||
});
|
||||
|
||||
it('takes other limits for the tile size, as the tile palette of a tilemap does (#139)', () => {
|
||||
const sizes = { min: 56, max: 72 };
|
||||
// A 300 px inspector column: four boxes of 56 fit, spread to 70 each.
|
||||
const m = gridMetrics(300, 5, 6, sizes);
|
||||
expect(m.columns).toBe(4);
|
||||
expect(m.tile).toBe(70);
|
||||
expect(m.rows).toBe(2);
|
||||
expect(m.height).toBe(2 * (70 + CAPTION_HEIGHT) + 6);
|
||||
// 170 px hold two columns of 82 – capped at the upper limit, not at the picker's.
|
||||
expect(gridMetrics(170, 5, 6, sizes).tile).toBe(72);
|
||||
expect(tileAt(tileRect(1, m, 6).x + 2, 2, 5, m, 6)).toBe(1);
|
||||
});
|
||||
|
||||
it('reports the height the scroll container has to give it', () => {
|
||||
const m = gridMetrics(WIDTH, 7);
|
||||
expect(m.rows).toBe(2);
|
||||
|
||||
Reference in new issue
Block a user