phaser3-rex-notes icon indicating copy to clipboard operation
phaser3-rex-notes copied to clipboard

Error in `DrawContent.js` when creating new ExpBar

Open XWILKINX opened this issue 1 year ago • 2 comments

When creating a circle progress bar via new ExpBar(...), the following error occurs in DrawContent.js:

Uncaught TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.

Note that is only occurring for me on production (website) and not in local testing.

Phaser version: 3.85.0-beta2

XWILKINX avatar Jul 25 '24 04:07 XWILKINX

I tracked down the cause and a temporary solution.

The issue was when passing a bar.barColor2 in the config (for gradients) when the ExpBar value was set to 0.

Removing the barColor2 param fixes the error.

XWILKINX avatar Jul 25 '24 05:07 XWILKINX

Can you provide a simplest runnable test case for reproducing the bug?

rexrainbow avatar Jul 25 '24 05:07 rexrainbow