dev #555
@ -96,7 +96,7 @@ export default function QSelectBox({
|
|||||||
title={tagTitle}
|
title={tagTitle}
|
||||||
>
|
>
|
||||||
<p>{selected}</p>
|
<p>{selected}</p>
|
||||||
<ul className="select-item-wrap">
|
<ul className="select-item-wrap" style={{ maxHeight: '200px' }}>
|
||||||
{options?.length > 0 &&
|
{options?.length > 0 &&
|
||||||
options?.map((option, index) => (
|
options?.map((option, index) => (
|
||||||
<li key={option.id + '_' + index} className="select-item" onClick={() => handleClickSelectOption(option)}>
|
<li key={option.id + '_' + index} className="select-item" onClick={() => handleClickSelectOption(option)}>
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export function useFont() {
|
|||||||
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (canvas && commonText.fontWeight.value) {
|
if (canvas && commonText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'commonText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'commonText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
@ -24,10 +25,11 @@ export function useFont() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}}, 200)
|
||||||
}, [commonText])
|
}, [commonText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (canvas && dimensionLineText.fontWeight.value) {
|
if (canvas && dimensionLineText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'dimensionLineText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'dimensionLineText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
@ -41,9 +43,12 @@ export function useFont() {
|
|||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
}, 200)
|
||||||
|
|
||||||
}, [dimensionLineText])
|
}, [dimensionLineText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (canvas && flowText.fontWeight.value) {
|
if (canvas && flowText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'flowText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'flowText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
@ -57,9 +62,12 @@ export function useFont() {
|
|||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
}, 200)
|
||||||
|
|
||||||
}, [flowText])
|
}, [flowText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (canvas && lengthText.fontWeight.value) {
|
if (canvas && lengthText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'lengthText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'lengthText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
@ -73,9 +81,11 @@ export function useFont() {
|
|||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
}, 200)
|
||||||
}, [lengthText])
|
}, [lengthText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (canvas && circuitNumberText.fontWeight.value) {
|
if (canvas && circuitNumberText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'circuitNumber')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'circuitNumber')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
@ -89,6 +99,7 @@ export function useFont() {
|
|||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
}, 200)
|
||||||
}, [circuitNumberText])
|
}, [circuitNumberText])
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import { basicSettingState } from '@/store/settingAtom'
|
|||||||
import { calcLineActualSize } from '@/util/qpolygon-utils'
|
import { calcLineActualSize } from '@/util/qpolygon-utils'
|
||||||
import { getDegreeByChon } from '@/util/canvas-util'
|
import { getDegreeByChon } from '@/util/canvas-util'
|
||||||
import { useText } from '@/hooks/useText'
|
import { useText } from '@/hooks/useText'
|
||||||
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
|
|
||||||
export const useLine = () => {
|
export const useLine = () => {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -23,14 +24,15 @@ export const useLine = () => {
|
|||||||
const angleUnit = useRecoilValue(showAngleUnitSelector)
|
const angleUnit = useRecoilValue(showAngleUnitSelector)
|
||||||
const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
|
const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
|
||||||
const globalPitch = useRecoilValue(globalPitchState)
|
const globalPitch = useRecoilValue(globalPitchState)
|
||||||
|
const lengthText = useRecoilValue(fontSelector('lengthText'))
|
||||||
|
|
||||||
const { changeCorridorDimensionText } = useText()
|
const { changeCorridorDimensionText } = useText()
|
||||||
|
|
||||||
const addLine = (points = [], options) => {
|
const addLine = (points = [], options) => {
|
||||||
const line = new QLine(points, {
|
const line = new QLine(points, {
|
||||||
...options,
|
...options,
|
||||||
fontSize: fontSize,
|
fontSize: lengthText.fontSize.value,
|
||||||
fontFamily: fontFamily,
|
fontFamily: lengthText.fontFamily.value,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (line.length < 1) {
|
if (line.length < 1) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user