mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-12-04 03:07:08 +03:00
compact converted 0.18 grid layouts in render order
0.18 stored every new grid tile at y 0 and left gaps behind removed cameras, relying on the grid's vertical compaction at render to stack tiles in render order (Birdseye, then camera order). The current grid renders without compaction and conversion only rescaled the coordinates, so upgraded groups with more than three tiles showed tiles on top of each other, often covering Birdseye, and gaps that 0.18 never displayed. Conversion now sorts tiles by render order and compacts them once, so each layout opens as 0.18 showed it.
This commit is contained in:
@@ -89,8 +89,8 @@ test.describe("Live grid aspect modes @critical", () => {
|
||||
});
|
||||
|
||||
// 0.17/0.18 shape: bare array on a 12-column grid, 4x4 standard tiles.
|
||||
// backyard was manually resized to 8x8 and sits beside front_door's column,
|
||||
// front_door is a standard tile on the row below.
|
||||
// backyard was manually resized to 8x8 and sits beside front_door's column.
|
||||
// front_door is stored on the row below, but 0.18 compacted it to the top.
|
||||
const key = await persistedLayoutKey(frigateApp.page, GROUP);
|
||||
await seedLayout(frigateApp.page, key, [
|
||||
{ i: "backyard", x: 4, y: 0, w: 8, h: 8, moved: false, static: false },
|
||||
@@ -127,21 +127,21 @@ test.describe("Live grid aspect modes @critical", () => {
|
||||
stored.layout.find((i: LayoutItem) => i.i === "front_door"),
|
||||
).toMatchObject({
|
||||
x: 0,
|
||||
y: 144,
|
||||
y: 0,
|
||||
w: 32,
|
||||
h: 72,
|
||||
});
|
||||
|
||||
// arrangement on screen: backyard indented, front_door below it
|
||||
// arrangement on screen: front_door top-left, backyard beside it
|
||||
const { backyard, front_door: frontDoor } = await cameraBoxes(
|
||||
frigateApp.page,
|
||||
["backyard", "front_door"] as const,
|
||||
);
|
||||
expect(backyard.x).toBeGreaterThan(frontDoor.x + frontDoor.w / 2);
|
||||
expect(frontDoor.y).toBeGreaterThan(backyard.y + backyard.h / 2);
|
||||
expect(Math.abs(frontDoor.y - backyard.y)).toBeLessThan(2);
|
||||
});
|
||||
|
||||
test("conversion is a pure scale, so odd sizes and positions survive", async ({
|
||||
test("conversion scales odd sizes and keeps tiles adjacent", async ({
|
||||
frigateApp,
|
||||
}) => {
|
||||
await frigateApp.goto(`/?group=${GROUP}`);
|
||||
@@ -175,8 +175,9 @@ test.describe("Live grid aspect modes @critical", () => {
|
||||
)!;
|
||||
const backyard = stored.layout.find((i: LayoutItem) => i.i === "backyard")!;
|
||||
|
||||
expect(frontDoor).toMatchObject({ x: 0, y: 54, w: 40, h: 90 });
|
||||
expect(backyard).toMatchObject({ x: 40, y: 54, w: 56, h: 90 });
|
||||
// the empty rows above both tiles compact away, as they did in 0.18
|
||||
expect(frontDoor).toMatchObject({ x: 0, y: 0, w: 40, h: 90 });
|
||||
expect(backyard).toMatchObject({ x: 40, y: 0, w: 56, h: 90 });
|
||||
|
||||
// still adjacent, still inside the grid, still not overlapping
|
||||
expect(frontDoor.x + frontDoor.w).toBe(backyard.x);
|
||||
|
||||
Reference in New Issue
Block a user