aboutsummaryrefslogtreecommitdiff
path: root/src/ui/host
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/host')
-rw-r--r--src/ui/host/WindowHost.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/host/WindowHost.cpp b/src/ui/host/WindowHost.cpp
index 42d0945f..f4a9a928 100644
--- a/src/ui/host/WindowHost.cpp
+++ b/src/ui/host/WindowHost.cpp
@@ -150,10 +150,12 @@ std::unique_ptr<platform::gui::INativeWindow> WindowHost::CreateNativeWindow() {
return std::unique_ptr<INativeWindow>(native_window);
}
-void WindowHost::InvalidatePaint() { layout_paint_cycler_->InvalidatePaint(); }
+void WindowHost::InvalidatePaint() {
+ if (layout_paint_cycler_) layout_paint_cycler_->InvalidatePaint();
+}
void WindowHost::InvalidateLayout() {
- layout_paint_cycler_->InvalidateLayout();
+ if (layout_paint_cycler_) layout_paint_cycler_->InvalidateLayout();
}
bool WindowHost::IsLayoutPreferToFillWindow() const {
@@ -190,8 +192,7 @@ void WindowHost::RelayoutWithSize(const Size& available_size,
for (auto& action : after_layout_stable_action_) action();
after_layout_event_.Raise(AfterLayoutEventArgs{});
after_layout_stable_action_.clear();
- if constexpr (debug_flags::layout)
- CRU_LOG_DEBUG(u"A relayout is finished.");
+ if constexpr (debug_flags::layout) CRU_LOG_DEBUG(u"A relayout is finished.");
}
void WindowHost::Repaint() {