From bd21fe08dc1935e1482cb734d58a90cdc4f56acc Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 13 May 2024 18:40:57 -0400 Subject: [PATCH] bugfix --- src/charts/shape.js | 4 ++-- src/components/chart/RungBuilder.vue | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/charts/shape.js b/src/charts/shape.js index 005b667..c40bfc4 100644 --- a/src/charts/shape.js +++ b/src/charts/shape.js @@ -279,9 +279,9 @@ export class Shape { onProps(props) { // the display properties of an existing shape were changed 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}) - 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}) } diff --git a/src/components/chart/RungBuilder.vue b/src/components/chart/RungBuilder.vue index 98b4ddd..4027b5c 100644 --- a/src/components/chart/RungBuilder.vue +++ b/src/components/chart/RungBuilder.vue @@ -68,7 +68,7 @@ const props = defineProps({ setModelValue: Function, // setModelValue(model,value) -> void setValues: Function, // setValues(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) @@ -330,7 +330,8 @@ function adjustShapes() { for( const shape of interiorShapes ) shape.delete() interiorShapes = [] - props.setShapes([]) + if (props.setShapes) + props.setShapes([]) } else if (vs.length === 1) { // @@ -343,7 +344,8 @@ function adjustShapes() { shape.delete() interiorShapes = [] } - props.setShapes([shapeA]) + if (props.setShapes) + props.setShapes([shapeA]) } else { // @@ -362,7 +364,8 @@ function adjustShapes() { else 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) shape.delete() interiorShapes = [] - props.setShapes([]) + if (props.setShapes) + props.setShapes([]) }