INNER CODE UNIT · JavaScript

scaleX

NeoAxis/NeoAxisEngine · Project/Sources/NeoAxis.Player.Web/wwwroot/main.js:376

			const scaleX = rect.width > 0 ? canvas.width / rect.width : 1.0;
			const scaleY = rect.height > 0 ? canvas.height / rect.height : 1.0;

			return {
				x: (clientX - rect.left) * scaleX,
				y: (clientY - rect.top) * scaleY
			};
		}

		function getEventModifiers(/** @type {KeyboardEvent|MouseEvent|TouchEvent} */e)
		{
			var flags = 0;
			if (e.shiftKey) flags |= InputModifiers.Shift;
			if (e.ctrlKey) flags |= InputModifiers.Ctrl;
			if (e.altKey) flags |= InputModifiers.Alt;
			if (e.metaKey) flags |= InputModifiers.Meta;
			return flags;
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…