事件替换颜色等画布
This commit is contained in:
@@ -109,7 +109,32 @@ const exportExtraInfo = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 更新其他图层颜色
|
||||
const updateOtherLayersColor = async () => {
|
||||
const obj = {
|
||||
color: {rgba: {r:255,g:255,b:0,a:1}},
|
||||
}
|
||||
await canvasEditor?.value?.updateOtherLayers?.(obj);
|
||||
};
|
||||
// 更新其他图层印花
|
||||
const updateOtherLayersPrint = async () => {
|
||||
const obj = {
|
||||
printObject: {
|
||||
prints: [
|
||||
{
|
||||
ifSingle: true,
|
||||
level2Type: "Pattern",
|
||||
designType: "Library",
|
||||
path: "/src/assets/images/canvas/yinhua1.jpg",
|
||||
location: [250, 780],
|
||||
scale: [0.3, 0.4],
|
||||
angle: 0,
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
await canvasEditor?.value?.updateOtherLayers?.(obj);
|
||||
};
|
||||
|
||||
const changeCanvas = (command) => {
|
||||
console.log(command);
|
||||
@@ -219,6 +244,20 @@ const customToolsList = ref([
|
||||
label: "导E",
|
||||
class: "export-btn",
|
||||
},
|
||||
{
|
||||
id: "updateExtraInfo_color",
|
||||
title: "更新颜色",
|
||||
action: updateOtherLayersColor,
|
||||
label: "更C",
|
||||
class: "export-btn",
|
||||
},
|
||||
{
|
||||
id: "updateExtraInfo_print",
|
||||
title: "更新印花",
|
||||
action: updateOtherLayersPrint,
|
||||
label: "更P",
|
||||
class: "export-btn",
|
||||
},
|
||||
{
|
||||
id: "exportPNG",
|
||||
title: "导出PNG", //导出画布图片
|
||||
@@ -309,7 +348,7 @@ const otherData = {
|
||||
level2Type: "Pattern",
|
||||
designType: "Library",
|
||||
path: "/src/assets/images/canvas/yinhua1.jpg",
|
||||
location: [650, 650],
|
||||
location: [550, 650],
|
||||
scale: [0.15, 0.2],
|
||||
angle: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user