forked from Blendman974/faceclaw
Tweak padding/spacing in various apps
This commit is contained in:
1 parent
756e21feb8
commit
eff32d4a5a
5 files changed
+128
-30
No files matched your search
@@ -122,6 +122,20 @@ function shown(image, at) {
|
||||
return withClock(at, () => Array.from(image.withDrawsBaked().pixels, (v) => Math.min(15, (v + 8) >> 4)));
|
||||
}
|
||||
|
||||
test('a box topped at the band inset less the highlight inset pads the first row band evenly', () => {
|
||||
// The launcher's root grid (launcher-app.ts ROOT_GRID_TOP) relies on this.
|
||||
const { grid } = makeGrid();
|
||||
const { ICON_GRID_BAND_INSET_X: insetX, ICON_GRID_HIGHLIGHT_INSET_Y: insetY } = loadIconGrid();
|
||||
const image = paint(grid, 1000, { x: 0, y: insetX - insetY, width: 500, height: 190 });
|
||||
const stroke = build('ui/menu-core').MENU_HIGHLIGHT_STROKE;
|
||||
let left = 500, right = -1, top = 200;
|
||||
image.pixels.forEach((v, i) => {
|
||||
if (v !== stroke) return;
|
||||
left = Math.min(left, i % 500); right = Math.max(right, i % 500); top = Math.min(top, (i / 500) | 0);
|
||||
});
|
||||
assert.deepEqual([top, left, 500 - 1 - right], [insetX, insetX, insetX]);
|
||||
});
|
||||
|
||||
test('rows keep their content height instead of stretching, and the next row peeks clipped', () => {
|
||||
assert.equal(metrics.iconGridMinRowHeight({ lineHeight: LINE_HEIGHT }, 44, 2), ROW_H);
|
||||
const { grid } = makeGrid({ items: Array.from({ length: 15 }, (_, i) => `item${i}`) });
|
||||
|
||||
Reference in new issue
Block a user