INNER CODE UNIT · JavaScript

offsetX

CopterExpress/clover · apps/ios/cleverrc/main.js:61

	var offsetX = touch.clientX - targetRect.left;
	var offsetY = touch.clientY - targetRect.top;

	var x = 2 * offsetX / targetRect.width;
	var y = 2 * offsetY / targetRect.height;

	x = Math.max(0, x);
	x = Math.min(2, x);
	y = Math.max(0, y);
	y = Math.min(2, y);

	stickPointer.style.left = (x * 50) + '%';
	stickPointer.style.top = (y * 50) + '%';

	x -= 1;
	y = 1 - y;

	if (target.matches('.stick-left')) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…