New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using arc to draw circles #2

Closed
jwmerrill opened this Issue Nov 11, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@jwmerrill
Contributor

jwmerrill commented Nov 11, 2014

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.arc

Currently, circles are rendered as a 50-gon, which is (just barely) perceptibly pointy.

@jwmerrill

This comment has been minimized.

Show comment
Hide comment
@jwmerrill

jwmerrill Nov 11, 2014

Contributor

A downside of this is that it would add complexity, since currently Shape is just an alias for [(float, float)].

It's also kind of annoying to extend this technique to drawing ellipses. There is an upcoming ellipse method, but it doesn't currently have wide browser support. Until then, one way to draw ellipses is to scale the canvas, draw a circle, unscale the canvas, and then stroke the circle.

Contributor

jwmerrill commented Nov 11, 2014

A downside of this is that it would add complexity, since currently Shape is just an alias for [(float, float)].

It's also kind of annoying to extend this technique to drawing ellipses. There is an upcoming ellipse method, but it doesn't currently have wide browser support. Until then, one way to draw ellipses is to scale the canvas, draw a circle, unscale the canvas, and then stroke the circle.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Nov 11, 2014

Member

Totally on my todo list!

I'm currently in a push to get 0.14 out, but after that one of the big goals will be improving elm-html and Graphics.Element/Collage/Input. This includes interop between them, efficiency, and API.

I've been wanting to add bezier curves, arcs, etc. to Collage for ages so that falls in nicely with the revamp of the Graphics... implementation that is coming up.

Member

evancz commented Nov 11, 2014

Totally on my todo list!

I'm currently in a push to get 0.14 out, but after that one of the big goals will be improving elm-html and Graphics.Element/Collage/Input. This includes interop between them, efficiency, and API.

I've been wanting to add bezier curves, arcs, etc. to Collage for ages so that falls in nicely with the revamp of the Graphics... implementation that is coming up.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Nov 11, 2014

Member

Long ago I kept running into issues getting the API for curved paths to feel right and to turn into a nice implementation.

Now that you've pushed me to revisit even at a high-level, I have some thoughts on refactoring the modules that could be really helpful :) It's interesting how "the right design" is time dependent. Early on the existing module structure was obviously correct, but now it sorta makes sense to split out Collage as a project of its own. We'll see!

Thanks for opening this thread! :)

Member

evancz commented Nov 11, 2014

Long ago I kept running into issues getting the API for curved paths to feel right and to turn into a nice implementation.

Now that you've pushed me to revisit even at a high-level, I have some thoughts on refactoring the modules that could be really helpful :) It's interesting how "the right design" is time dependent. Early on the existing module structure was obviously correct, but now it sorta makes sense to split out Collage as a project of its own. We'll see!

Thanks for opening this thread! :)

jvoigtlaender pushed a commit that referenced this issue Jan 18, 2016

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there.

I'd like to keep it relatively stable for now though. I expect to be focusing on <canvas> for professional users and "friendly graphics" for learning as separate use cases. Progress will be made when those start happening.

Member

evancz commented May 11, 2016

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there.

I'd like to keep it relatively stable for now though. I expect to be focusing on <canvas> for professional users and "friendly graphics" for learning as separate use cases. Progress will be made when those start happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment