BlazorExtensions / Canvas

HTML5 Canvas API implementation for Microsoft Blazor
MIT License
602 stars 145 forks source link

Colors are misapplied in Blazor WebAssembly ASP.NET Core hosted app when there are multiple asysnc drawings. #124

Open halheinrich opened 2 years ago

halheinrich commented 2 years ago

The complex drawing method works fine in a Blazor Server app and a Blazor static WebAssembly app. But, if the ASP.NET Core hosted box is checked for a WebAssembly app, problems appear.

Here's a correct drawing: image

And here's an incorrect one: image

I assume this is a bug, but if I'm misusing the package, I'd appreciate knowing. I've refactored the drawing method to draw all the bits of the same color sequentially, and that helps. All the drawing calls are to async methods and are awaited.