Lift Send and Sync restriction for measurements

This commit is contained in:
Antonio Scandurra 2023-11-30 16:03:22 +01:00
parent 74a5ae5633
commit d9b8c07b1e
4 changed files with 23 additions and 20 deletions

View file

@ -618,13 +618,13 @@ impl<'a> WindowContext<'a> {
/// The given closure is invoked at layout time with the known dimensions and available space and
/// returns a `Size`.
pub fn request_measured_layout<
F: Fn(Size<Option<Pixels>>, Size<AvailableSpace>) -> Size<Pixels> + Send + Sync + 'static,
F: FnMut(Size<Option<Pixels>>, Size<AvailableSpace>) -> Size<Pixels> + 'static,
>(
&mut self,
style: Style,
rem_size: Pixels,
measure: F,
) -> LayoutId {
let rem_size = self.rem_size();
self.window
.layout_engine
.request_measured_layout(style, rem_size, measure)