MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onTouchMoved

Method onTouchMoved

tools/xsbug/CodeView.js:416–445  ·  view source on GitHub ↗
(code, id, x, y, ticks)

Source from the content-addressed store, hash-verified

414 this.onSelected(code);
415 }
416 onTouchMoved(code, id, x, y, ticks) {
417 if ((this.x != x) || (this.y != y))
418 this.onTouchSelect(code, x, y);
419 this.x = x;
420 this.y = y;
421 var scroller = code.container;
422 var dx = 0, dy = 0;
423 if (this.mode != LINE_MODE) {
424 if (x < scroller.x)
425 dx = -1;
426 else if (scroller.x + scroller.width < x)
427 dx = 1;
428 }
429 if (y < scroller.y)
430 dy = -1;
431 else if (scroller.y + scroller.height < y)
432 dy = 1;
433 if (this.dx != dx) {
434 this.dx = dx;
435 this.tx = Date.now();
436 }
437 if (this.dy != dy) {
438 this.dy = dy;
439 this.ty = Date.now();
440 }
441 if (dx || dy)
442 code.start();
443 else
444 code.stop();
445 }
446 onTouchSelect(code, x, y) {
447 var anchor = this.anchor;
448 var bounds = code.bounds;

Callers

nothing calls this directly

Calls 3

onTouchSelectMethod · 0.95
startMethod · 0.65
stopMethod · 0.65

Tested by

no test coverage detected