fix: prop error

This commit is contained in:
zxc 2024-07-22 21:39:25 +08:00
parent f2b25336f4
commit 6739bbff6f
2 changed files with 3 additions and 3 deletions

View File

@ -267,9 +267,9 @@ export default () => {
element.viewBox = [el.width, el.height]
const pathFormula = SHAPE_PATH_FORMULAS[shape.pathFormula]
if ('editable' in pathFormula) {
if ('editable' in pathFormula && pathFormula.editable) {
element.path = pathFormula.formula(el.width, el.height, pathFormula.defaultValue)
element.keypoint = pathFormula.defaultValue
element.keypoints = pathFormula.defaultValue
}
else element.path = pathFormula.formula(el.width, el.height)
}

View File

@ -188,7 +188,7 @@ const updateShapePathData = (width: number, height: number) => {
const pathFormula = SHAPE_PATH_FORMULAS[handleElement.value.pathFormula]
let path = ''
if ('editable' in pathFormula) path = pathFormula.formula(width, height, handleElement.value.keypoint!)
if ('editable' in pathFormula && pathFormula.editable) path = pathFormula.formula(width, height, handleElement.value.keypoints!)
else path = pathFormula.formula(width, height)
return {