1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! **A scroll the keyboard asked of the transcript** (DESIGN §4.46 item 3):
//! PageDown and PageUp a page, Ctrl+End and Ctrl+Home the ends — from the
//! box too, because the box has no cursor move for any of them.
//!
//! The ask is a view fact held where view facts are, the toolkit's own
//! memory (the dock's fold keeps its state the same way): the key handler
//! runs before any panel paints and the scroll area that owns the offset
//! paints later, so the request crosses the frame in the one store both
//! can reach, and is taken the frame it is applied. Nothing on the model
//! says where the transcript is scrolled to — the scroll area holds that —
//! and what it is scrolled to is written back out for one reader, the
//! suite ([`offset`]).
use Id;
/// What was asked.
/// Where the ask waits for the frame.
const ASKED: &str = "the transcript's scroll request";
/// Where the transcript writes how far down it stands, in points.
const OFFSET: &str = "the transcript's scroll offset";
/// **Farther than any transcript is tall**: an end is a delta the area
/// clamps, which is how egui's own scroll-to-end is spelled.
const WHOLE: f32 = 1.0e9;
/// **Ask for `scroll`** on the next frame the transcript paints.
/// **Whether an ask waits**, read by the scroll area as it is built: the
/// area sticks to its end every frame it is asked to, and egui's own wheel
/// unsticks it while a delta handed in from outside does not — so the frame
/// that spends an ask is built unstuck, and the area re-sticks itself the
/// moment the offset meets the end again, exactly as a wheel's does.
/// **Spend the ask**, inside the transcript's scroll area: a page is the
/// height the area shows, an end is the whole, and the delta's sign is the
/// wheel's — a page on is the content moving up.
/// **Note how far down the transcript stands**, for [`offset`].
/// **How far down the transcript stood on the last frame it painted**, in
/// points, or nothing where none has.