( gridUnits: number, colOrRowSize: number, marginPx: number )
| 52 | * @returns Size in pixels |
| 53 | */ |
| 54 | export function calcGridItemWHPx( |
| 55 | gridUnits: number, |
| 56 | colOrRowSize: number, |
| 57 | marginPx: number |
| 58 | ): number { |
| 59 | // 0 * Infinity === NaN, which causes problems with resize constraints |
| 60 | if (!Number.isFinite(gridUnits)) return gridUnits; |
| 61 | return Math.round( |
| 62 | colOrRowSize * gridUnits + Math.max(0, gridUnits - 1) * marginPx |
| 63 | ); |
| 64 | } |
| 65 | |
| 66 | // ============================================================================ |
| 67 | // Position Calculations |
no outgoing calls
no test coverage detected
searching dependent graphs…