MCPcopy Create free account
hub / github.com/esengine/esengine / onMouseWheel

Method onMouseWheel

packages/fairygui/src/scroll/ScrollPane.ts:997–1011  ·  view source on GitHub ↗

* Handle mouse wheel * 处理鼠标滚轮

(delta: number)

Source from the content-addressed store, hash-verified

995 * 处理鼠标滚轮
996 */
997 public onMouseWheel(delta: number): void {
998 if (this._overlapWidth > 0 && this._overlapHeight === 0) {
999 if (this.pageMode) {
1000 this.setPosX(this._scrollX + this._viewWidth * Math.sign(delta), false);
1001 } else {
1002 this.setPosX(this._scrollX + this.mouseWheelStep * Math.sign(delta), false);
1003 }
1004 } else {
1005 if (this.pageMode) {
1006 this.setPosY(this._scrollY + this._viewHeight * Math.sign(delta), false);
1007 } else {
1008 this.setPosY(this._scrollY + this.mouseWheelStep * Math.sign(delta), false);
1009 }
1010 }
1011 }
1012
1013 /**
1014 * Dispose

Callers

nothing calls this directly

Calls 3

setPosXMethod · 0.95
setPosYMethod · 0.95
signMethod · 0.80

Tested by

no test coverage detected