INNER CODE UNIT · JavaScript

applyCanvasSize

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

		const applyCanvasSize = (width, height) =>
		{
			width = Math.max(1, Math.round(width));
			height = Math.max(1, Math.round(height));

			const fullscreenEnabled = document.fullscreenElement != null;

			if (width === currentWidth && height === currentHeight && fullscreenEnabled === currentFullscreen)
				return;

			currentWidth = width;
			currentHeight = height;
			currentFullscreen = fullscreenEnabled;

			if (canvas.width !== width)
				canvas.width = width;
			if (canvas.height !== height)
				canvas.height = height;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…