diff options
author | crupest <crupest@outlook.com> | 2022-02-09 22:29:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-09 22:29:17 +0800 |
commit | e18c4fb46d7913f337cc25b9a6e3a25359c3f10a (patch) | |
tree | ca0d2ba0477af904c2b3ccc0f1b4ea5d3c101dc0 /src/ui/host/WindowHost.cpp | |
parent | 1cbbad7166ca3dad08f947aeea5d7efc197bd2f3 (diff) | |
download | cru-e18c4fb46d7913f337cc25b9a6e3a25359c3f10a.tar.gz cru-e18c4fb46d7913f337cc25b9a6e3a25359c3f10a.tar.bz2 cru-e18c4fb46d7913f337cc25b9a6e3a25359c3f10a.zip |
...
Diffstat (limited to 'src/ui/host/WindowHost.cpp')
-rw-r--r-- | src/ui/host/WindowHost.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ui/host/WindowHost.cpp b/src/ui/host/WindowHost.cpp index 4373afe9..9773c117 100644 --- a/src/ui/host/WindowHost.cpp +++ b/src/ui/host/WindowHost.cpp @@ -111,7 +111,6 @@ WindowHost::WindowHost(controls::Control* root_control) }); root_render_object_ = root_control->GetRenderObject(); - root_render_object_->SetWindowHostRecursive(this); this->layout_paint_cycler_ = std::make_unique<LayoutPaintCycler>(this); @@ -187,16 +186,12 @@ void WindowHost::RelayoutWithSize(const Size& available_size, render::MeasureSize::NotSpecified()); if (set_window_size_to_fit_content) { - native_window_->SetClientSize(root_render_object_->GetSize()); + native_window_->SetClientSize(root_render_object_->GetDesiredSize()); } root_render_object_->Layout(Point{}); for (auto& action : after_layout_stable_action_) action(); after_layout_event_.Raise(AfterLayoutEventArgs{}); - root_render_object_->TraverseDescendants( - [](render::RenderObject* render_object) { - render_object->OnAfterLayout(); - }); after_layout_stable_action_.clear(); if constexpr (debug_flags::layout) log::TagDebug(log_tag, u"A relayout is finished."); |