Potential regression in BJS 5.21.0: Failed to execute 'arc' on 'CanvasRenderingContext2D'

After upgrading to BJS 5.21.0, I got this error right away in my game:

Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-0.434) is negative.

The stack trace isn’t the most useful, but here’s what I do have that might help (the line numbers obv do not):

at
t._drawRoundedRect	@	babylonBundle.js:2
t._localDraw	@	babylonBundle.js:2
t._draw	@	babylonBundle.js:2
e._render	@	babylonBundle.js:

My best guess is that it’s in the GUI system, as there are two rectangles that the GUI draws around meshes, and they both have rounded corners :sunglasses:

I’d tested the same commit (without the package updates) without any issue, so the evidence points towards something being different in the versions of BJS.

Really glad that I split those package updates into their own commit, otherwise the v1.0 of Space-Truckers might be blocked! :smile: :sunglasses:

@carolhmj - i believe something was changed regarding arc-draw of the button edges (if I am not mistaken). Can you check that?

Yep it did! Thanks for letting me know I’ll check it rn.

2 Likes

PR here Fix drawing a rounded rectangle by carolhmj · Pull Request #12908 · BabylonJS/Babylon.js (github.com)

2 Likes

That’s part of why the BJS team is so friggin awesome! I’m not aware of many if any Serious OSS Projects that can turn around a bug report so fast, so consistently!

3 Likes