Say what may be done to a drawing, and default to nothing

`SizeDependence::{None, Internal, External}` becomes
`OnResize::{Scale, Translate, Redraw}`, which says what the retained path
may do rather than leaving the reader to work it out from a dependency.

`Redraw` is now the default, and that is the substance of this rather
than the naming. `Translate` was, and nothing opted into it: `SetSize`
reports one size and hands its child the whole box, so its pixels change
with the box and carrying them stretched a 100x100 rect across half the
window. A default that is only right for widgets that happen to qualify
is the same fault as an unchecked reuse flag.

`Translate` still does nothing, and now for the reason rather than the
one I gave before: `mov` translates perfectly well, but `ActiveData`'s
`region` is both the box a widget was given and the box its primitives
occupy, and `mov` remaps out of it. Keeping a drawing at its old size
while the box grows leaves those two disagreeing, and the next move
stretches it. Separating them is what the offset chain does.

Caught by rendering `tabs` against `main` rather than by a test, which is
the argument for keeping that check in the loop.
This commit is contained in:
iris committed 2026-09-13 23:47:12 -04:00
1 parent ec012c4552
commit b108645240
8 files changed
+63 -53

No files matched your search

+2 -2
View File
@@ -15,8 +15,8 @@ impl Widget for Image {
Some(Len::abs(self.handle.size().axis(axis)))
}
fn size_dependence(&self, _: Axis) -> SizeDependence {
SizeDependence::None
fn on_resize(&self, _: Axis) -> OnResize {
OnResize::Scale
}
}