fix tilt settings

This commit is contained in:
Gavin McDonald
2025-07-08 16:04:30 -04:00
parent 6e312d5d2e
commit 9ca34540e8
4 changed files with 19 additions and 13 deletions

View File

@@ -1,4 +1,9 @@
import { Tilt } from '@/types';
export const validTilt = ({ percentX, percentY, rotateX, rotateY }: Tilt) =>
percentX >= 0 && percentY >= 0 && !!rotateX && !!rotateY;
export const validTilt = (tilt: Tilt) => {
if (!tilt) return false;
const { percentX, percentY, rotateX, rotateY } = tilt;
return percentX >= 0 && percentY >= 0 && !!rotateX && !!rotateY;
};