From 436384cf65e3a6215ada79ef99b8a3dc7cb6b7f0 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Fri, 14 Oct 2022 07:51:16 +0200 Subject: [PATCH] Fix: \src\libslic3r\Emboss.cpp(484): warning C4305: '=': truncation from 'double' to 'float' --- src/libslic3r/Emboss.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index ac886a151b..e0329a5a08 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -463,7 +463,8 @@ const Emboss::Glyph* priv::get_glyph( Emboss::Glyphs & cache, std::optional &font_info_opt) { - const double RESOLUTION = 0.0125; // TODO: read from printer configuration + // TODO: Use resolution by printer configuration, or add it into FontProp + const float RESOLUTION = 0.0125; // [in mm] auto glyph_item = cache.find(unicode); if (glyph_item != cache.end()) return &glyph_item->second; @@ -478,7 +479,7 @@ const Emboss::Glyph* priv::get_glyph( if (!font_info_opt.has_value()) return nullptr; } - float flatness = static_cast(font.infos[font_index].ascent * RESOLUTION / font_prop.size_in_mm); + float flatness = font.infos[font_index].ascent * RESOLUTION / font_prop.size_in_mm; // Fix for very small flatness because it create huge amount of points from curve if (flatness < RESOLUTION) flatness = RESOLUTION;