Merge branch 'dev' into dev-yj
This commit is contained in:
commit
bd3424ada0
@ -185,6 +185,7 @@ export const SAVE_KEY = [
|
||||
'moduleInfo',
|
||||
'circuitNumber',
|
||||
'circuit',
|
||||
'onlyOffset',
|
||||
]
|
||||
|
||||
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype]
|
||||
|
||||
@ -31,7 +31,11 @@ export function useCanvasConfigInitialize() {
|
||||
const flowTexts = canvas.getObjects().filter((obj) => obj.name === 'flowText')
|
||||
if (basicSetting.roofAngleSet === 'slope') {
|
||||
offsetTexts.forEach((obj) => {
|
||||
obj.set({ text: `${!obj.originText ? '' : obj.originText + '-'}∠${obj.pitch}${angleUnit}` })
|
||||
let text = `${!obj.originText ? '' : obj.originText}`
|
||||
if (!obj.onlyOffset) {
|
||||
text = text + `-∠${obj.pitch}${angleUnit}`
|
||||
}
|
||||
obj.set({ text: text })
|
||||
})
|
||||
flowTexts.forEach((obj) => {
|
||||
obj.set({ text: `${!obj.originText ? '' : obj.originText + '-'}∠${obj.pitch}${pitchText}` })
|
||||
@ -40,7 +44,11 @@ export function useCanvasConfigInitialize() {
|
||||
|
||||
if (basicSetting.roofAngleSet === 'flat') {
|
||||
offsetTexts.forEach((obj) => {
|
||||
obj.set({ text: `${!obj.originText ? '' : obj.originText + '-'}∠${getDegreeByChon(obj.pitch)}${angleUnit}` })
|
||||
let text = `${!obj.originText ? '' : obj.originText}`
|
||||
if (!obj.onlyOffset) {
|
||||
text = text + `-∠${getDegreeByChon(obj.pitch)}${angleUnit}`
|
||||
}
|
||||
obj.set({ text: text })
|
||||
})
|
||||
flowTexts.forEach((obj) => {
|
||||
obj.set({ text: `${!obj.originText ? '' : obj.originText + '-'}∠${getDegreeByChon(obj.pitch)}${pitchText}` })
|
||||
|
||||
@ -197,10 +197,10 @@ export function useRoofShapeSetting(id) {
|
||||
// 변별로 설정중 한쪽흐름일 경우 한쪽흐름의 pitch로 설정
|
||||
if (pitch) {
|
||||
outerLines.forEach((line) => {
|
||||
if (line.attributes.type === LINE_TYPE.WALLLINE.EAVES) {
|
||||
if (line.attributes.type === LINE_TYPE.WALLLINE.SHED) {
|
||||
line.attributes = {
|
||||
...line.attributes,
|
||||
pitch: pitch,
|
||||
pitch: pitchRef.current,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
@ -228,15 +228,15 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (line.direction === 'top') {
|
||||
line.attributes = {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitch,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -245,7 +245,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,6 +253,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,7 +276,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,6 +284,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -293,7 +293,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,6 +301,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -323,7 +323,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,6 +331,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -340,7 +340,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -349,6 +348,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,7 +371,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -380,6 +379,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -388,7 +388,6 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,6 +396,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: shedWidth / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.SHED,
|
||||
onlyOffset: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -503,7 +503,7 @@ export function useRoofShapeSetting(id) {
|
||||
outerLines.forEach((line) => {
|
||||
line.attributes = {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
pitch: currentAngleType === ANGLE_TYPE.SLOPE ? pitch : getChonByDegree(pitch),
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: false,
|
||||
}
|
||||
@ -526,7 +526,7 @@ export function useRoofShapeSetting(id) {
|
||||
} else if (line.direction === 'top' || line.direction === 'bottom') {
|
||||
line.attributes = {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
pitch: currentAngleType === ANGLE_TYPE.SLOPE ? pitch : getChonByDegree(pitch),
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
}
|
||||
}
|
||||
@ -549,7 +549,7 @@ export function useRoofShapeSetting(id) {
|
||||
} else if (line.direction === 'left' || line.direction === 'right') {
|
||||
line.attributes = {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
pitch: currentAngleType === ANGLE_TYPE.SLOPE ? pitch : getChonByDegree(pitch),
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,10 +93,11 @@ export const useLine = () => {
|
||||
|
||||
let left, top
|
||||
|
||||
const textStr =
|
||||
currentAngleType === ANGLE_TYPE.SLOPE
|
||||
? `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + attributes.pitch + angleUnit : ''}`
|
||||
: `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + getDegreeByChon(attributes.pitch) + angleUnit : ''}`
|
||||
const textStr = `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}`
|
||||
|
||||
// currentAngleType === ANGLE_TYPE.SLOPE
|
||||
// ? `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + attributes.pitch + angleUnit : ''}`
|
||||
// : `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + getDegreeByChon(attributes.pitch) + angleUnit : ''}`
|
||||
|
||||
if (direction === 'top') {
|
||||
left = (startPoint.x + endPoint.x) / 2
|
||||
@ -125,6 +126,7 @@ export const useLine = () => {
|
||||
name: 'pitchText',
|
||||
parentId: line.id,
|
||||
pitch: attributes.pitch,
|
||||
onlyOffset,
|
||||
})
|
||||
|
||||
canvas.add(text)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user