Say what the recorded outside press is for

The comments and the doc of absorbed_press described a press and its release
sharing a frame, which the one-press rule rules out. They now say the record
is the one point the press landed on, for the layers the pass had when it was
made, and that opening is what ties a layer to it.
This commit is contained in:
skylartaylor committed 2026-11-25 19:44:28 +01:00
1 parent 230b50fa1b
commit 9fc3f4ec2f
2 files changed
+7 -7

No files matched your search

@@ -34,12 +34,11 @@ pub(super) fn dismissal(
if dismiss.anchor_gone && layer.overlay.opener.as_ref().is_some_and(|first| !first.active(ctx, None).0.enabled) {
return Some(CloseReason::AnchorGone);
}
// The input hook recorded the press (and removed a primary one) beside the layers open in that pass; presses inside
// the family and its anchors never get here.
// The input hook recorded the press (and removed a primary one) as the lone point it landed on; the record stands
// for the layers the pass already had, and presses inside the family and its anchors never get here.
if dismiss.outside == Outside::Absorb {
// A layer that appears in this pass was not open when the press was made, so the press is not outside it: a
// secondary press reaches the part below, which opens its own menu in the same pass when a press and its
// release share a frame.
// A layer that appears in this pass opened after the press was made, so the press is not outside it: `opening`
// is what tells it from the layers the record stands for.
if overlay::absorbed_press(ctx).is_some() && !overlay::opening(ctx, layer.id) {
return Some(CloseReason::Outside);
}
+3 -2
View File
@@ -745,8 +745,9 @@ pub(crate) fn absorb_presses(ctx: &Context, input: &mut crate::runtime::egui::in
input.events.len() != before
}
/// The outside press the input hook recorded for the running pass, beside the layers open when it was made. A tracked
/// input (`Input::Press`).
/// The outside press the input hook recorded for the running pass: the lone point it landed on, for the layers the pass
/// showed before it. `opening` is how a layer that appears in the pass tells it is none of those. A tracked input
/// (`Input::Press`).
pub(crate) fn absorbed_press(ctx: &Context) -> Option<Pos2> {
crate::runtime::replay::note_input(ctx, crate::runtime::inputs::Input::Press);
absorbed_press_raw(ctx)