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

WidgetId → Id, revise handling of Action and pending ops #413

Merged
merged 16 commits into from
Oct 11, 2023
Merged

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Oct 9, 2023

Rename WidgetIdId (finally!). As noted in kas-gui/design#10 , variations were considered and rejected, so this is mostly just a rename.

Revise pending ops in EventState. Instead of attempting to maintain order of the various ops, they are considered independently in the most appropriate order.

Remove *cx |= action operator; replace EventState::send_action(action) method with EventState::action(id, action) method where id: impl HasId (a new trait supporting both Id and widgets). This allows actions to be applied only to sub-trees.

Action::RECONFIGURE and UPDATE now apply to sub-trees. SET_RECT and RESIZE could be given the same treatment (the latter probably requires significant adjustment to Layout::size_rules giving its SizeCx control over recursion to children). Our current renderer does not support "damage regions" (esp. with regards to transparency and draw order), but if another renderer needed this we would probably want to track a redraw: Option<Id> field in EventState (and would need similar tracking for animations).

Aside: sub-tree operations feel unnecessary considering resizes are 1-2ms and redraws 1-2ms (debug builds). But maybe more constrained systems will benefit. Further aside: a future WGPU version is required to fix resizing: wgpu#4227 appears to fix this for me. Edit: correct render time by omitting frame presentation (wait) time.

@dhardy dhardy marked this pull request as ready for review October 10, 2023 15:43
@dhardy dhardy merged commit 26fe69d into master Oct 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant