UNPKG

gl2d

Version:

2D graphics package for WebGL

42 lines 1.61 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var mouseOrTouch_1 = require("../event/mouseOrTouch"); var MouseOrTouchTool = (function () { function MouseOrTouchTool() { } /** * Gets either the cursor (in case of mouse action) or the first pointer down (in case of touch action). */ MouseOrTouchTool.prototype.getPrimaryPointer = function (event) { if (mouseOrTouch_1.isMouseAction(event)) { return event.cursor; } else if (mouseOrTouch_1.isTouchAction(event)) { return event.pointers[0]; } else { return null; } }; return MouseOrTouchTool; }()); exports.MouseOrTouchTool = MouseOrTouchTool; var _MouseOrTouchTool = (function (_super) { __extends(_MouseOrTouchTool, _super); function _MouseOrTouchTool() { return _super !== null && _super.apply(this, arguments) || this; } return _MouseOrTouchTool; }(MouseOrTouchTool)); exports._MouseOrTouchTool = _MouseOrTouchTool; //# sourceMappingURL=mouseOrTouch.js.map