Merge branch 'qcast-pub' into dev
This commit is contained in:
commit
05b7293cb9
@ -12,6 +12,7 @@ const LINE_COLOR = {
|
|||||||
GABLE: '#3FBAE6',
|
GABLE: '#3FBAE6',
|
||||||
RIDGE: '#9e9e9e',
|
RIDGE: '#9e9e9e',
|
||||||
DEFAULT: '#000000',
|
DEFAULT: '#000000',
|
||||||
|
ACTIVE: '#EA10AC',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useRoofLinePropertySetting(id, roof) {
|
export function useRoofLinePropertySetting(id, roof) {
|
||||||
@ -23,9 +24,9 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentObject) {
|
if (currentObject && currentObject.name === 'roofLine') {
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
stroke: '#EA10AC',
|
stroke: LINE_COLOR.ACTIVE,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -35,17 +36,18 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
roof.lines.forEach((line) => {
|
roof.lines.forEach((line) => {
|
||||||
canvas.add(line)
|
canvas.add(line)
|
||||||
line.set({
|
line.set({
|
||||||
stroke: '#000000',
|
stroke: LINE_COLOR.DEFAULT,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
visible: true,
|
visible: true,
|
||||||
|
name: 'roofLine',
|
||||||
})
|
})
|
||||||
line.bringToFront()
|
line.bringToFront()
|
||||||
// line.setViewLengthText(false)
|
|
||||||
})
|
})
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetEaves = () => {
|
const handleSetEaves = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -60,6 +62,7 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSetGable = () => {
|
const handleSetGable = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -74,6 +77,7 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSetRidge = () => {
|
const handleSetRidge = () => {
|
||||||
|
if (!currentObject) return
|
||||||
currentObject.set({
|
currentObject.set({
|
||||||
attributes: {
|
attributes: {
|
||||||
...currentObject.attributes,
|
...currentObject.attributes,
|
||||||
@ -93,7 +97,11 @@ export function useRoofLinePropertySetting(id, roof) {
|
|||||||
}
|
}
|
||||||
const lastLine = history.current.pop()
|
const lastLine = history.current.pop()
|
||||||
|
|
||||||
delete lastLine.attributes
|
// delete lastLine.attributes
|
||||||
|
lastLine.attributes = {
|
||||||
|
...lastLine.attributes,
|
||||||
|
type: null,
|
||||||
|
}
|
||||||
lastLine.set({
|
lastLine.set({
|
||||||
stroke: LINE_COLOR.DEFAULT,
|
stroke: LINE_COLOR.DEFAULT,
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user