From 112ebea1c1a71b5281aec8492c6ded3f0c22ff6b Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Fri, 27 Sep 2024 16:23:04 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=80=EB=B3=84=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Roof2.jsx | 11 +- src/hooks/useMode.js | 24 ++- src/util/qpolygon-utils.js | 406 ++++++++++++++++++------------------- 3 files changed, 222 insertions(+), 219 deletions(-) diff --git a/src/components/Roof2.jsx b/src/components/Roof2.jsx index 8e326c7f..3cfff65c 100644 --- a/src/components/Roof2.jsx +++ b/src/components/Roof2.jsx @@ -39,7 +39,7 @@ import QEmptyContextMenu from '@/components/common/context-menu/QEmptyContextMen import InitSettingsModal from './InitSettingsModal' import GridSettingsModal from './GridSettingsModal' import { SurfaceShapeModal } from '@/components/ui/SurfaceShape' -import { changeAllGableRoof, drawDirectionStringToArrow } from '@/util/qpolygon-utils' +import { changeAllHipAndGableRoof, drawDirectionStringToArrow } from '@/util/qpolygon-utils' import ThumbnailList from '@/components/ui/ThumbnailLIst' import ObjectPlacement from '@/components/ui/ObjectPlacement' import { globalLocaleStore } from '@/store/localeAtom' @@ -425,7 +425,7 @@ export default function Roof2(props) { { x: 450, y: 850 }, ] - const polygon = new QPolygon(type1C, { + const polygon = new QPolygon(twelvePoint, { fill: 'transparent', stroke: 'green', strokeWidth: 1, @@ -640,13 +640,14 @@ export default function Roof2(props) { drawDirectionStringToArrow(canvas, globalCampass) } - const setAllGableRoof = () => { + // 팔작지붕, 합각지붕 + const setAllHipAndGableRoof = () => { let offset = Number(prompt('gable roof offset', '50')) if (!isNaN(offset) && offset > 0) { const polygon = canvas?.getObjects() console.log('gable roof offset : ', offset) console.log('polygon : ', polygon) - changeAllGableRoof(polygon, offset, canvas) + changeAllHipAndGableRoof(polygon, offset, canvas) } else { alert('offset 은 0 보다 커야 함') } @@ -777,7 +778,7 @@ export default function Roof2(props) { )} -