Skip to content

Commit

Permalink
avoid a SysFunct call
Browse files Browse the repository at this point in the history
  • Loading branch information
qPCR4vir committed May 27, 2024
1 parent 960dc9b commit ccaca80
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/paint/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 };
Expand Down

0 comments on commit ccaca80

Please sign in to comment.