Arc/Circle Position wrong
See original GitHub issueVersion
- Phaser Version: v3.18.1-FB
- Operating system: Windows 10
- Browser: Tested in Chrome, FF, Chrome (Android)
Description
When drawing a circle (or arc) with <Scene>.add.circle(), it is placed wrong. It is placed to far left and top. After some tests I can say it is placed 0.5 times of its radius in negative x and y direction, from the expected position.
Example Test Code
Placing a circle in the left top corner, to fit exactly, without setting the origin.
Expectation:
this.add.circle(200, 200, 200, 0xff0000);
What is needed in this Version:
this.add.circle(300, 300, 200, 0xff0000);
Additional Information
See your own example: http://labs.phaser.io/view.html?src=src/game%20objects/shapes/blend%20modes.js&v=3.18.1
Btw. it would be nice, if the version could also be set in the editor for the examples.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
HTML Canvas arc drawing on wrong position JavaScript
Trying to draw an arc at mouse position after creating the canvas dynamically, for example: pressing on the bottom right of the canvas...
Read more >Arc centers incorrect - Industrial Forum - eMastercam.com
After post-processing, my Heidenhain 407 control gave "Circle end position incorrect" error. First circle center in NC file is at X+0.0015, ...
Read more >Calculating position/distance of point on arc of circle
I'm having a hard time trying to wrap my head around this problem. Imagine a line of length A+B with center C, with...
Read more >How to find the arc length of a circle using the formula - YouTube
An arc of a circle is the curve between a pair of points on the ... Angles in Standard Position https://www.youtube.com/playlist?list.
Read more >Arc length from subtended angle (video) - Khan Academy
Finding the length of an arc using the degree of the angle subtended by the ... 18π is the circumference of the circle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, see the test case in this pen. The circle’s origin is not changed and its coordinates are at the center of the canvas, but it is not rendered where you’d expect. Additionally, it only happens with the WebGL renderer. If you set the
type
in the config toPhaser.CANVAS
, the circle will appear where it’s supposed to.I suspect that the indirect cause of this is commit 382afd6, coupled with the offset applied in the
updateData
method of the Arc, however, I haven’t looked much further into this.Thank you for submitting this issue. We have fixed this and the fix has been pushed to the
master
branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.