diff options
author | crupest <crupest@outlook.com> | 2018-09-20 22:50:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-20 22:50:37 +0800 |
commit | 5f7d3268e3d2ea84a1afc97c209b703bf4092c76 (patch) | |
tree | 8cab3c7457420b55376e5825f0cdfefd47551c00 /CruUI/ui/control.cpp | |
parent | 6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed (diff) | |
download | cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.tar.gz cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.tar.bz2 cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.zip |
Improve linear layout.
Diffstat (limited to 'CruUI/ui/control.cpp')
-rw-r--r-- | CruUI/ui/control.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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 } |