fix: handleComponentDrop에서 gridInfo 참조 제거 및 10px 스냅 적용

This commit is contained in:
kjs 2025-11-10 15:10:42 +09:00
parent 2a2bf86d12
commit 1d26b979ac
1 changed files with 4 additions and 13 deletions

View File

@ -2126,21 +2126,12 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
});
}
// 그리드 시스템이 활성화된 경우 gridColumns에 맞춰 너비 재계산
if (layout.gridSettings?.snapToGrid && gridInfo) {
// gridColumns에 맞는 정확한 너비 계산
const calculatedWidth = calculateWidthFromColumns(
gridColumns,
layout.gridSettings as GridUtilSettings,
);
// 컴포넌트별 최소 크기 보장
const minWidth = isTableList ? 120 : isCardDisplay ? 400 : component.defaultSize.width;
// 10px 단위로 너비 스냅
if (layout.gridSettings?.snapToGrid) {
componentSize = {
...component.defaultSize,
width: Math.max(calculatedWidth, minWidth),
width: snapTo10px(component.defaultSize.width),
height: snapTo10px(component.defaultSize.height),
};
}