-
Notifications
You must be signed in to change notification settings - Fork 501
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
PicoVector 2 text word wrap and transform #1027
PicoVector 2 text word wrap and transform #1027
Conversation
Add preliminary support for multiple layered drawing surfaces. Allows, for example, static content to be loaded into one layer and remain unmodified while the above layer contains animations. Particularly useful for drawing PNG or JPEG UI elements which are then overdrawn with text or animated elements, without paying the cost of loading/decoding every frame.
Ignore sign compare and narrowing conversion errors in pretty-poly.h.
Pointers were being incremented as if they were bytes, rather than larger containers.
pretty-poly.h is not giving us fully clipped rectangles, so revert to the slower bounds checked pixel for now.
* Remove Polygon types in favour of primitives .circle, .rectangle etc * Add a new Transform type for building up transformation matrices * Add support to set/clear transform on drawing
Drop dependence on null terminated strings, and for a final linebreak. Bound all text processing using the text length.
For both APA102 and WS2812 the pins used on the same PIO must be in the same range. The GPIO base offset applies to the whole PIO and not individual state machines. This means that for APA102 both data and clock must be in the same pin range, ie: either 16-48 inclusive or 0-31 inclusive.
@@ -51,7 +51,7 @@ int main() { | |||
pp_mat3_translate(&pos, 50, 50); | |||
pp_mat3_rotate(&pos, a); | |||
vector.draw(poly); | |||
vector.text("Hello World", &pos); | |||
vector.text("Hello World", 0, 0, &pos); |
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.
Alternatively could make these optional arguments if you prefer - I had kind of forgotten that this was also exposed to C++.
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 think it would be good to make these optional, since it also bubbles up to Python. C isn't super helpful about that, though. I wonder if it makes sense to have them part of the text metrics, or if that's just too conceptually weird.
Sensible API design for this has been quite tricky!
//pp_mat3_t t = pp_mat3_identity(); | ||
//vector.text("Hello World", {0, 0}, &t); | ||
pp_mat3_t t = pp_mat3_identity(); | ||
vector.text("Hello World", 0, 0, &t); |
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.
Possibly uncommenting this was unwise as I don't have one of these to test. I got confused between this and the new RP2350 based explorer 😆
633d387
to
f4409d8
Compare
01d8aa7
to
762c5cb
Compare
Okay I think I merged this into #1019 and forgot. Closing for now and we can deal with any warts as they pop up. |
A couple of improvements to the PicoVector 2 text support: