@@ -1,4 +1,4 @@
1−// Each component declares it's own size constraints and gets fitted based on it's parent.
1+// Each component declares its own size constraints and gets fitted based on its parent.
22// Q: how does this work with popups?
33// cursive does compositor.screen_mut().add_layer_at(pos::absolute(x, y), <component>)
44use helix_core::Position;
@@ -97,6 +97,7 @@ impl Compositor {
9797 self.area = area;
9898 }
9999
100+ /// Add a layer to be rendered in front of all existing layers.
100101 pub fn push(&mut self, mut layer: Box<dyn Component>) {
101102 let size = self.size();
102103 // trigger required_size on init
@@ -136,7 +137,8 @@ impl Compositor {
136137 let mut consumed = false;
137138
138139 // propagate events through the layers until we either find a layer that consumes it or we
139− // run out of layers (event bubbling)
140+ // run out of layers (event bubbling), starting at the front layer and then moving to the
141+ // background.
140142 for layer in self.layers.iter_mut().rev() {
141143 match layer.handle_event(event, cx) {
142144 EventResult::Consumed(Some(callback)) => {