MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / setCoords

Method setCoords

components/liquid-ether.tsx:257–269  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

255 return this.isHoverInside;
256 }
257 setCoords(x: number, y: number) {
258 if (!this.container) return;
259 if (this.timer) window.clearTimeout(this.timer);
260 const rect = this.container.getBoundingClientRect();
261 if (rect.width === 0 || rect.height === 0) return;
262 const nx = (x - rect.left) / rect.width;
263 const ny = (y - rect.top) / rect.height;
264 this.coords.set(nx * 2 - 1, -(ny * 2 - 1));
265 this.mouseMoved = true;
266 this.timer = window.setTimeout(() => {
267 this.mouseMoved = false;
268 }, 100);
269 }
270 setNormalized(nx: number, ny: number) {
271 this.coords.set(nx, ny);
272 this.mouseMoved = true;

Callers 3

onDocumentMouseMoveMethod · 0.95
onDocumentTouchStartMethod · 0.95
onDocumentTouchMoveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected