Simplify logic in createCanvas().

I assume we used `untyped __js__` to get around incomplete externs, but Haxe 3.2 updated the externs, and they've included the second argument ever since.
This commit is contained in:
player-03
2025-07-13 21:15:39 -04:00
committed by GitHub
parent 112664aa35
commit 3c86d2cd39

View File

@@ -189,13 +189,10 @@ class ImageCanvasUtil
if (!image.transparent)
{
if (!image.transparent) buffer.__srcCanvas.setAttribute("moz-opaque", "true");
buffer.__srcContext = untyped #if haxe4 js.Syntax.code #else __js__ #end ('buffer.__srcCanvas.getContext ("2d", { alpha: false })');
}
else
{
buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
buffer.__srcCanvas.setAttribute("moz-opaque", "true");
}
buffer.__srcContext = buffer.__srcCanvas.getContext("2d", {alpha: image.transparent});
}
#end
}