Simplify event loop start-up

Move the layout constraint tracker into the window where we can apply
the constraints right before drawing, instead of doing that from within
the event loop. This allows to remove the component parameter from the
run function.
This commit is contained in:
Simon Hausmann 2020-11-12 11:14:04 +01:00
parent f8e5982ab4
commit c258a907f0
8 changed files with 57 additions and 66 deletions

View file

@ -84,9 +84,7 @@ public:
template<typename Component>
void run(const Component *c) const
{
auto self_rc = c->self_weak.lock().value();
sixtyfps_component_window_run(&inner,
reinterpret_cast<cbindgen_private::ComponentRc *>(&self_rc));
sixtyfps_component_window_run(&inner);
}
float scale_factor() const { return sixtyfps_component_window_get_scale_factor(&inner); }