xushiting 2 سال پیش
والد
کامیت
d976744477
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      src/graphic/Layer.js

+ 6 - 6
src/graphic/Layer.js

@@ -62,14 +62,14 @@ export default class Layer extends KanKan.MITT.Emiter {
   }
 
   bindEvents() {
-    this.div.addEventListener("contextmenu", function (e) {
+    this.canvas.addEventListener("contextmenu", function (e) {
       e.preventDefault();
     });
-    this.div.addEventListener("mousedown", this.onMouseDown.bind(this));
-    this.div.addEventListener("mousemove", this.onMouseMove.bind(this));
-    this.div.addEventListener("mouseup", this.onMouseUp.bind(this));
-    this.div.addEventListener("mousewheel", this.onWheel.bind(this));
-    this.div.addEventListener("DOMMouseScroll", this.onWheel.bind(this));
+    this.canvas.addEventListener("mousedown", this.onMouseDown.bind(this));
+    this.canvas.addEventListener("mousemove", this.onMouseMove.bind(this));
+    this.canvas.addEventListener("mouseup", this.onMouseUp.bind(this));
+    this.canvas.addEventListener("mousewheel", this.onWheel.bind(this));
+    this.canvas.addEventListener("DOMMouseScroll", this.onWheel.bind(this));
   }
 
   onMouseDown(e) {