Example #1
0
        void handleMouseScroll()
        {
            if (Input.mouseScrollDelta.y != 0 || Input.mouseScrollDelta.x != 0)
            {
                var scaleFactor = this.canvas.scaleFactor;
                var pos         = this.getPointPosition(Input.mousePosition);
                this._scrollInput.onScroll(Input.mouseScrollDelta.x * scaleFactor,
                                           Input.mouseScrollDelta.y * scaleFactor,
                                           pos.x,
                                           pos.y,
                                           InputUtils.getScrollButtonKey());
            }

            var deltaScroll = this._scrollInput.getScrollDelta();

            if (deltaScroll != Vector2.zero)
            {
                this._windowAdapter.postPointerEvent(new ScrollData(
                                                         timeStamp: Timer.timespanSinceStartup,
                                                         change: PointerChange.scroll,
                                                         kind: PointerDeviceKind.mouse,
                                                         device: this._scrollInput.getDeviceId(),
                                                         physicalX: this._scrollInput.getPointerPosX(),
                                                         physicalY: this._scrollInput.getPointerPosY(),
                                                         scrollX: deltaScroll.x,
                                                         scrollY: deltaScroll.y
                                                         ));
            }
        }
Example #2
0
 void handleMouseScroll()
 {
     if (Input.mouseScrollDelta.y != 0 || Input.mouseScrollDelta.x != 0)
     {
         var scaleFactor = this.canvas.scaleFactor;
         var pos         = this.getPointPosition(Input.mousePosition);
         this._windowAdapter.onScroll(Input.mouseScrollDelta.x * scaleFactor,
                                      Input.mouseScrollDelta.y * scaleFactor,
                                      pos.x,
                                      pos.y,
                                      InputUtils.getScrollButtonKey());
     }
 }