From 4566bafae5845ff101a661d5df7bb3e4b0222773 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 23 May 2019 05:38:54 -0500 Subject: [PATCH] feat: wheel --- packages/graphics/stage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/graphics/stage.js b/packages/graphics/stage.js index 172f951..6ee950e 100644 --- a/packages/graphics/stage.js +++ b/packages/graphics/stage.js @@ -49,6 +49,7 @@ export class Stage extends decorate(Container) { this.inputNormalizer.on('pointerDown', this.onPointerDown, this); this.inputNormalizer.on('pointerMove', this.onPointerMove, this); this.inputNormalizer.on('pointerUp', this.onPointerUp, this); + this.inputNormalizer.on('wheel', this.onWheel, this); // Put the renderer and UI in the container element, and mark it // focusable. this.element.appendChild(this.renderer.element); @@ -93,6 +94,7 @@ export class Stage extends decorate(Container) { this.inputNormalizer.off('pointerDown', this.onPointerDown); this.inputNormalizer.off('pointerMove', this.onPointerMove); this.inputNormalizer.off('pointerUp', this.onPointerUp); + this.inputNormalizer.off('wheel', this.onWheel); this.inputNormalizer.destroy(); } @@ -155,6 +157,10 @@ export class Stage extends decorate(Container) { this.emit('pointerUp', event); } + onWheel(event) { + this.emit('wheel', event); + } + onWindowResize() { if (!this.parent) { return;