@@ -279,64 +279,64 @@ export const rotateY = (value: number, p?: Point) => {
279
279
export const processTransform3d = ( transforms : Transforms3d ) => {
280
280
"worklet" ;
281
281
return transforms . reduce ( ( acc , val ) => {
282
- const key = Object . keys ( val ) [ 0 ] as Transform3dName ;
283
- const transform = val as Pick < Transformations , typeof key > ;
284
- if ( key === "translateX" ) {
285
- const value = transform [ key ] ;
286
- return multiply4 ( acc , translate ( value , 0 , 0 ) ) ;
287
- }
288
- if ( key === "translate" ) {
289
- const [ x , y , z = 0 ] = transform [ key ] ;
290
- return multiply4 ( acc , translate ( x , y , z ) ) ;
291
- }
292
- if ( key === "translateY" ) {
293
- const value = transform [ key ] ;
294
- return multiply4 ( acc , translate ( 0 , value , 0 ) ) ;
295
- }
296
- if ( key === "translateZ" ) {
297
- const value = transform [ key ] ;
298
- return multiply4 ( acc , translate ( 0 , 0 , value ) ) ;
299
- }
300
- if ( key === "scale" ) {
301
- const value = transform [ key ] ;
302
- return multiply4 ( acc , scale ( value , value , 1 ) ) ;
303
- }
304
- if ( key === "scaleX" ) {
305
- const value = transform [ key ] ;
306
- return multiply4 ( acc , scale ( value , 1 , 1 ) ) ;
307
- }
308
- if ( key === "scaleY" ) {
309
- const value = transform [ key ] ;
310
- return multiply4 ( acc , scale ( 1 , value , 1 ) ) ;
311
- }
312
- if ( key === "skewX" ) {
313
- const value = transform [ key ] ;
314
- return multiply4 ( acc , skewX ( value ) ) ;
315
- }
316
- if ( key === "skewY" ) {
317
- const value = transform [ key ] ;
318
- return multiply4 ( acc , skewY ( value ) ) ;
319
- }
320
- if ( key === "rotateX" ) {
321
- const value = transform [ key ] ;
322
- return multiply4 ( acc , rotate ( [ 1 , 0 , 0 ] , value ) ) ;
323
- }
324
- if ( key === "rotateY" ) {
325
- const value = transform [ key ] ;
326
- return multiply4 ( acc , rotate ( [ 0 , 1 , 0 ] , value ) ) ;
327
- }
328
- if ( key === "perspective" ) {
329
- const value = transform [ key ] ;
330
- return multiply4 ( acc , perspective ( value ) ) ;
331
- }
332
- if ( key === "rotate" || key === "rotateZ" ) {
333
- const value = transform [ key ] ;
334
- return multiply4 ( acc , rotate ( [ 0 , 0 , 1 ] , value ) ) ;
335
- }
336
- if ( key === "matrix" ) {
337
- const value = transform [ key ] ;
338
- return multiply4 ( acc , value ) ;
339
- }
340
- return exhaustiveCheck ( key ) ;
341
- } , Matrix4 ( ) ) ;
282
+ const key = Object . keys ( val ) [ 0 ] as Transform3dName ;
283
+ const transform = val as Pick < Transformations , typeof key > ;
284
+ if ( key === "translateX" ) {
285
+ const value = transform [ key ] ;
286
+ return multiply4 ( acc , translate ( value , 0 , 0 ) ) ;
287
+ }
288
+ if ( key === "translate" ) {
289
+ const [ x , y , z = 0 ] = transform [ key ] ;
290
+ return multiply4 ( acc , translate ( x , y , z ) ) ;
291
+ }
292
+ if ( key === "translateY" ) {
293
+ const value = transform [ key ] ;
294
+ return multiply4 ( acc , translate ( 0 , value , 0 ) ) ;
295
+ }
296
+ if ( key === "translateZ" ) {
297
+ const value = transform [ key ] ;
298
+ return multiply4 ( acc , translate ( 0 , 0 , value ) ) ;
299
+ }
300
+ if ( key === "scale" ) {
301
+ const value = transform [ key ] ;
302
+ return multiply4 ( acc , scale ( value , value , 1 ) ) ;
303
+ }
304
+ if ( key === "scaleX" ) {
305
+ const value = transform [ key ] ;
306
+ return multiply4 ( acc , scale ( value , 1 , 1 ) ) ;
307
+ }
308
+ if ( key === "scaleY" ) {
309
+ const value = transform [ key ] ;
310
+ return multiply4 ( acc , scale ( 1 , value , 1 ) ) ;
311
+ }
312
+ if ( key === "skewX" ) {
313
+ const value = transform [ key ] ;
314
+ return multiply4 ( acc , skewX ( value ) ) ;
315
+ }
316
+ if ( key === "skewY" ) {
317
+ const value = transform [ key ] ;
318
+ return multiply4 ( acc , skewY ( value ) ) ;
319
+ }
320
+ if ( key === "rotateX" ) {
321
+ const value = transform [ key ] ;
322
+ return multiply4 ( acc , rotate ( [ 1 , 0 , 0 ] , value ) ) ;
323
+ }
324
+ if ( key === "rotateY" ) {
325
+ const value = transform [ key ] ;
326
+ return multiply4 ( acc , rotate ( [ 0 , 1 , 0 ] , value ) ) ;
327
+ }
328
+ if ( key === "perspective" ) {
329
+ const value = transform [ key ] ;
330
+ return multiply4 ( acc , perspective ( value ) ) ;
331
+ }
332
+ if ( key === "rotate" || key === "rotateZ" ) {
333
+ const value = transform [ key ] ;
334
+ return multiply4 ( acc , rotate ( [ 0 , 0 , 1 ] , value ) ) ;
335
+ }
336
+ if ( key === "matrix" ) {
337
+ const value = transform [ key ] ;
338
+ return multiply4 ( acc , value ) ;
339
+ }
340
+ return exhaustiveCheck ( key ) ;
341
+ } , Matrix4 ( ) ) ;
342
342
} ;
0 commit comments