Take a strong widget to depend on, and use the question mark
`depend_on_size` took a bare `WidgetId`, which any id at all satisfies. It takes a `&StrongWidget` now, so `DrawResult` carries the handle it was drawn from rather than an id copied out of it and nothing can claim a dependency on a widget it does not hold. `UiSpan::outside` matched on a pair of `Option`s where `?` says it. It was written that way while the method was still `const`, and it is not. No call site changed. Checked: fmt, clippy and 35 tests; `tabs`, `view`, `minimal` and `text` render unchanged, and the live sway resize round trip still matches a cold start at each size.
This commit is contained in:
1 parent
53e61289f5
commit
46547563c1
2 files changed
+24
-25
No files matched your search
@@ -279,10 +279,10 @@ impl UiSpan {
|
||||
}
|
||||
|
||||
pub fn outside(&self, parent: &Self) -> Option<Self> {
|
||||
match (self.start.outside(parent), self.end.outside(parent)) {
|
||||
(Some(start), Some(end)) => Some(Self { start, end }),
|
||||
_ => None,
|
||||
}
|
||||
Some(Self {
|
||||
start: self.start.outside(parent)?,
|
||||
end: self.end.outside(parent)?,
|
||||
})
|
||||
}
|
||||
|
||||
pub const fn len(&self) -> UiScalar {
|
||||
|
||||
Reference in new issue
Block a user