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

Method onTouchMoved

examples/commodetto/mini-drag/main.js:115–123  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

113 this.update();
114 }
115 onTouchMoved(x, y) {
116 let currentBounds = this.bounds;
117 let newBounds = new Rectangle(this.anchor.x + x, this.anchor.y + y, this.bounds.w, this.bounds.h);
118 let unionBounds = Rectangle.union(currentBounds, newBounds);
119 this.bounds = newBounds;
120 render.begin(unionBounds.x, unionBounds.y, unionBounds.w, unionBounds.h);
121 this.draw();
122 render.end();
123 }
124 onTouchEnded(/* x, y */) {
125 this.state = 0;
126 this.update();

Callers

nothing calls this directly

Calls 4

drawMethod · 0.95
beginMethod · 0.65
endMethod · 0.65
unionMethod · 0.45

Tested by

no test coverage detected