diff --git a/apps/signage/src/app/template-layout.ts b/apps/signage/src/app/template-layout.ts index 58f04aeba66..6bf91ae81b4 100644 --- a/apps/signage/src/app/template-layout.ts +++ b/apps/signage/src/app/template-layout.ts @@ -19,7 +19,12 @@ export interface ComputedTemplateLayout { const EDGE_BAR_SIZE = 15; const SIDE_BAR_SIZE = 20; -const FLOATING_POSITION = 50; +/** + * Top-left corner of a floating item with no position, so it fills the frame. + * Keep in step with the manager preview + * (`apps/signage-manager/src/app/templates/template-layout.util.ts`). + */ +const FLOATING_POSITION = 0; const clamp = (value: number, max = 100) => Math.min(Math.max(value, 0), Math.max(max, 0)); diff --git a/apps/signage/src/tests/template-layout.spec.ts b/apps/signage/src/tests/template-layout.spec.ts index 2615acedc8f..27b9f6375c3 100644 --- a/apps/signage/src/tests/template-layout.spec.ts +++ b/apps/signage/src/tests/template-layout.spec.ts @@ -47,14 +47,14 @@ describe('computeTemplateLayout', () => { }); }); - it('places a floating item without a position at the centre', () => { + it('fills the frame with a floating item that has no position', () => { const result = computeTemplateLayout([layout('floating')]); expect(result.items[0].rect).toEqual({ - left: 50, - top: 50, - width: 50, - height: 50, + left: 0, + top: 0, + width: 100, + height: 100, }); });