diff options
| author | crupest <crupest@outlook.com> | 2018-09-16 23:48:54 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2018-09-16 23:48:54 +0800 |
| commit | 94c066a34900845297c41c134a9a910124a5833d (patch) | |
| tree | fe717d4d80137c005ae3f2c1675ab3ba7d990b23 /CruUI/graph/graph.h | |
| parent | 683419f2856d348436ca64cfd4b3abbfc73cda89 (diff) | |
| download | cru-94c066a34900845297c41c134a9a910124a5833d.tar.gz cru-94c066a34900845297c41c134a9a910124a5833d.tar.bz2 cru-94c066a34900845297c41c134a9a910124a5833d.zip | |
Develop toggle button.
Diffstat (limited to 'CruUI/graph/graph.h')
| -rw-r--r-- | CruUI/graph/graph.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CruUI/graph/graph.h b/CruUI/graph/graph.h index 990b51b3..fd062787 100644 --- a/CruUI/graph/graph.h +++ b/CruUI/graph/graph.h @@ -164,5 +164,16 @@ namespace cru { return graph_manager_->GetD2D1DeviceContext(); } + + Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> CreateSolidBrush(const D2D1_COLOR_F& color); + + inline void WithTransform(ID2D1DeviceContext* device_context, const D2D1_MATRIX_3X2_F matrix, Action<ID2D1DeviceContext*>&& action) + { + D2D1_MATRIX_3X2_F old_transform; + device_context->GetTransform(&old_transform); + device_context->SetTransform(old_transform * matrix); + action(device_context); + device_context->SetTransform(old_transform); + } } } |
