mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 19:41:36 -05:00
Tests: read the coalesced release and press from the frame that took them
review_596866_owned_up_then_new_down_in_one_frame_keeps_the_next_click_single checked the release and press edges in the step's last frame. The press's Down comes in a second pass of the same frame only when another part of the UI asks for a rerun; otherwise it comes in the next frame, whose first pass has no events. Keying the Image Trace sliders on the selection moves the status bar's rerun to an earlier step, so the Down came in a second frame and the precondition failed while every behavior assertion still held. The edges are now read with frame_event, which looks at the first pass of each frame in the step.
This commit is contained in:
@@ -1155,7 +1155,9 @@ fn review_596866_owned_release_then_press(coalesced: bool) {
|
||||
let history = (app.session.active().unwrap().history.undo.len(), app.session.active().unwrap().history.redo.len());
|
||||
if coalesced {
|
||||
frame_at(&mut app, &ctx, start + step, vec![review_596866_button(at, false), review_596866_button(at, true)]);
|
||||
assert!(frame_input(&ctx, |i| i.pointer.primary_released() && i.pointer.primary_pressed() && i.pointer.primary_down()));
|
||||
// The press's Down comes in a second pass of this frame when another part of the UI asks for a rerun, and in the
|
||||
// next frame otherwise. The coalesced release and press are read from the frame whose first pass took them.
|
||||
assert!(frame_event(&ctx, |i| i.pointer.primary_released() && i.pointer.primary_pressed() && i.pointer.primary_down()));
|
||||
} else {
|
||||
review_gesture_release(&mut app, &ctx, at, start + step);
|
||||
assert_eq!(app.session.active().unwrap().selection.objects, Vec::<NodeId>::new(), "CONTROL: the owned Up remains consumed");
|
||||
|
||||
Reference in New Issue
Block a user