From 5f7d3268e3d2ea84a1afc97c209b703bf4092c76 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 20 Sep 2018 22:50:37 +0800 Subject: Improve linear layout. --- CruUI/ui/control.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'CruUI/ui/control.cpp') diff --git a/CruUI/ui/control.cpp b/CruUI/ui/control.cpp index 4d69100d..0b19c20b 100644 --- a/CruUI/ui/control.cpp +++ b/CruUI/ui/control.cpp @@ -22,12 +22,12 @@ namespace cru { size_(), position_cache_(), is_mouse_inside_(false), - is_mouse_leave_{ + is_mouse_leave_ + { { MouseButton::Left, true }, { MouseButton::Middle, true }, { MouseButton::Right, true } }, - layout_params_(new BasicLayoutParams()), desired_size_() { @@ -322,9 +322,12 @@ namespace cru { void Control::OnDraw(ID2D1DeviceContext * device_context) { #ifdef CRU_DEBUG_DRAW_CONTROL_BORDER - auto brush = Application::GetInstance()->GetDebugBorderBrush(); - const auto size = GetSize(); - device_context->DrawRectangle(D2D1::RectF(0, 0, size.width, size.height), brush.Get()); + if (GetWindow()->GetDebugDrawControlBorder()) + { + auto brush = Application::GetInstance()->GetDebugBorderBrush(); + const auto size = GetSize(); + device_context->DrawRectangle(D2D1::RectF(0, 0, size.width, size.height), brush.Get()); + } #endif } -- cgit v1.2.3