From 9250f4d919bc800fe66a50a0874183458e6ebbbe Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 10 Sep 2018 23:58:34 +0800 Subject: ... --- CruUI/graph/graph.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'CruUI/graph/graph.cpp') diff --git a/CruUI/graph/graph.cpp b/CruUI/graph/graph.cpp index 4f65a86c..00d5137d 100644 --- a/CruUI/graph/graph.cpp +++ b/CruUI/graph/graph.cpp @@ -200,7 +200,7 @@ namespace cru { return std::make_shared(this, hwnd); } - Dpi GraphManager::GetDpi() + Dpi GraphManager::GetDpi() const { Dpi dpi; d2d1_factory_->GetDesktopDpi(&dpi.x, &dpi.y); @@ -213,35 +213,5 @@ namespace cru { d2d1_factory_->ReloadSystemMetrics() ); } - - inline int DipToPixelInternal(float dip, float dpi) - { - return static_cast(dip * dpi / 96.0f); - } - - int DipToPixelX(float dipX) - { - return DipToPixelInternal(dipX, Application::GetInstance()->GetGraphManager()->GetDpi().x); - } - - int DipToPixelY(float dipY) - { - return DipToPixelInternal(dipY, Application::GetInstance()->GetGraphManager()->GetDpi().y); - } - - inline float DipToPixelInternal(int pixel, float dpi) - { - return static_cast(pixel) * 96.0f / dpi; - } - - float PixelToDipX(int pixelX) - { - return DipToPixelInternal(pixelX, Application::GetInstance()->GetGraphManager()->GetDpi().x); - } - - float PixelToDipY(int pixelY) - { - return DipToPixelInternal(pixelY, Application::GetInstance()->GetGraphManager()->GetDpi().y); - } } } -- cgit v1.2.3