Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/signage/src/app/template-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
10 changes: 5 additions & 5 deletions apps/signage/src/tests/template-layout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});

Expand Down
Loading