question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arc/Circle Position wrong

See original GitHub issue

Version

  • 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
telinc1commented, Jun 27, 2019

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 to Phaser.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.

0reactions
photonstormcommented, Jun 28, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found