M3: the full-screen field click test waits until page 1 is shown

Full screen veils a page until its raster is in, and a click on a veiled
page turns it. The test clicked after six frames; on a slow CI runner the
raster wasn't in yet, so the click on the field turned the page. It now
waits (up to 600 frames) until DocView::presentation_settled says the page
is wholly in view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
This commit is contained in:
mtlcl410andClaude Opus 5.5 committed 2026-11-05 06:25:12 +08:00
1 parent c565834873
commit 97174c91eb
2 files changed
+15

No files matched your search

+6
View File
@@ -6,6 +6,12 @@ impl DocView {
self.screen_xforms.iter().find(|(p, _)| *p == page).map(|(_, xf)| xf.rect)
}
/// Whether the page full screen shows is wholly in view: no transition playing or waiting for
/// its raster, so a click on it reaches what is on it. Always true outside full screen.
pub fn presentation_settled(&self) -> bool {
self.presentation.is_none() || self.presenter.settled_on(self.current)
}
/// The document area on screen.
pub fn viewport_rect(&self) -> Rect {
self.viewport_screen
+9
View File
@@ -2761,6 +2761,15 @@ fn full_screen_click_on_a_field_fills_it_and_turns_no_page() {
h.key_press_modifiers(Modifiers::COMMAND, Key::L);
h.run_steps(6);
let n = h.state().views.len() - 1;
// Until page 1's raster is in, full screen veils it and a click turns the page; on a slow
// machine that takes more frames than the six above.
for _ in 0..600 {
if h.state().views[n].presentation_settled() {
break;
}
h.run_steps(1);
}
assert!(h.state().views[n].presentation_settled(), "page 1 is shown");
let r = h.state().views[n].page_screen_rect(0).expect("page 1 on screen");
let on_field = egui::pos2(r.left() + r.width() * 0.5, r.top() + r.height() * (400.0 - 120.0) / 400.0);
click_with(&mut h, on_field, Modifiers::NONE);