Skip to main content

Module outside_paint

Module outside_paint 

Expand description

Whether a drawing read state outside the widgets that made it.

A widget is clean until something it reads changes, and most widgets say so themselves: they hold what they paint, and their setters and event routes mark them dirty. A few read what stands outside themselves instead — live state another part of the app owns — and paint whatever it holds at the time. Nothing in the tree can see that reading, so their paint is stale as soon as anything reaches the tree (crate::input_generation).

Such a widget says so while it draws, with note. A flow that records a cache brackets the drawing of it with begin and end and keeps what the brace says: a cache whose drawing read outside state is reused only while no input has reached the tree since, because its paint stands on readings no flag reports. Everything else keeps its cache across input, which is what lets a scroll frame copy what it keeps on screen.

Functions§

begin
Start recording a drawing: answers whether an enclosing brace had already seen such a reading, and clears the mark for this one.
end
Finish recording a drawing that begin started: answers whether it, or anything it drew, read outside state, and leaves the enclosing brace with what it had plus this drawing’s reading.
forget_on_screen
The next frame’s drawing has begun: nothing stands on screen yet.
note
This drawing read state that lives outside the widgets that paint it.
on_screen
Whether the frame on screen stands on a reading from outside the tree, and so is stale as soon as input reaches it (crate::input_generation). A host reads this when it records the frame it drew, then forget_on_screen: frames that draw such a part note it again.