From ccaca80db164eaf306ec3c2fe8967f14a99ed501 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Mon, 27 May 2024 16:54:28 +0200 Subject: [PATCH] avoid a SysFunct call --- source/paint/graphics.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index 866e6d88..a4339abc 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -263,7 +263,7 @@ namespace paint struct graphics::implementation { int dpi { 97 }; - float scale{ 1.0f }; /// \todo: + float scale{ dpi / 96.0f }; /// \todo: font font_shadow; std::shared_ptr<::nana::detail::drawable_impl_type> platform_drawable; drawable_type handle{ nullptr }; ///< just refers to the platform-specific drawable_impl_type object above @@ -289,8 +289,7 @@ namespace paint return impl_->dpi; } graphics::graphics(int dpi) - : impl_(new implementation{.dpi {dpi?dpi: api::screen_dpi()}, - .scale{(dpi?dpi: api::screen_dpi())/96.0f}}) + : impl_(new implementation{.dpi {dpi?dpi: api::screen_dpi()}}) { auto info = typeface().info(); nana::paint::font ft{ info.value(), impl_->dpi };