This commit is contained in:
Tim
2024-05-13 18:40:57 -04:00
parent bf39ed946c
commit bd21fe08dc
2 changed files with 11 additions and 7 deletions

View File

@@ -279,9 +279,9 @@ export class Shape {
onProps(props) { // the display properties of an existing shape were changed onProps(props) { // the display properties of an existing shape were changed
if (this.debug) console.log('shape onProps', this.model, props) if (this.debug) console.log('shape onProps', this.model, props)
if (props.textcolor && props.textcolor !== this.tvProps.textcolor) if (props.textcolor && typeof props.textcolor !== 'object' && props.textcolor !== this.tvProps.textcolor)
this.updateModel({color:props.textcolor}) this.updateModel({color:props.textcolor})
else if (props.linecolor && props.linecolor !== this.tvProps.linecolor) else if (props.linecolor && typeof props.linecolor !== 'object' && props.linecolor !== this.tvProps.linecolor)
this.updateModel({color:props.linecolor}) this.updateModel({color:props.linecolor})
} }

View File

@@ -68,7 +68,7 @@ const props = defineProps({
setModelValue: Function, // setModelValue(model,value) -> void setModelValue: Function, // setModelValue(model,value) -> void
setValues: Function, // setValues(values:Array) -> void setValues: Function, // setValues(values:Array) -> void
setWeights: Function, // setWeights(values:Array) -> void setWeights: Function, // setWeights(values:Array) -> void
setShapes: Function, // setShapes([shapeA, innerShape, ..., shapeB]) -> void setShapes: { type: Function, default: null }, // setShapes([shapeA, innerShape, ..., shapeB]) -> void
}) })
const flippedSign = computed(()=>props.flip?-1:1) const flippedSign = computed(()=>props.flip?-1:1)
@@ -330,7 +330,8 @@ function adjustShapes() {
for( const shape of interiorShapes ) for( const shape of interiorShapes )
shape.delete() shape.delete()
interiorShapes = [] interiorShapes = []
props.setShapes([]) if (props.setShapes)
props.setShapes([])
} }
else if (vs.length === 1) { else if (vs.length === 1) {
// //
@@ -343,7 +344,8 @@ function adjustShapes() {
shape.delete() shape.delete()
interiorShapes = [] interiorShapes = []
} }
props.setShapes([shapeA]) if (props.setShapes)
props.setShapes([shapeA])
} }
else { else {
// //
@@ -362,7 +364,8 @@ function adjustShapes() {
else else
interiorShapes[i-1].setModel(makeModel(i)) interiorShapes[i-1].setModel(makeModel(i))
} }
props.setShapes([shapeA, ...interiorShapes, shapeB]) if (props.setShapes)
props.setShapes([shapeA, ...interiorShapes, shapeB])
} }
} }
@@ -380,7 +383,8 @@ function deleteShapes() {
for (const shape of interiorShapes) for (const shape of interiorShapes)
shape.delete() shape.delete()
interiorShapes = [] interiorShapes = []
props.setShapes([]) if (props.setShapes)
props.setShapes([])
} }