diff options
author | crupest <crupest@outlook.com> | 2018-10-06 23:10:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-10-06 23:10:32 +0800 |
commit | beb6cfa6b3492f5a9d89ba99c03358c22598e7aa (patch) | |
tree | 5a32e5ab38f9c1273640cce62912f58bdeca5d8e | |
parent | 7e870dd16e2f5b41fa6c6f687723aaa50c16274d (diff) | |
download | cru-beb6cfa6b3492f5a9d89ba99c03358c22598e7aa.tar.gz cru-beb6cfa6b3492f5a9d89ba99c03358c22598e7aa.tar.bz2 cru-beb6cfa6b3492f5a9d89ba99c03358c22598e7aa.zip |
Fix all Relayout to InvalidateLayout.
-rw-r--r-- | src/ui/control.cpp | 1 | ||||
-rw-r--r-- | src/ui/controls/text_control.cpp | 3 | ||||
-rw-r--r-- | src/ui/window.cpp | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp index 4acdd8f1..a75cab37 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -394,7 +394,6 @@ namespace cru { if (GetWindow()->GetDebugDrawControlBorder()) { auto brush = Application::GetInstance()->GetDebugBorderBrush(); - const auto size = GetSize(); device_context->DrawRectangle(Convert(GetRect(RectRange::Margin)), brush.Get()); } #endif diff --git a/src/ui/controls/text_control.cpp b/src/ui/controls/text_control.cpp index da0113f3..ee5b253d 100644 --- a/src/ui/controls/text_control.cpp +++ b/src/ui/controls/text_control.cpp @@ -229,8 +229,7 @@ namespace cru::ui::controls void TextControl::OnTextChangedCore(const String& old_text, const String& new_text) { RecreateTextLayout(); - if (const auto window = GetWindow()) - window->Relayout(); + InvalidateLayout(); Repaint(); } diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 9edbd398..2bebd7d4 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -501,7 +501,7 @@ namespace cru void Window::OnResizeInternal(const int new_width, const int new_height) { render_target_->ResizeBuffer(new_width, new_height); if (!(new_width == 0 && new_height == 0)) - Relayout(); + InvalidateLayout(); } void Window::OnSetFocusInternal() |