Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion crates/ui-egui/src/scriptcolor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,22 @@ mod tests {
assert!(h.get_by_label("Run").rect().max.y < 700.0);
let first = h.get_by_label_contains("line 0:").rect();
assert!(first.min.y < 700.0, "the first result shows: {first:?}");
assert!(h.get_by_label_contains("Run #1 (").rect().max.y < first.min.y, "the run above them");
let run = h.get_by_label_contains("Run #1 (").rect();
assert!(run.max.y < first.min.y, "the run above them");
// Scrolled down, the results move under the run's line, which stays where it was: it's
// not in their scroll.
h.event(egui::Event::PointerMoved(first.center()));
h.event(egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Point,
delta: egui::vec2(0.0, -100_000.0),
modifiers: egui::Modifiers::NONE,
phase: egui::TouchPhase::Move,
source: egui::MouseWheelSource::Wheel,
});
// egui eases a wheel's scroll over frames, asking for a repaint until it's done.
h.run_steps(60);
assert!(h.get_by_label_contains("line 0:").rect().min.y < first.min.y, "the results scrolled");
assert_eq!(h.get_by_label_contains("Run #1 (").rect(), run, "the run's line didn't move");
}

/// The kept unknown ids follow the script: a change is read again, the same script isn't.
Expand Down
Loading