From 1647bc58a08f42efc734b59507a54d83d041f78f Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 3 Sep 2024 15:07:11 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=B4=ED=98=95=EC=83=81=20=3D>=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=ED=9A=8C=EB=A1=9C=EA=B5=AC=EC=84=B1=20=3D>=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=B1=84=EC=9A=B0=EA=B8=B0=20=EC=9E=91?= =?UTF-8?q?=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 | 48 +++---------- src/components/ui/SurfaceShape.jsx | 105 +++++++++++++++++++---------- 2 files changed, 79 insertions(+), 74 deletions(-) diff --git a/src/components/Roof2.jsx b/src/components/Roof2.jsx index ff570d90..00661aca 100644 --- a/src/components/Roof2.jsx +++ b/src/components/Roof2.jsx @@ -535,44 +535,6 @@ export default function Roof2(props) { }) } - const setCurrentPattern = (polygon) => { - const { width, height, roofStyle } = roofMaterial - const roofRatio = window.devicePixelRatio || 1 - const patternSourceCanvas = document.createElement('canvas') - - if (roofStyle === 1) { - patternSourceCanvas.width = width * roofRatio - patternSourceCanvas.height = height * roofRatio - } else if (roofStyle === 2) { - patternSourceCanvas.width = width * 2 - patternSourceCanvas.height = height * 2 - } - - const ctx = patternSourceCanvas.getContext('2d') - - ctx.scale(roofRatio, roofRatio) - ctx.strokeStyle = 'green' - ctx.lineWidth = 0.4 - // 벽돌 패턴 그리기 - if (roofStyle === 1) { - ctx.strokeRect(0, 0, 50, 30) - } else if (roofStyle === 2) { - // 지그재그 - ctx.strokeRect(0, 0, 200, 100) - ctx.strokeRect(100, 100, 200, 100) - } - - // 패턴 생성 - const pattern = new fabric.Pattern({ - source: patternSourceCanvas, - repeat: 'repeat', - }) - polygon.set('fill', null) - - polygon.set('fill', pattern) - canvas?.renderAll() - } - /** * canvas 내용 불러오기 */ @@ -1531,6 +1493,9 @@ export default function Roof2(props) { }) } + const moduleConfiguration = () => { + createRoofRack() + } return ( <> {canvas && ( @@ -1764,8 +1729,11 @@ export default function Roof2(props) { - +