1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Add some helper functions to Response

This commit is contained in:
Emil Ernerfeldt
2021-03-06 10:48:39 +01:00
parent fb2db4940e
commit 9c8439d053
9 changed files with 67 additions and 40 deletions

View File

@@ -255,8 +255,12 @@ impl super::View for InputTest {
if response.double_clicked_by(button) {
new_info += &format!("Double-clicked by {:?}\n", button);
}
if response.dragged() && ui.input().pointer.button_down(button) {
new_info += &format!("Dragged by {:?}\n", button);
if response.dragged_by(button) {
new_info += &format!(
"Dragged by {:?}, delta: {:?}\n",
button,
response.drag_delta()
);
}
}
if !new_info.is_empty() {