PromucFlow_constructor/app/client/src/utils/helpers.tsx

11 lines
233 B
TypeScript
Raw Normal View History

export const snapToGrid = (
columnWidth: number,
rowHeight: number,
x: number,
y: number,
) => {
const snappedX = Math.floor(x / columnWidth);
const snappedY = Math.floor(y / rowHeight);
return [snappedX, snappedY];
};