添加画布粘贴外部文字和图片
This commit is contained in:
@@ -1818,7 +1818,12 @@ export class LayerManager {
|
||||
|
||||
// 存储到剪贴板
|
||||
this.clipboardData = layerCopy;
|
||||
|
||||
const input = document.createElement("input");
|
||||
input.value = "aida_copy_canvas_layer: " + layer.name;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(input);
|
||||
console.log(`已复制图层:${layer.name}`);
|
||||
|
||||
return this.clipboardData;
|
||||
@@ -1917,7 +1922,8 @@ export class LayerManager {
|
||||
* 粘贴图层
|
||||
* @returns {string} 新创建的图层ID
|
||||
*/
|
||||
async pasteLayer() {
|
||||
async pasteLayer(event) {
|
||||
console.log("剪贴板数据:", this.clipboardData,event);
|
||||
if (!this.clipboardData) {
|
||||
console.error("剪贴板中没有图层数据");
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user