copyrect.js 628 B

123456789101112131415161718192021222324
  1. /*
  2. * noVNC: HTML5 VNC client
  3. * Copyright (C) 2012 Joel Martin
  4. * Copyright (C) 2018 Samuel Mannehed for Cendio AB
  5. * Copyright (C) 2018 Pierre Ossman for Cendio AB
  6. * Licensed under MPL 2.0 (see LICENSE.txt)
  7. *
  8. * See README.md for usage and integration instructions.
  9. *
  10. */
  11. export default class CopyRectDecoder {
  12. decodeRect(x, y, width, height, sock, display, depth) {
  13. if (sock.rQwait("COPYRECT", 4)) {
  14. return false;
  15. }
  16. let deltaX = sock.rQshift16();
  17. let deltaY = sock.rQshift16();
  18. display.copyImage(deltaX, deltaY, x, y, width, height);
  19. return true;
  20. }
  21. }