|
@@ -270,6 +270,7 @@
|
|
v-model:visible="drawFuncDialog.show"
|
|
v-model:visible="drawFuncDialog.show"
|
|
:header="drawFuncDialog.edit ? '编辑动画元素' : '添加动画元素'"
|
|
:header="drawFuncDialog.edit ? '编辑动画元素' : '添加动画元素'"
|
|
:width="800"
|
|
:width="800"
|
|
|
|
+ :closeOnOverlayClick="false"
|
|
:destroy-on-close="true"
|
|
:destroy-on-close="true"
|
|
@confirm="confirmLineDarwFunc"
|
|
@confirm="confirmLineDarwFunc"
|
|
@close="drawFuncDialog.show = false"
|
|
@close="drawFuncDialog.show = false"
|
|
@@ -434,8 +435,9 @@ const height = 10 // 此处定义图形高度
|
|
ctx.translate(state.x + (width/2 * scale), state.y + (height/2 * scale)); // 平移到中心点
|
|
ctx.translate(state.x + (width/2 * scale), state.y + (height/2 * scale)); // 平移到中心点
|
|
ctx.rotate((state.rotate * Math.PI) / 180); // 配置旋转角度
|
|
ctx.rotate((state.rotate * Math.PI) / 180); // 配置旋转角度
|
|
ctx.scale(scale, scale); // 配置缩放
|
|
ctx.scale(scale, scale); // 配置缩放
|
|
-ctx.translate(-(width/2 * scale), -(he1/22 * scale)); // 平移回左上角
|
|
|
|
|
|
+ctx.translate(-(width/2 * scale), -(height/2 * scale)); // 平移回左上角
|
|
|
|
|
|
|
|
+ctx.beginPath();
|
|
//在此处编写你的图形定义代码...
|
|
//在此处编写你的图形定义代码...
|
|
|
|
|
|
ctx.restore()`, // 插入的文本
|
|
ctx.restore()`, // 插入的文本
|
|
@@ -480,7 +482,7 @@ const confirmLineDarwFunc = ()=>{
|
|
code
|
|
code
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
- addLineDarwFunc()
|
|
|
|
|
|
+ if(!addLineDrawFunc()) return
|
|
}
|
|
}
|
|
syncLineAnimateDraws()
|
|
syncLineAnimateDraws()
|
|
drawFuncDialog.value.show = false;
|
|
drawFuncDialog.value.show = false;
|
|
@@ -503,15 +505,16 @@ const syncLineAnimateDraws = ()=>{
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-const addLineDarwFunc = ()=>{
|
|
|
|
|
|
+const addLineDrawFunc = ()=>{
|
|
if(!drawFuncDialog.value.name) {
|
|
if(!drawFuncDialog.value.name) {
|
|
MessagePlugin.warning('请输入名称!');
|
|
MessagePlugin.warning('请输入名称!');
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
const code = `(ctx,pen,state,index)=>{
|
|
const code = `(ctx,pen,state,index)=>{
|
|
${drawFuncDialog.value.code}
|
|
${drawFuncDialog.value.code}
|
|
}`
|
|
}`
|
|
meta2d.registerLineAnimateDraws(drawFuncDialog.value.name,code);
|
|
meta2d.registerLineAnimateDraws(drawFuncDialog.value.name,code);
|
|
|
|
+ return true
|
|
}
|
|
}
|
|
|
|
|
|
const penTree: any = ref([]);
|
|
const penTree: any = ref([]);
|