From 554cdbdea55ced129bd67581cf9fb3c7eb07f838 Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 10 Nov 2025 14:43:09 +0900 Subject: [PATCH] =?UTF-8?q?wip:=20=EA=B2=A9=EC=9E=90=20=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EC=A0=9C=EA=B1=B0=20=EC=8B=9C=EC=9E=91=20-=2010px?= =?UTF-8?q?=20=EC=8A=A4=EB=83=85=20=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/screen/ScreenDesigner.tsx | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/frontend/components/screen/ScreenDesigner.tsx b/frontend/components/screen/ScreenDesigner.tsx index 4d644524..bb62f17e 100644 --- a/frontend/components/screen/ScreenDesigner.tsx +++ b/frontend/components/screen/ScreenDesigner.tsx @@ -24,19 +24,26 @@ import { calculateRelativePositions, restoreAbsolutePositions, } from "@/lib/utils/groupingUtils"; -import { - calculateGridInfo, - snapToGrid, - snapSizeToGrid, - generateGridLines, - updateSizeFromGridColumns, - adjustGridColumnsFromSize, - alignGroupChildrenToGrid, - calculateOptimalGroupSize, - normalizeGroupChildPositions, - calculateWidthFromColumns, - GridSettings as GridUtilSettings, -} from "@/lib/utils/gridUtils"; + +// 10px 단위 스냅 함수 +const snapTo10px = (value: number): number => { + return Math.round(value / 10) * 10; +}; + +const snapPositionTo10px = (position: Position): Position => { + return { + x: snapTo10px(position.x), + y: snapTo10px(position.y), + z: position.z, + }; +}; + +const snapSizeTo10px = (size: { width: number; height: number }): { width: number; height: number } => { + return { + width: snapTo10px(size.width), + height: snapTo10px(size.height), + }; +}; import { GroupingToolbar } from "./GroupingToolbar"; import { screenApi, tableTypeApi } from "@/lib/api/screen"; import { tableManagementApi } from "@/lib/api/tableManagement"; @@ -57,7 +64,6 @@ import { TemplatesPanel, TemplateComponent } from "./panels/TemplatesPanel"; import { ComponentsPanel } from "./panels/ComponentsPanel"; import PropertiesPanel from "./panels/PropertiesPanel"; import DetailSettingsPanel from "./panels/DetailSettingsPanel"; -import GridPanel from "./panels/GridPanel"; import ResolutionPanel from "./panels/ResolutionPanel"; import { usePanelState, PanelConfig } from "@/hooks/usePanelState"; import { FlowButtonGroup } from "./widgets/FlowButtonGroup";