Skip to content
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

Canvas widget for 2D graphics #193

Merged
merged 28 commits into from
Feb 20, 2020
Merged

Canvas widget for 2D graphics #193

merged 28 commits into from
Feb 20, 2020

Conversation

hecrj
Copy link
Member

@hecrj hecrj commented Feb 18, 2020

Solar system - Iced

Related to #32.

This PR implements a new Canvas widget in iced_wgpu that is capable of drawing 2D graphics with GPU rasterization by leveraging lyon.

The widget can be found in the new canvas module, alongside a bunch of other useful types for drawing and compositing layers. Check out the documentation to learn more!

Overall, the public API is very similar to the CanvasRenderingContext2D of the Web Canvas API, although some of its functionality is still missing.

I have also implemented MSAA support for the Mesh2D primitive in iced_wgpu. This setting can be enabled with the new antialiasing field in Settings.

A Canvas simply produces a set of Mesh2D primitives (see #140) when drawn. In the long run, we should try to help with nical/lyon#185 or use a more advanced rasterizer like pathfinder.

Finally, I have created two new examples to showcase the Canvas widget:

  • solar_system, a simple animated solar system showcasing how to compose different transforms.
  • clock, an application that draws a clock and its hands to display the current time.

Clock - Iced

@hecrj hecrj added the feature New feature or request label Feb 18, 2020
@hecrj hecrj added this to the 0.1.0 milestone Feb 18, 2020
@hecrj hecrj self-assigned this Feb 18, 2020
@artursapek
Copy link
Contributor

beautiful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants