From 5c3dae62b9218dbd2493ff6390db062013ca4bdc Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 29 Jun 2020 00:31:21 +0800 Subject: ... --- src/ui/UiHost.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ui/UiHost.cpp') diff --git a/src/ui/UiHost.cpp b/src/ui/UiHost.cpp index 9bde06ad..975d0ffe 100644 --- a/src/ui/UiHost.cpp +++ b/src/ui/UiHost.cpp @@ -146,14 +146,13 @@ void UiHost::InvalidatePaint() { } void UiHost::InvalidateLayout() { + log::TagDebug(log_tag, "A relayout is requested."); if (!need_layout_) { platform::native::IUiApplication::GetInstance()->InvokeLater( [resolver = this->CreateResolver()] { if (const auto host = resolver.Resolve()) { host->Relayout(); host->need_layout_ = false; - host->after_layout_event_.Raise(AfterLayoutEventArgs{}); - log::Debug("A relayout finished."); host->InvalidatePaint(); } }); @@ -171,6 +170,8 @@ void UiHost::Relayout() { render::MeasureSize::NotSpecified()}, render::MeasureSize::NotSpecified()); root_render_object_->Layout(Point{}); + after_layout_event_.Raise(AfterLayoutEventArgs{}); + log::TagDebug(log_tag, "A relayout is finished."); } bool UiHost::RequestFocusFor(Control* control) { -- cgit v1.2.3