Merge branch 'feature/jaeyoung' of https://git.hanasys.jp/qcast3/qcast-front into feature/jaeyoung

This commit is contained in:
hyojun.choi 2025-04-28 18:08:07 +09:00
commit 69763dd413
3 changed files with 1731 additions and 71 deletions

View File

@ -2,7 +2,7 @@ import { fabric } from 'fabric'
import { v4 as uuidv4 } from 'uuid'
import { QLine } from '@/components/fabric/QLine'
import { distanceBetweenPoints, findTopTwoIndexesByDistance, getDirectionByPoint, sortedPointLessEightPoint, sortedPoints } from '@/util/canvas-util'
import { calculateAngle, drawGabledRoof, drawRidgeRoof, drawShedRoof, toGeoJSON } from '@/util/qpolygon-utils'
import { calculateAngle, drawRidgeRoof, drawShedRoof, toGeoJSON } from '@/util/qpolygon-utils'
import * as turf from '@turf/turf'
import { LINE_TYPE, POLYGON_TYPE } from '@/common/common'
import Big from 'big.js'
@ -247,12 +247,13 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
const hasShed = types.includes(LINE_TYPE.WALLLINE.SHED)
// A형, B형 박공 지붕
if (
/* if (
(gableOdd.every((type) => type === LINE_TYPE.WALLLINE.EAVES) && gableEven.every((type) => gableType.includes(type))) ||
(gableEven.every((type) => type === LINE_TYPE.WALLLINE.EAVES) && gableOdd.every((type) => gableType.includes(type)))
) {
drawGabledRoof(this.id, this.canvas, textMode)
} else if (hasShed) {
} else*/
if (hasShed) {
const sheds = this.lines.filter((line) => line.attributes !== undefined && line.attributes.type === LINE_TYPE.WALLLINE.SHED)
const areLinesParallel = function (line1, line2) {
const angle1 = calculateAngle(line1.startPoint, line1.endPoint)

View File

@ -299,6 +299,17 @@ export function useMovementSetting(id) {
}
const handleSave = () => {
if (CONFIRM_LINE_REF.current !== null) {
canvas.remove(CONFIRM_LINE_REF.current)
CONFIRM_LINE_REF.current = null
canvas.renderAll()
}
if (FOLLOW_LINE_REF.current !== null) {
canvas.remove(FOLLOW_LINE_REF.current)
FOLLOW_LINE_REF.current = null
canvas.renderAll()
}
const target = selectedObject.current !== null ? selectedObject.current : CONFIRM_LINE_REF.current?.target
if (!target) return
@ -429,17 +440,6 @@ export function useMovementSetting(id) {
canvas.renderAll()
})
if (CONFIRM_LINE_REF.current !== null) {
canvas.remove(CONFIRM_LINE_REF.current)
CONFIRM_LINE_REF.current = null
canvas.renderAll()
}
if (FOLLOW_LINE_REF.current !== null) {
canvas.remove(FOLLOW_LINE_REF.current)
FOLLOW_LINE_REF.current = null
canvas.renderAll()
}
roof.drawHelpLine()
initEvent()
closePopup(id)

File diff suppressed because it is too large Load Diff