Skip to content

Commit 1f4c2b0

Browse files
authored
Fix pointer capture code, and add check to catch errors earlier. (#1074)
1 parent 02c4735 commit 1f4c2b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

masonry_core/src/passes/event.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ fn get_pointer_target(
2222
) -> Option<WidgetId> {
2323
// See the [pointer capture documentation](../doc/06_masonry_concepts.md#pointer-capture).
2424
if let Some(capture_target) = root.global_state.pointer_capture_target {
25-
return Some(capture_target);
25+
if root.widget_arena.has(capture_target) {
26+
return Some(capture_target);
27+
}
2628
}
2729

2830
if let Some(pointer_pos) = pointer_pos {

0 commit comments

Comments
 (0)