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