@@ -244,13 +244,13 @@ function pointFromPercent(
244244 const x = Math . trunc ( ( frame . referenceWidth * xPercent ) / 100 ) ;
245245 const y = Math . trunc ( ( frame . referenceHeight * yPercent ) / 100 ) ;
246246 return {
247- x,
248- y,
247+ x : Number . isFinite ( x ) ? x : 0 ,
248+ y : Number . isFinite ( y ) ? y : 0 ,
249249 } ;
250250}
251251
252252function clampGesturePoint (
253- point : { x : number | undefined ; y : number | undefined } ,
253+ point : GesturePoint ,
254254 frame : GestureReferenceFrame ,
255255 marginPx : number ,
256256) : GesturePoint {
@@ -308,16 +308,12 @@ function normalizeRequestedPixels(pixels: number): number {
308308 return Math . max ( 1 , Math . round ( pixels ) ) ;
309309}
310310
311- export function clampGestureCoordinate (
312- value : number | undefined ,
313- marginPx : number ,
314- size : number ,
315- ) : number {
311+ export function clampGestureCoordinate ( value : number , marginPx : number , size : number ) : number {
316312 const min = Math . round ( marginPx ) ;
317313 if ( ! Number . isFinite ( min ) ) return 0 ;
318314
319315 const max = Math . max ( min , Math . round ( size - marginPx ) ) ;
320- if ( ! Number . isFinite ( max ) || value === undefined || ! Number . isFinite ( value ) ) return min ;
316+ if ( ! Number . isFinite ( max ) || ! Number . isFinite ( value ) ) return min ;
321317
322318 return Math . min ( max , Math . max ( min , Math . round ( value ) ) ) ;
323319}
0 commit comments