Browse Source

修复BUG

caner 1 year ago
parent
commit
0bec94041a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      index/drawCanvas.js

+ 4 - 4
index/drawCanvas.js

@@ -37,7 +37,7 @@ class DrawCanvas {
     this._ctx.fillStyle = this._style.fillStyle
     const X = x - (this._style.w / 2)
     const Y = y - (this._style.h / 2)
-    this._ctx.fillRect(X,Y, this._style.w, this._style.h)
+    this._ctx.fillRect(X, Y, this._style.w, this._style.h)
     console.log('画图并存储');
   }
 
@@ -59,9 +59,9 @@ class DrawCanvas {
         for (let j = 0; j < el.path.length; j++) {
           const es = el.path[j];
           this._ctx.fillStyle = el.style.fillStyle
-          const X = es[0] - (el._style.w / 2)
-          const Y = es[1] - (el._style.h / 2)
-          this._ctx.fillRect(X,Y, el.style.w, el.style.h)
+          const X = es[0] - (el.style.w / 2)
+          const Y = es[1] - (el.style.h / 2)
+          this._ctx.fillRect(X, Y, el.style.w, el.style.h)
         }
       }
     }