aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-20 22:50:37 +0800
committercrupest <crupest@outlook.com>2018-09-20 22:50:37 +0800
commit5f7d3268e3d2ea84a1afc97c209b703bf4092c76 (patch)
tree8cab3c7457420b55376e5825f0cdfefd47551c00 /CruUI/ui/control.cpp
parent6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed (diff)
downloadcru-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.cpp13
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
}