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.
Rename
WidgetId
→Id
(finally!). As noted in https://github.com/kas-gui/design/pull/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; replaceEventState::send_action(action)
method withEventState::action(id, action)
method whereid: impl HasId
(a new trait supporting bothId
and widgets). This allows actions to be applied only to sub-trees.Action::RECONFIGURE
andUPDATE
now apply to sub-trees.SET_RECT
andRESIZE
could be given the same treatment (the latter probably requires significant adjustment toLayout::size_rules
giving itsSizeCx
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 aredraw: Option<Id>
field inEventState
(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.