Skip to content

Commit a09d2bd

Browse files
committed
Address code review
1 parent 8324523 commit a09d2bd

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

masonry/src/doc/05_pass_system.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ It is called when new widgets are added to the tree, or existing widgets are rem
106106

107107
It will call the `register_children()` widget method on container widgets whose children changed, then the `update()` method with the `WidgetAdded` event on new widgets.
108108

109-
<!-- TODO - document UPDATE DISABLED --- -->
110-
<!-- TODO - document UPDATE STASHED --- -->
111-
<!-- TODO - document UPDATE FOCUS CHAIN --- -->
112-
<!-- TODO - document UPDATE FOCUS --- (document iteration order) -->
113-
<!-- TODO - document UPDATE SCROLL --- -->
114-
<!-- TODO - document UPDATE POINTER --- (document iteration order) -->
109+
<!-- TODO - document update disabled --- -->
110+
<!-- TODO - document update stashed --- -->
111+
<!-- TODO - document update focus chain --- -->
112+
<!-- TODO - document update focus --- (document iteration order) -->
113+
<!-- TODO - document update scroll --- -->
114+
<!-- TODO - document update pointer --- (document iteration order) -->
115115

116116
### Layout pass
117117

masonry/src/event.rs

+19-16
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,6 @@ pub enum Update {
312312
}
313313

314314
impl PointerEvent {
315-
/// Create a [`PointerEvent::PointerLeave`] event with dummy values.
316-
pub fn new_pointer_leave() -> Self {
317-
// TODO - The fact we're creating so many dummy values might be
318-
// a sign we should refactor that struct
319-
let pointer_state = PointerState {
320-
physical_position: Default::default(),
321-
position: Default::default(),
322-
buttons: Default::default(),
323-
mods: Default::default(),
324-
count: 0,
325-
focus: false,
326-
force: None,
327-
};
328-
Self::PointerLeave(pointer_state)
329-
}
330-
331315
/// Returns the [`PointerState`] of the event.
332316
pub fn pointer_state(&self) -> &PointerState {
333317
match self {
@@ -388,6 +372,25 @@ impl PointerEvent {
388372
Self::Pinch(_, _) => true,
389373
}
390374
}
375+
376+
/// Create a [`PointerEvent::PointerLeave`] event with dummy values.
377+
///
378+
/// This is used internally to create synthetic `PointerLeave` events when pointer
379+
/// capture is lost.
380+
pub fn new_pointer_leave() -> Self {
381+
// TODO - The fact we're creating so many dummy values might be
382+
// a sign we should refactor that struct
383+
let pointer_state = PointerState {
384+
physical_position: Default::default(),
385+
position: Default::default(),
386+
buttons: Default::default(),
387+
mods: Default::default(),
388+
count: 0,
389+
focus: false,
390+
force: None,
391+
};
392+
Self::PointerLeave(pointer_state)
393+
}
391394
}
392395

393396
impl TextEvent {

0 commit comments

Comments
 (0)