Hand a redrawn widget the mask it inherited, not its own
`ActiveData::mask` is the mask a widget's drawing is clipped to, which is either one it set itself or the one it inherited. `redraw` passed it back as the *inherited* mask, so a `Masked` widget settled on its own was handed its own mask and `set_mask` asserted -- a panic on any local redraw of one, for as long as there has been a local-redraw path. The two are separate facts, so `parent_mask` keeps the second. That also states the question `remap_subtree` was asking. It compared a widget's mask with the one threaded down from its parent to find out whether the widget owned it; the comparison is now between the two fields on the widget, which is the same question asked where the answer lives, and the parameter goes. Checked: fmt, clippy, 87 suite tests including the new one, which panics without this; 18 core unit tests; the release oracle at 100 seeds; the fifteen shrinker cases at 400 seeds of depth 5; and `tabs` renders byte-identical at 1920x1200. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32542d0c0b
commit
ea6dbae0dc
3 files changed
+35
-14
No files matched your search
@@ -58,7 +58,14 @@ pub struct ActiveData {
|
||||
pub own_align: RegionAlign,
|
||||
/// The movable region whose coordinates `region` uses.
|
||||
pub parent_move: MoveIdx,
|
||||
/// The mask its drawing is clipped to: one it set itself, or the one it
|
||||
/// inherited from whoever drew it.
|
||||
pub mask: MaskIdx,
|
||||
/// That inherited one. The two differ exactly where the widget set a
|
||||
/// mask of its own, which is the one it owns and the one a move rewrites
|
||||
/// -- and the one a redraw of it must not be handed back, since setting
|
||||
/// a mask asserts there is none.
|
||||
pub parent_mask: MaskIdx,
|
||||
pub layer: LayerId,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user