-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add vectorio: for drawing shapes #2873
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
Conversation
vectorio builds on m4 express feather
Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.
VectorShape provides transpose and x/y positioning for shape implementations.
Included Shapes:
* Circle
- A radius; Circle is positioned at its axis in the VectorShape.
- You can freely modify the radius to grow and shrink the circle in-place.
* Polygon
- An ordered list of points.
- Beteween each successive point an edge is inferred. A final edge closing the shape is inferred between the last
point and the first point.
- You can modify the points in a Polygon. The points' coordinate system is relative to (0, 0) so if you'd like a
top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape
x and y properties will position the rectangle relative to its top center point
* Rectangle
A width and a height.
Rather than maintain a transform per-shape, we'll just use whatever settings are on the Display. Currently only transpose is done.
VectorShape now just uses the Group's and Display's absolute transforms.
VectorShape tells the Group to redraw whatever it left behind when it is removed now.
* Fix drawing 1 pixel too large * Need to pad dirty area to ensure removed shapes are fully removed
tannewt
left a comment
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.
A few questions. Lots for my brain to process. Thanks for this! It'll be a huge benefit for folks. Line might be nice to have too.
|
I just wanted to chime in with some words of encouragement. Thanks @WarriorOfWire! I'm excited to see this merged :) |
tannewt
left a comment
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.
Thanks for this! I'll merge after I resolve the translation updates for you.
|
Oops, looks like I don't have permission to change your branch. Here is a PR into your branch: kvc0#1 |
Merge in master
tannewt
left a comment
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.
Looks good!
vectorio builds on m4 express feather
Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.
VectorShape provides transpose and x/y positioning for shape implementations.
Included Shapes:
Circle
Polygon
point and the first point.
top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (-5, 20)] and your VectorShape
x and y properties will position the rectangle relative to its top center point
Rectangle
A width and a height.