DIAG: a secondary press's winner in arenas with members, and the canvas host's momentary tool and background phase

This commit is contained in:
aiongg
2026-11-17 04:22:54 +00:00
parent 5c50580db9
commit ad16e443c5
2 changed files with 17 additions and 2 deletions
+9
View File
@@ -507,6 +507,15 @@ impl<'m> ToolHost<'m> {
}
// A momentary tool takes the next press anywhere on the canvas, over the session members on its body.
pointer::withhold_members(&ctx, pass.id, momentary_tool.is_some());
if ctx.input(|i| i.pointer.button_pressed(egui::PointerButton::Secondary) || i.pointer.button_released(egui::PointerButton::Secondary)) {
eprintln!(
"DIAG space_hand_view_menu_keeps_escape_and_enter_from_the_pending_crop: host {:?} momentary {:?} gesture {} background {:?}",
pass.id,
momentary_tool,
state.gesture.is_some(),
pass.press.phase
);
}
// With no gesture and no momentary tool, a held stand-in key makes the stand-in the tool of hover, cursor and
// paint while the selected tool does not take a primary press.
let lent = if state.gesture.is_none() && momentary_tool.is_none() && !takes_primary {
+8 -2
View File
@@ -858,8 +858,14 @@ fn outcome_in(ctx: &Context, read: &PassRead, arena: ArenaId, layer: Layer, enab
// egui gives no click target where a drag-only widget is on top (a resize grip over a layer's or a
// window's edge): a root under it keeps its click there, but a drag is that widget's.
let drag_elsewhere = targets.click.is_none() && targets.drag.is_some_and(|id| !mine(Some(id)));
resolve_press_in(state, members, xf, at, target)
.map(|hit| (hit, if drag_elsewhere { hit.sense.difference(Sense::DRAG) } else { hit.sense }))
let won = resolve_press_in(state, members, xf, at, target);
if !state.previous.is_empty() && ctx.input(|i| i.pointer.button_pressed(egui::PointerButton::Secondary)) {
eprintln!(
"DIAG space_hand_view_menu_keeps_escape_and_enter_from_the_pending_crop: root {root:?} members {members} targets {targets:?} won {:?}",
won.map(|hit| (hit.owner, hit.part))
);
}
won.map(|hit| (hit, if drag_elsewhere { hit.sense.difference(Sense::DRAG) } else { hit.sense }))
});
cancelled = matches!(step.phase, Some(PressPhase::Cancel { .. }));
release_held = machine.release_held();