From 4f27591e67ffe05604dde4d182cab867f5f2c341 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 10 Sep 2023 16:19:49 +0200 Subject: [PATCH] Gui: fix some MSVC truncation warnings See forum: https://forum.freecad.org/viewtopic.php?t=81051 --- src/Gui/MainWindow.cpp | 2 +- src/Gui/Selection.h | 10 ++++++++-- src/Gui/View3DInventorViewer.cpp | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 2e66695b7b..fc4d9346d8 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1734,7 +1734,7 @@ void MainWindow::renderDevBuildWarning( lineHeight = painter.fontMetrics().lineSpacing(); boxWidth = maxSize.width(); } - constexpr float lineExpansionFactor(2.3); + constexpr float lineExpansionFactor(2.3F); int boxHeight = static_cast(lineHeight*lineExpansionFactor); // Draw the background rectangle and the text diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 32d4dac94b..736ff69149 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -531,10 +531,16 @@ public: */ //@{ /// Return the current selection stack size - int selStackBackSize() const {return _SelStackBack.size();} + std::size_t selStackBackSize() const + { + return _SelStackBack.size(); + } /// Return the current forward selection stack size - int selStackForwardSize() const {return _SelStackForward.size();} + std::size_t selStackForwardSize() const + { + return _SelStackForward.size(); + } /** Obtain selected objects from stack * diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index f346479750..54736ed640 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1333,7 +1333,7 @@ void View3DInventorViewer::showRotationCenter(bool show) auto material = new SoMaterial(); material->emissiveColor = SbColor(1, 0, 0); - material->transparency = 0.8; + material->transparency = 0.8F; auto translation = new SoTranslation(); translation->translation.setValue(center);