diff --git a/src/components/common/color-picker/ColorPickerModal.jsx b/src/components/common/color-picker/ColorPickerModal.jsx
index 729402a7..94f24f42 100644
--- a/src/components/common/color-picker/ColorPickerModal.jsx
+++ b/src/components/common/color-picker/ColorPickerModal.jsx
@@ -54,7 +54,6 @@ export default function ColorPickerModal(props) {
-
COLOR PICKER
diff --git a/src/components/floor-plan/CanvasLayout.jsx b/src/components/floor-plan/CanvasLayout.jsx
index 22215fd2..43e4388a 100644
--- a/src/components/floor-plan/CanvasLayout.jsx
+++ b/src/components/floor-plan/CanvasLayout.jsx
@@ -39,7 +39,7 @@ export default function CanvasLayout({ children }) {
onClick={() => handleCurrentPlan(plan.id)}
>
{`Plan ${plan.planNo}`}
- {index !== 0 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
+ {plans.length > 1 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
{
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index 4ce1ec27..66d13c88 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -183,8 +183,10 @@ export default function CanvasMenu(props) {
await reloadCanvasStatus(objectNo, pid)
break
case 'surface':
- const modules = canvas.getObjects().filter((module) => module.name === POLYGON_TYPE.MODULE)
- initRoofs()
+ const modules = canvas
+ .getObjects()
+ .filter((obj) => [POLYGON_TYPE.MODULE_SETUP_SURFACE, POLYGON_TYPE.MODULE, POLYGON_TYPE.OBJECT_SURFACE].includes(obj.name))
+
if (modules.length > 0) {
swalFire({
text: getMessage('module.delete.confirm'),
@@ -194,10 +196,7 @@ export default function CanvasMenu(props) {
const moduleSurfacesArray = canvas
.getObjects()
- .filter(
- (obj) =>
- obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE || obj.name === POLYGON_TYPE.MODULE || obj.name === POLYGON_TYPE.OBJECT_SURFACE,
- )
+ .filter((obj) => [POLYGON_TYPE.MODULE_SETUP_SURFACE, POLYGON_TYPE.MODULE, POLYGON_TYPE.OBJECT_SURFACE].includes(obj.name))
if (moduleSurfacesArray.length > 0) {
// 모듈면 있을 경우 지붕면 할당 다시해야함
diff --git a/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx b/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx
index e08bc839..e4807c36 100644
--- a/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx
+++ b/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx
@@ -9,7 +9,7 @@ import { canvasState, pitchTextSelector } from '@/store/canvasAtom'
import { defaultSlope } from '@/store/commonAtom'
import { re } from 'mathjs'
import { basicSettingState } from '@/store/settingAtom'
-import { getChonByDegree } from '@/util/canvas-util'
+import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util'
export default function DimensionLineSetting(props) {
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
@@ -106,14 +106,14 @@ export default function DimensionLineSetting(props) {
}
const calculateLength = (originalLength, angle, angle1) => {
- const slope1 = basicSetting.roofAngleSet !== 'slope' ? getChonByDegree(angle) : angle
- const slope2 = basicSetting.roofAngleSet !== 'slope' ? getChonByDegree(angle1 ?? 0) : angle1
if (!angle1) {
- const angleInRadians = slope1 * (Math.PI / 180)
- const result = Math.sqrt(Math.pow(originalLength * Math.tan(angleInRadians), 2) + Math.pow(originalLength, 2))
- console.log(angleInRadians, result)
+ const slope1 = basicSetting.roofAngleSet !== 'slope' ? getDegreeByChon(angle) : angle
+ const result = Math.sqrt(Math.pow(originalLength * Math.tan((getDegreeByChon(slope1) * Math.PI) / 180), 2) + Math.pow(originalLength, 2))
+ console.log(result)
return result
} else {
+ const slope1 = basicSetting.roofAngleSet !== 'slope' ? getChonByDegree(angle) : angle
+ const slope2 = basicSetting.roofAngleSet !== 'slope' ? getChonByDegree(angle1 ?? 0) : angle1
const numerator = Math.sqrt(Math.pow(slope1, 2) + 100 + Math.pow((10 * slope1) / slope2, 2)) * originalLength
const denominator = Math.sqrt(Math.pow((10 * slope1) / slope2, 2) + 100)
const result = numerator / denominator
diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
index eb76dcb8..37fc53bc 100644
--- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
@@ -205,7 +205,7 @@ export default function ContextRoofAllocationSetting(props) {
)}
-
{getMessage('slope')}
+
{getMessage('modal.object.setting.offset.slope')}
{pitchText}
-
-
-
-
-
-
)
diff --git a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
index 965f1ec9..7723b9de 100644
--- a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
@@ -202,7 +202,7 @@ export default function RoofAllocationSetting(props) {
)}
-
{getMessage('slope')}
+
{getMessage('modal.object.setting.offset.slope')}
{pitchText}
-
*/}
)
diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js
index c6ca9ba3..e4e783e9 100644
--- a/src/hooks/module/useModule.js
+++ b/src/hooks/module/useModule.js
@@ -362,7 +362,7 @@ export function useModule() {
}
modules.forEach((module) => {
- const { top, left } = getPosotion(module, direction, Number(length) + Number(moduleLength), false)
+ const { top, left } = getPosotion(module, direction, Number(length) + Number(moduleLength), true)
module.clone((obj) => {
obj.set({
parentId: module.parentId,
@@ -689,7 +689,7 @@ export function useModule() {
targetModules.forEach((module) => {
if (width === -1)
width = type === MODULE_INSERT_TYPE.LEFT ? Number(activeModule.left) - Number(module.left) : Number(module.left) - Number(activeModule.left)
- const { top, left } = getPosotion(module, type, module.width, false)
+ const { top, left } = getPosotion(module, type, module.width, true)
module.originPos = {
left: module.left,
top: module.top,
@@ -706,7 +706,7 @@ export function useModule() {
canvas.renderAll()
otherModules = getOtherModules(columnModules)
columnModules.forEach((module) => {
- const { top, left } = getPosotion(module, type, module.width, false)
+ const { top, left } = getPosotion(module, type, module.width, true)
let copyModule = null
module.clone((obj) => {
obj.set({
@@ -807,7 +807,7 @@ export function useModule() {
targetModules.forEach((module) => {
if (height === -1)
height = type === MODULE_INSERT_TYPE.TOP ? Number(activeModule.top) - Number(module.top) : Number(module.top) - Number(activeModule.top)
- const { top, left } = getPosotion(module, type, activeModule.height, false)
+ const { top, left } = getPosotion(module, type, activeModule.height, true)
module.originPos = {
left: module.left,
top: module.top,
@@ -823,7 +823,7 @@ export function useModule() {
canvas.renderAll()
otherModules = getOtherModules(rowModules)
rowModules.forEach((module) => {
- const { top, left } = getPosotion(module, type, activeModule.height, false)
+ const { top, left } = getPosotion(module, type, activeModule.height, true)
let copyModule = null
module.clone((obj) => {
obj.set({
diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js
index 97e9cf6c..144272f8 100644
--- a/src/hooks/useContextMenu.js
+++ b/src/hooks/useContextMenu.js
@@ -76,50 +76,7 @@ export function useContextMenu() {
const currentMenuSetting = () => {
switch (selectedMenu) {
- case 'placement':
- setContextMenu([
- [
- {
- id: 'gridMove',
- name: getMessage('modal.grid.move'),
- component: ,
- },
- {
- id: 'gridCopy',
- name: getMessage('modal.grid.copy'),
- component: ,
- },
- {
- id: 'gridColorEdit',
- name: getMessage('modal.grid.color.edit'),
- component: (
-
- ),
- },
- {
- id: 'remove',
- name: getMessage('delete'),
- },
- {
- id: 'removeAll',
- name: getMessage('delete.all'),
- fn: () => {
- removeGrid()
- removeAdsorptionPoint()
- },
- },
- ],
- ])
- break
case 'outline':
- if (['roof', 'auxiliaryLine'].includes(currentObject?.name)) {
- }
break
default:
setContextMenu([])