|
@@ -1,5 +1,5 @@
|
|
|
export const updatePen = (pen: any, prop: string, render = true) => {
|
|
|
- const v: any = { id: pen.id };
|
|
|
+ const v: any = { id: pen.id };
|
|
|
v[prop] = pen[prop];
|
|
|
if (prop === 'width' && pen.ratio) {
|
|
|
const rect = meta2d.findOne(pen.id);
|
|
@@ -30,7 +30,13 @@ export const updatePen = (pen: any, prop: string, render = true) => {
|
|
|
} else if (prop === 'titleFnJs') {
|
|
|
v.titleFn = null;
|
|
|
} else if (prop === 'dash') {
|
|
|
- v.lineDash = lineDashObj[v[prop]];
|
|
|
+ if(v[prop] === -1) {
|
|
|
+ v.lineDash = undefined;
|
|
|
+ v.lineWidth = 0;
|
|
|
+ }else{
|
|
|
+ v.lineWidth = pen.lineWidth || 1;
|
|
|
+ v.lineDash = lineDashObj[v[prop]];
|
|
|
+ }
|
|
|
} else if (prop === 'whiteSpace') {
|
|
|
if(!pen.whiteSpace || pen.whiteSpace !== 'break-all') {
|
|
|
pen.whiteSpace = 'break-all';
|
|
@@ -52,8 +58,12 @@ export const updatePen = (pen: any, prop: string, render = true) => {
|
|
|
v.height = btnHeight + gap * 2;
|
|
|
v.width = btnWidth * len + gap * (len + 1);
|
|
|
}
|
|
|
+ } else if(prop === 'lineWidth') {
|
|
|
+ if(v[prop] === undefined){
|
|
|
+ v[prop] = 1;
|
|
|
+ }
|
|
|
}
|
|
|
- meta2d.setValue(v, { render });
|
|
|
+ meta2d.setValue(v, { render });
|
|
|
};
|
|
|
|
|
|
export const lineDashObj = [
|