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

v1.4/2.0: Widged redraw(self) method signature changes to redraw(self, x, y) #59

Open
pfalcon opened this issue Apr 24, 2021 · 0 comments

Comments

@pfalcon
Copy link
Owner

pfalcon commented Apr 24, 2021

What: Widget.redraw(self) (and all subclasses) change to Widget.redraw(self, x, y). Widgets are now expected to store coordinates relative to their parents (instead of absolute screen coordinates). Parents pass their (absolute) coordinates as arguments to children' .redraw(x, y) methods. Children add these coordinate arguments to their own (relative) coordinates for drawing.

Why: Originally, picotui was intended to be as efficient and simple as possible. That's why coordinates were calculated just once and used as is. Any geometry management was considered out of scope of the library. While that remains true, there's a desire to make some simple/common scenarios easier. E.g., when screen is resized, a user may want to keep a dialog box centered on it. Currently, that requires going over all child widgets of a dialog and recalculating their (absolute) coordinates. While definitely possible, and how it was intended to be done originally, after additional experience and feedback, and I'd like to simplify that so only coordinates of the dialog itself need to be updated.

When: feedback is welcome whether this change should be dubbed 1.3 (or 1.4) or 2.0.

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

No branches or pull requests

1 participant