Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

moveTo.js 924B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const utils_1 = require("../../utils");
  4. async function moveTo({ xOffset, yOffset } = {}) {
  5. if (!this.isW3C) {
  6. return this.moveToElement(this.elementId, xOffset, yOffset);
  7. }
  8. const { x, y, width, height } = await utils_1.getElementRect(this);
  9. const { scrollX, scrollY } = await utils_1.getScrollPosition(this);
  10. const newXOffset = Math.floor(x - scrollX + (typeof xOffset === 'number' ? xOffset : (width / 2)));
  11. const newYOffset = Math.floor(y - scrollY + (typeof yOffset === 'number' ? yOffset : (height / 2)));
  12. return this.performActions([{
  13. type: 'pointer',
  14. id: 'finger1',
  15. parameters: { pointerType: 'mouse' },
  16. actions: [{ type: 'pointerMove', duration: 0, x: newXOffset, y: newYOffset }]
  17. }]).then(() => this.releaseActions());
  18. }
  19. exports.default = moveTo;