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

Add MS paint example #144

Merged
merged 8 commits into from
Jan 11, 2020
Merged

Add MS paint example #144

merged 8 commits into from
Jan 11, 2020

Conversation

hatoo
Copy link
Contributor

@hatoo hatoo commented Jan 6, 2020

Since #140 has landed,
I realized that we can make MS paint like example by using lyon now.

This PR resolves #18

@artursapek
Copy link
Contributor

hah, awesome

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for giving this a shot! It's great to see the new primitive can be used to create stuff like this very easily.

I left some feedback that I think we should address before merging. Let me know what you think!

examples/paint.rs Outdated Show resolved Hide resolved
},
),
)
.unwrap();
Copy link
Member

@hecrj hecrj Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The widget generates strokes every time the cursor is moved while dragging. It emulates a pencil. This means that strokes will add up very quickly and will be very close to each other.

I am not sure implementing a pencil like this is the best way to showcase how to combine the new Mesh2D primitive with lyon. My intuition tells me that something like a color buffer would work better for this particular case.

I believe shape tools are the ones where lyon can shine. Maybe we could implement line/rectangle/circle tools instead?

Copy link
Contributor Author

@hatoo hatoo Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that "pencil" is not a very good example which demonstrates the combination of iced and lyon.
I choose to make a bezier tool as an example to demonstrate it instead.
Because I think a tool which is supporting only bezier curve is enough to show power of lyon.

@hecrj hecrj added the improvement An internal improvement label Jan 7, 2020
@hatoo hatoo requested a review from hecrj January 8, 2020 15:04
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! A bezier curve tool is a better use case for lyon indeed!

I have improved a bit the state transitions in the Bezier widget and made it display some instructions when completely empty.

Let me know what you think and we can merge this!

@hatoo
Copy link
Contributor Author

hatoo commented Jan 11, 2020

Thanks! Codes became more decent.
Please go ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An internal improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A MS paint clone as example
3 participants