Remove at from mouse instructions in Ice syntax

This commit is contained in:
Héctor Ramón Jiménez 2025-09-20 17:33:57 +02:00
parent 364b68f030
commit 79d501f9a5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 89 additions and 52 deletions

View file

@ -502,7 +502,7 @@ impl<P: Program + 'static> Tester<P> {
let instruction::Interaction::Mouse(
instruction::Mouse::Click {
button: mouse::Button::Left,
at: Some(instruction::Target::Text(text)),
target: Some(instruction::Target::Text(text)),
},
) = interaction
else {

View file

@ -415,17 +415,26 @@ fn record<Message>(
};
let Interaction::Mouse(
Mouse::Move(at)
| Mouse::Press { at: Some(at), .. }
| Mouse::Release { at: Some(at), .. }
| Mouse::Click { at: Some(at), .. },
Mouse::Move(target)
| Mouse::Press {
target: Some(target),
..
}
| Mouse::Release {
target: Some(target),
..
}
| Mouse::Click {
target: Some(target),
..
},
) = &mut interaction
else {
shell.publish(on_record(interaction));
return;
};
let Target::Point(position) = *at else {
let Target::Point(position) = *target else {
shell.publish(on_record(interaction));
return;
};
@ -433,7 +442,7 @@ fn record<Message>(
if let Some((content, visible_bounds)) =
find_text(position + (bounds.position() - Point::ORIGIN), operate)
{
*at = Target::Text(content);
*target = Target::Text(content);
*last_hovered = visible_bounds;
} else {
*last_hovered = None;