diff options
author | crupest <crupest@outlook.com> | 2018-11-09 21:03:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-11-09 21:03:45 +0800 |
commit | 4b219b569c16db6027dd36e4656152f261321c60 (patch) | |
tree | 2f40c6aeb74382c5a958f153e4598950dffae94c /src/graph/graph.hpp | |
parent | 6515948e3f5b97f90446536f72e99d71e96f9de7 (diff) | |
parent | 9ef75fe91837394620edb91f332065a4f34a0281 (diff) | |
download | cru-4b219b569c16db6027dd36e4656152f261321c60.tar.gz cru-4b219b569c16db6027dd36e4656152f261321c60.tar.bz2 cru-4b219b569c16db6027dd36e4656152f261321c60.zip |
Merge branch 'master' into theme-resource
Diffstat (limited to 'src/graph/graph.hpp')
-rw-r--r-- | src/graph/graph.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/graph/graph.hpp b/src/graph/graph.hpp index 9ef2e4b8..b98db5f4 100644 --- a/src/graph/graph.hpp +++ b/src/graph/graph.hpp @@ -2,9 +2,9 @@ #include "system_headers.hpp" #include <memory> +#include <functional> #include "base.hpp" -#include "application.hpp" namespace cru::graph @@ -62,13 +62,14 @@ namespace cru::graph float y; }; - class GraphManager : public Object + class GraphManager final : public Object { public: static GraphManager* GetInstance(); - public: + private: GraphManager(); + public: GraphManager(const GraphManager& other) = delete; GraphManager(GraphManager&& other) = delete; GraphManager& operator=(const GraphManager& other) = delete; @@ -135,12 +136,12 @@ namespace cru::graph inline int DipToPixelX(const float dip_x) { - return DipToPixelInternal(dip_x, Application::GetInstance()->GetGraphManager()->GetDpi().x); + return DipToPixelInternal(dip_x, GraphManager::GetInstance()->GetDpi().x); } inline int DipToPixelY(const float dip_y) { - return DipToPixelInternal(dip_y, Application::GetInstance()->GetGraphManager()->GetDpi().y); + return DipToPixelInternal(dip_y, GraphManager::GetInstance()->GetDpi().y); } inline float DipToPixelInternal(const int pixel, const float dpi) @@ -150,12 +151,12 @@ namespace cru::graph inline float PixelToDipX(const int pixel_x) { - return DipToPixelInternal(pixel_x, Application::GetInstance()->GetGraphManager()->GetDpi().x); + return DipToPixelInternal(pixel_x, GraphManager::GetInstance()->GetDpi().x); } inline float PixelToDipY(const int pixel_y) { - return DipToPixelInternal(pixel_y, Application::GetInstance()->GetGraphManager()->GetDpi().y); + return DipToPixelInternal(pixel_y, GraphManager::GetInstance()->GetDpi().y); } Microsoft::WRL::ComPtr<ID2D1DeviceContext> WindowRenderTarget::GetD2DDeviceContext() const |