mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 23:35:18 -05:00
fix: incorrect header height calculation in estimated month height (#23923)
This commit is contained in:
parent
fbaeffd65c
commit
237ddcb648
@ -12,7 +12,7 @@ export function updateGeometry(timelineManager: TimelineManager, month: MonthGro
|
|||||||
if (!month.isHeightActual) {
|
if (!month.isHeightActual) {
|
||||||
const unwrappedWidth = (3 / 2) * month.assetsCount * timelineManager.rowHeight * (7 / 10);
|
const unwrappedWidth = (3 / 2) * month.assetsCount * timelineManager.rowHeight * (7 / 10);
|
||||||
const rows = Math.ceil(unwrappedWidth / viewportWidth);
|
const rows = Math.ceil(unwrappedWidth / viewportWidth);
|
||||||
const height = 51 + Math.max(1, rows) * timelineManager.rowHeight;
|
const height = timelineManager.headerHeight + Math.max(1, rows) * timelineManager.rowHeight;
|
||||||
month.height = height;
|
month.height = height;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -84,13 +84,13 @@ describe('TimelineManager', () => {
|
|||||||
expect.arrayContaining([
|
expect.arrayContaining([
|
||||||
expect.objectContaining({ year: 2024, month: 3, height: 283 }),
|
expect.objectContaining({ year: 2024, month: 3, height: 283 }),
|
||||||
expect.objectContaining({ year: 2024, month: 2, height: 7711 }),
|
expect.objectContaining({ year: 2024, month: 2, height: 7711 }),
|
||||||
expect.objectContaining({ year: 2024, month: 1, height: 286 }),
|
expect.objectContaining({ year: 2024, month: 1, height: 283 }),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('calculates timeline height', () => {
|
it('calculates timeline height', () => {
|
||||||
expect(timelineManager.totalViewerHeight).toBe(8340);
|
expect(timelineManager.totalViewerHeight).toBe(8337);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user