liyongli 2 年之前
父節點
當前提交
89359d4858
共有 1 個文件被更改,包括 13 次插入2 次删除
  1. 13 2
      src/view/easyDiffusion/components/imageEdit.vue

+ 13 - 2
src/view/easyDiffusion/components/imageEdit.vue

@@ -368,7 +368,7 @@ const fillAll = () => {
   ctxBg.shadowColor = conf.shadowColor;
   ctxBg.fillStyle = conf.strokeStyle;
   ctxBg.globalAlpha = conf.globalAlpha;
-  console.log('填充',conf,waith.value, height.value);
+  console.log('填充', conf, waith.value, height.value);
   pathList.push(conf);
   indexBase = pathList.length;
   ctxBg.fillRect(0, 0, waith.value, height.value);
@@ -524,11 +524,16 @@ const drawBg = () => {
   const end = Math.min(indexBase, pathList.length);
   if (props.file.fileResult) {
     ctxBg.drawImage(img, 0, 0, waith.value, height.value);
+  }else {
+    ctxBg.beginPath();
+    ctxBg.shadowColor = '#ffffff';
+    ctxBg.fillStyle = '#ffffff';
+    ctxBg.fillRect(0, 0, waith.value, height.value);
+    ctxBg.closePath();
   }
 
   for (let o = 0; o < end; o++) {
     const config = pathList[o];
-    console.log(config)
     if (config.type == 'rect') {
       ctxBg.beginPath();
       ctxBg.fillStyle = config.strokeStyle;
@@ -578,6 +583,12 @@ onMounted(() => {
         ctxBg.drawImage(img, 0, 0, waith.value, height.value);
       });
     };
+  } else {
+    ctxBg.beginPath();
+    ctxBg.shadowColor = '#ffffff';
+    ctxBg.fillStyle = '#ffffff';
+    ctxBg.fillRect(0, 0, waith.value, height.value);
+    ctxBg.closePath();
   }
 });