test(web): cover timeline drag math guards
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user