From 6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 19 Sep 2018 23:59:15 +0800 Subject: Change the macro controlling the debug control border. --- CruUI/application.cpp | 2 +- CruUI/application.h | 4 ++-- CruUI/global_macros.h | 4 ++++ CruUI/ui/control.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'CruUI') 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(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 GetDebugBorderBrush() const { return debug_border_brush_; @@ -118,7 +118,7 @@ namespace cru std::unique_ptr god_window_; -#ifdef CRU_DEBUG +#ifdef CRU_DEBUG_DRAW_CONTROL_BORDER Microsoft::WRL::ComPtr 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()); -- cgit v1.2.3