Pass a MutableAppContext to Element::layout and ::dispatch_event

We need to mutate the app in these cases to relay layout state, so this just makes things easier. We won't be able to perform layout in parallel but it's questionable whether we'll ever actually do that. If we do, we can revisit.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-07-23 10:52:08 -06:00
co-authored by Antonio Scandurra Max Brunsfeld
parent 61f45800d3
commit 11285f3762
7 changed files with 75 additions and 44 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ pub use uniform_list::*;
use crate::{
geometry::{rect::RectF, vector::Vector2F},
json, AfterLayoutContext, AppContext, DebugContext, Event, EventContext, LayoutContext,
PaintContext, SizeConstraint,
json, AfterLayoutContext, DebugContext, Event, EventContext, LayoutContext, PaintContext,
SizeConstraint,
};
use core::panic;
use json::ToJson;