From f39f53e8609b6a857d0d9b050abb0235c186c7fc Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 29 Aug 2024 20:27:13 +0100 Subject: [PATCH] Fix casting typo in D3MFExporter::writeBaseMaterials (color channels < 1.0f were zeroed out) (#5681) Co-authored-by: Kim Kulling --- code/AssetLib/3MF/D3MFExporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/AssetLib/3MF/D3MFExporter.cpp b/code/AssetLib/3MF/D3MFExporter.cpp index 6caa4c84e..6c09f097d 100644 --- a/code/AssetLib/3MF/D3MFExporter.cpp +++ b/code/AssetLib/3MF/D3MFExporter.cpp @@ -249,10 +249,10 @@ void D3MFExporter::writeBaseMaterials() { if (color.r <= 1 && color.g <= 1 && color.b <= 1 && color.a <= 1) { hexDiffuseColor = ai_rgba2hex( - (int)((ai_real)color.r) * 255, - (int)((ai_real)color.g) * 255, - (int)((ai_real)color.b) * 255, - (int)((ai_real)color.a) * 255, + (int)(((ai_real)color.r) * 255), + (int)(((ai_real)color.g) * 255), + (int)(((ai_real)color.b) * 255), + (int)(((ai_real)color.a) * 255), true); } else {