mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-19 00:16:36 +00:00
cargo fmt
This commit is contained in:
@@ -1205,7 +1205,8 @@ pub(crate) fn begin(ctx: &Context) {
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
let Some(hit) = keys.press(&shortcuts.layout, &shortcut.input, shortcuts.typing && !shortcut.canvas, Some((&mut matcher, time))) else {
|
||||
let Some(hit) = keys.press(&shortcuts.layout, &shortcut.input, shortcuts.typing && !shortcut.canvas, Some((&mut matcher, time)))
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
let (app, instance) = with(ctx, |board| board.target_of(ctx, &hit.command, &board.here));
|
||||
|
||||
@@ -300,7 +300,13 @@ impl Strip<'_> {
|
||||
PressUse::Press => {
|
||||
batch.presses.push(Press { key, mods, repeat, in_egui: None, release: None, text: None, canvas: false });
|
||||
if !repeat {
|
||||
batch.shortcuts.push(Shortcut { input: *input, phase: FirePhase::Press, press: Some(batch.presses.len() - 1), canvas: false, at });
|
||||
batch.shortcuts.push(Shortcut {
|
||||
input: *input,
|
||||
phase: FirePhase::Press,
|
||||
press: Some(batch.presses.len() - 1),
|
||||
canvas: false,
|
||||
at,
|
||||
});
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@ fn a_keys_press_and_release_fire_with_the_times_they_arrived_at() {
|
||||
let mut frames = Frames::new();
|
||||
frames.commands(catalog(1));
|
||||
frames.idle(3, &mut show);
|
||||
let times = |frames: &Frames| take_output(&frames.ctx).fired.into_iter().map(|fired| (fired.command.id, fired.phase, fired.time)).collect::<Vec<_>>();
|
||||
let times =
|
||||
|frames: &Frames| take_output(&frames.ctx).fired.into_iter().map(|fired| (fired.command.id, fired.phase, fired.time)).collect::<Vec<_>>();
|
||||
let now = |frames: &Frames| frames.ctx.input(|input| input.time);
|
||||
frames.frame(vec![key_press(Key::J, Modifiers::NONE)], &mut show);
|
||||
let pressed = now(&frames);
|
||||
|
||||
Reference in New Issue
Block a user