test(web): cover timeline drag math guards

This commit is contained in:
2026-04-01 09:23:45 +02:00
parent 403d59ad73
commit f70ce9480d
2 changed files with 46 additions and 0 deletions
@@ -6,6 +6,9 @@
/** Convert a pixel delta to a number of whole days based on cell width. */
export function pixelsToDays(deltaX: number, cellWidth: number): number {
if (!Number.isFinite(cellWidth) || cellWidth <= 0) {
return 0;
}
return Math.round(deltaX / cellWidth);
}