-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't hover things in 2D/3D views if we are dragging something (#1643)
Closes #1185 …and unlike previous attempts, click-to-select still works
- Loading branch information
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// Is anything in egui being dragged? | ||
pub fn is_anything_being_dragged(egui_ctx: &egui::Context) -> bool { | ||
// As soon as a button is down, egui considers it a drag. | ||
// That is, even a click is considered a drag until it is over. | ||
// So we need some special treatment here. | ||
// TODO(emilk): make it easier to distinguish between clicks and drags in egui. | ||
|
||
// copied from egui | ||
/// If the pointer is down for longer than this, it won't become a click (but it is still a drag) | ||
const MAX_CLICK_DURATION: f64 = 0.6; | ||
egui_ctx.input(|i| { | ||
if let Some(press_start_time) = i.pointer.press_start_time() { | ||
let held_time = i.time - press_start_time; | ||
held_time > MAX_CLICK_DURATION || i.pointer.is_moving() | ||
} else { | ||
false | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e41c992
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust Benchmark
datastore/insert/batch/rects/insert
567032
ns/iter (± 2132
)604695
ns/iter (± 28512
)0.94
datastore/latest_at/batch/rects/query
1878
ns/iter (± 7
)1878
ns/iter (± 4
)1
datastore/latest_at/missing_components/primary
289
ns/iter (± 0
)288
ns/iter (± 0
)1.00
datastore/latest_at/missing_components/secondaries
453
ns/iter (± 1
)437
ns/iter (± 0
)1.04
datastore/range/batch/rects/query
152399
ns/iter (± 3626
)154046
ns/iter (± 560
)0.99
mono_points_arrow/generate_message_bundles
52431201
ns/iter (± 955845
)52622948
ns/iter (± 635994
)1.00
mono_points_arrow/generate_messages
138743535
ns/iter (± 1548405
)142193374
ns/iter (± 1431202
)0.98
mono_points_arrow/encode_log_msg
168988744
ns/iter (± 1446608
)168932722
ns/iter (± 918965
)1.00
mono_points_arrow/encode_total
360228253
ns/iter (± 2731572
)367815123
ns/iter (± 1740258
)0.98
mono_points_arrow/decode_log_msg
188480827
ns/iter (± 1298792
)191834169
ns/iter (± 920580
)0.98
mono_points_arrow/decode_message_bundles
75098716
ns/iter (± 1161500
)77293822
ns/iter (± 1052807
)0.97
mono_points_arrow/decode_total
259902877
ns/iter (± 2159808
)266428918
ns/iter (± 1880498
)0.98
batch_points_arrow/generate_message_bundles
330491
ns/iter (± 2007
)329089
ns/iter (± 495
)1.00
batch_points_arrow/generate_messages
6461
ns/iter (± 24
)6438
ns/iter (± 20
)1.00
batch_points_arrow/encode_log_msg
363437
ns/iter (± 2385
)403928
ns/iter (± 1533
)0.90
batch_points_arrow/encode_total
723156
ns/iter (± 3802
)750170
ns/iter (± 17411
)0.96
batch_points_arrow/decode_log_msg
351967
ns/iter (± 1628
)383163
ns/iter (± 1462
)0.92
batch_points_arrow/decode_message_bundles
2052
ns/iter (± 17
)2071
ns/iter (± 19
)0.99
batch_points_arrow/decode_total
359396
ns/iter (± 1326
)385467
ns/iter (± 1141
)0.93
arrow_mono_points/insert
6844149075
ns/iter (± 26387572
)7255726121
ns/iter (± 30054667
)0.94
arrow_mono_points/query
1813257
ns/iter (± 26005
)1892324
ns/iter (± 24367
)0.96
arrow_batch_points/insert
2661932
ns/iter (± 48054
)2822287
ns/iter (± 12027
)0.94
arrow_batch_points/query
16238
ns/iter (± 52
)16121
ns/iter (± 15
)1.01
arrow_batch_vecs/insert
42313
ns/iter (± 114
)45982
ns/iter (± 121
)0.92
arrow_batch_vecs/query
388505
ns/iter (± 1979
)408594
ns/iter (± 1494
)0.95
tuid/Tuid::random
34
ns/iter (± 0
)34
ns/iter (± 0
)1
This comment was automatically generated by workflow using github-action-benchmark.