|
@@ -51,19 +51,16 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
|
|
defaultStyle,
|
|
defaultStyle,
|
|
transformType: "custom",
|
|
transformType: "custom",
|
|
customTransform(callback, shape, data) {
|
|
customTransform(callback, shape, data) {
|
|
- let initData: TextData;
|
|
|
|
useCustomTransformer(shape, data, {
|
|
useCustomTransformer(shape, data, {
|
|
openSnap: true,
|
|
openSnap: true,
|
|
getRepShape($shape) {
|
|
getRepShape($shape) {
|
|
const repShape = cloneRepShape($shape).shape;
|
|
const repShape = cloneRepShape($shape).shape;
|
|
- setShapeTransform(repShape, new Transform(data.value.mat));
|
|
|
|
- repShape.width(data.value.width);
|
|
|
|
- repShape.fontSize(data.value.fontSize);
|
|
|
|
- initData = copy(data.value);
|
|
|
|
return {
|
|
return {
|
|
shape: repShape,
|
|
shape: repShape,
|
|
update(data) {
|
|
update(data) {
|
|
- console.log("update");
|
|
|
|
|
|
+ data.width && repShape.width(data.width);
|
|
|
|
+ data.fontSize && repShape.fontSize(data.fontSize);
|
|
|
|
+ setShapeTransform(repShape, new Transform(data.mat));
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -78,14 +75,10 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
|
|
},
|
|
},
|
|
},
|
|
},
|
|
beforeHandler(data, mat) {
|
|
beforeHandler(data, mat) {
|
|
- return matResponse({ mat, data: copy(initData) });
|
|
|
|
|
|
+ return matResponse({ data: copy(data), mat });
|
|
},
|
|
},
|
|
handler(data, mat) {
|
|
handler(data, mat) {
|
|
- const a = matResponse({ mat, data: copy(initData) });
|
|
|
|
- if (a.width) {
|
|
|
|
- Object.assign(data, a);
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+ return !!matResponse({ mat, data }).width;
|
|
},
|
|
},
|
|
callback,
|
|
callback,
|
|
});
|
|
});
|
|
@@ -100,7 +93,7 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
|
|
"fill",
|
|
"fill",
|
|
"stroke",
|
|
"stroke",
|
|
"strokeWidth",
|
|
"strokeWidth",
|
|
- // "dash",
|
|
|
|
|
|
+ "dash",
|
|
"opacity",
|
|
"opacity",
|
|
"fontSize",
|
|
"fontSize",
|
|
"align",
|
|
"align",
|
|
@@ -117,7 +110,9 @@ watch(
|
|
data.value.width = getWidth(data.value, 1);
|
|
data.value.width = getWidth(data.value, 1);
|
|
const $shape = shape.value?.getNode();
|
|
const $shape = shape.value?.getNode();
|
|
$shape && $shape.fire("bound-change");
|
|
$shape && $shape.fire("bound-change");
|
|
- }
|
|
|
|
|
|
+ $shape?.draw();
|
|
|
|
+ },
|
|
|
|
+ { flush: "sync" }
|
|
);
|
|
);
|
|
|
|
|
|
const submitHandler = (val: string) => {
|
|
const submitHandler = (val: string) => {
|