-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add MS paint example #144
Conversation
hah, awesome |
There was a problem hiding this 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
}, | ||
), | ||
) | ||
.unwrap(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this 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!
Thanks! Codes became more decent. |
Since #140 has landed,
I realized that we can make MS paint like example by using lyon now.
This PR resolves #18