Compare commits

..

No commits in common. "a01f9c2bd1d7404a14c2ab1ea9d5b682294ede37" and "7444e2799fbf19b41207d52b1da1db14d53a3682" have entirely different histories.

4 changed files with 5 additions and 39 deletions

View File

@ -214,7 +214,6 @@ export const SAVE_KEY = [
'isSortedPoints', 'isSortedPoints',
'isMultipleOf45', 'isMultipleOf45',
'from', 'from',
'originColor',
] ]
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype]

View File

@ -262,12 +262,6 @@ export const Orientation = forwardRef((props, ref) => {
setRoofsStore(newRoofs) setRoofsStore(newRoofs)
} }
useEffect(() => {
// selectedModules handleChangeModule
if (moduleList.length > 0 && (!selectedModules || !selectedModules.itemId)) {
handleChangeModule(moduleList[0]);
}
}, [moduleList]); //
return ( return (
<> <>
<div className="properties-setting-wrap"> <div className="properties-setting-wrap">

View File

@ -103,11 +103,11 @@ export default function CircuitTrestleSetting({ id }) {
}, []) }, [])
const capture = async (type) => { const capture = async (type) => {
beforeCapture(type) beforeCapture()
await handleCanvasToPng(type) await handleCanvasToPng(type)
afterCapture(type) afterCapture()
return new Promise((resolve) => { return new Promise((resolve) => {
setTimeout(() => { setTimeout(() => {
@ -117,23 +117,11 @@ export default function CircuitTrestleSetting({ id }) {
} }
// //
const beforeCapture = (type) => { const beforeCapture = () => {
setCanvasZoom(100) setCanvasZoom(100)
canvas.set({ zoom: 1 }) canvas.set({ zoom: 1 })
canvas.viewportTransform = [1, 0, 0, 1, 0, 0] canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
const circuitNumberTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
if (type === 2) {
modules.forEach((module) => {
module.set({ originColor: module.fill, fill: null, strokeWidth: 2 })
})
circuitNumberTexts.forEach((text) => {
text.set({ visible: false })
})
}
canvas.renderAll() canvas.renderAll()
// roof polygon // roof polygon
@ -181,27 +169,13 @@ export default function CircuitTrestleSetting({ id }) {
} }
// //
const afterCapture = (type) => { const afterCapture = () => {
setCanvasZoom(100) setCanvasZoom(100)
canvas.set({ zoom: 1 }) canvas.set({ zoom: 1 })
canvas.viewportTransform = [1, 0, 0, 1, 0, 0] canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
changeFontSize('lengthText', lengthText.fontSize.value) changeFontSize('lengthText', lengthText.fontSize.value)
changeFontSize('circuitNumber', circuitNumberText.fontSize.value) changeFontSize('circuitNumber', circuitNumberText.fontSize.value)
changeFontSize('flowText', flowText.fontSize.value) changeFontSize('flowText', flowText.fontSize.value)
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
const circuitNumberTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
if (type === 2) {
modules.forEach((module) => {
module.set({
fill: module.originColor,
strokeWidth: 0.3,
})
})
circuitNumberTexts.forEach((text) => {
text.set({ visible: true })
})
}
canvas.renderAll() canvas.renderAll()
} }

View File

@ -847,8 +847,7 @@ export const usePolygon = () => {
// innerLine의 type을 polygonLine의 type으로 변경 // innerLine의 type을 polygonLine의 type으로 변경
if (polygonLine.attributes?.type && innerLine.attributes) { if (polygonLine.attributes?.type && innerLine.attributes) {
// polygonLine.need = false // polygonLine.need = false
innerLine.attributes.planeSize = innerLine.attributes.planeSize ?? polygonLine.attributes.planeSize innerLine.attributes = { ...polygonLine.attributes }
innerLine.attributes.actualSize = innerLine.attributes.actualSize ?? polygonLine.attributes.actualSize
innerLine.direction = polygonLine.direction innerLine.direction = polygonLine.direction
innerLine.attributes.isStart = true innerLine.attributes.isStart = true
} }