iris: a scroll area whose content grew asks to be drawn again
Iris's phone: typing newlines into the composer with the keyboard up dropped the caret flush against the bar's bottom edge, eating the 12dp padding, and closing the keyboard fixed it. `Scroll::draw` offers its child last frame's content length on purpose, so an ordinary scroll tick is an O(1) move rather than a redraw. The comment claimed the lag self-corrects on the next frame; nothing asked for that frame. A keystroke dirties the field, that frame draws it in a box one line short of its text, and the tree is clean afterwards -- so the stale placement is the last one drawn. The composer's text is centred in its box, so one line short hung half a line past each end and put the caret's line box a whole padding low. Closing the keyboard rewrote the bar's inset, dirtied it, and forced the missing redraw. `Scroll::draw` now calls `Painter::draw_again` when what it measured differs from what it offered, and a frame that leaves anything dirty asks for another frame on both backends -- `draw_again` sets its mark during the update, after the input path's own check has run, so nothing asked before this (which applied to `List::clamp_to_content` too). Verified at layer 1 (the new test fails on the old code with the caret exactly on the bar's edge) and on the emulator: the caret's bottom moved from 1535 -- the bar's own bottom edge -- to 1509, 26px inside a 31px padding, the remainder being parley's line box overhanging its line height. `phone.rs` grew `--typed TEXT`, which enters text over frames rather than preloading it; only that reproduces this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a9655414e
commit
ba57086361
10 files changed
+229
-9
No files matched your search
@@ -5,6 +5,21 @@ they can be judged and reversed later. Detail lives in RUST.md (and IRIS.md
|
||||
for iris API changes); this file is only the summary. Newest first. Items
|
||||
marked **DEFERRED** are ones the agent chose not to decide alone.
|
||||
|
||||
## 2026-09-08 (later: a scroll area that grew redraws once)
|
||||
|
||||
From Iris's phone report about the composer's padding while typing
|
||||
newlines. IRIS.md's entry has the account.
|
||||
|
||||
- **A `Scroll` whose measured content length differs from the length it
|
||||
offered its child asks for one more draw** (`Painter::draw_again`),
|
||||
rather than the stale box being the last one drawn. Pays one extra
|
||||
draw of the scroll's subtree when the content's length changes --
|
||||
including its first frame, where the offered length is a placeholder --
|
||||
and nothing on an ordinary scroll tick.
|
||||
- **A frame that leaves any widget dirty now requests another frame** on
|
||||
both backends. Previously only an animation did, so any use of
|
||||
`draw_again` depended on some later input to deliver its correction.
|
||||
|
||||
## 2026-09-08 (every crate to its latest version, wgpu 28 -> 30)
|
||||
|
||||
At Iris's request. RUST.md's "Every crate to its latest version" box has
|
||||
|
||||
Reference in new issue
Block a user