diff options
author | crupest <crupest@outlook.com> | 2018-09-19 23:59:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-19 23:59:15 +0800 |
commit | 6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed (patch) | |
tree | c49981640d37ab29e6e9bf3f01f1483c3a3d042b | |
parent | dea11f34bfab5bfd5f66dec9f2fa0239abf44d89 (diff) | |
download | cru-6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed.tar.gz cru-6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed.tar.bz2 cru-6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed.zip |
Change the macro controlling the debug control border.
-rw-r--r-- | CruUI/application.cpp | 2 | ||||
-rw-r--r-- | CruUI/application.h | 4 | ||||
-rw-r--r-- | CruUI/global_macros.h | 4 | ||||
-rw-r--r-- | CruUI/ui/control.cpp | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/CruUI/application.cpp b/CruUI/application.cpp index 120fffa6..1375ed99 100644 --- a/CruUI/application.cpp +++ b/CruUI/application.cpp @@ -101,7 +101,7 @@ namespace cru { god_window_ = std::make_unique<GodWindow>(this); -#ifdef CRU_DEBUG +#ifdef CRU_DEBUG_DRAW_CONTROL_BORDER debug_border_brush_ = graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Crimson)); #endif } diff --git a/CruUI/application.h b/CruUI/application.h index 1c98b906..1ce6f035 100644 --- a/CruUI/application.h +++ b/CruUI/application.h @@ -101,7 +101,7 @@ namespace cru return god_window_.get(); } -#ifdef CRU_DEBUG +#ifdef CRU_DEBUG_DRAW_CONTROL_BORDER Microsoft::WRL::ComPtr<ID2D1Brush> GetDebugBorderBrush() const { return debug_border_brush_; @@ -118,7 +118,7 @@ namespace cru std::unique_ptr<GodWindow> god_window_; -#ifdef CRU_DEBUG +#ifdef CRU_DEBUG_DRAW_CONTROL_BORDER Microsoft::WRL::ComPtr<ID2D1Brush> debug_border_brush_; #endif }; diff --git a/CruUI/global_macros.h b/CruUI/global_macros.h index 7d8da00b..696c5d2b 100644 --- a/CruUI/global_macros.h +++ b/CruUI/global_macros.h @@ -5,3 +5,7 @@ #endif #define GLOG_NO_ABBREVIATED_SEVERITIES + +#ifdef CRU_DEBUG +#define CRU_DEBUG_DRAW_CONTROL_BORDER +#endif diff --git a/CruUI/ui/control.cpp b/CruUI/ui/control.cpp index e2f63d02..4d69100d 100644 --- a/CruUI/ui/control.cpp +++ b/CruUI/ui/control.cpp @@ -321,7 +321,7 @@ namespace cru { void Control::OnDraw(ID2D1DeviceContext * device_context) { -#ifdef CRU_DEBUG +#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()); |