(flutter) (web) only set position/zIndex for canvas if createCanvas is true

This commit is contained in:
Nick Fisher
2025-05-28 10:48:39 +08:00
parent f7d6d4786a
commit b12dc80cfd

View File

@@ -86,8 +86,10 @@ class ThermionFlutterWebPlugin extends ThermionFlutterPlatform {
// canvas.style.display = "none";
document.body!.appendChild(canvas);
(canvas as HTMLElement).style.position = "fixed";
(canvas as HTMLElement).style.zIndex = "-1";
if (options.createCanvas) {
(canvas as HTMLElement).style.position = "fixed";
(canvas as HTMLElement).style.zIndex = "-1";
}
final config = FFIFilamentConfig(
backend: Backend.OPENGL,