From a821668dc7e7acf4d7a30846c2f4a0d4ef7a5175 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Fri, 1 Apr 2022 08:35:10 +0200 Subject: [PATCH] Fixed comparison operators of ColorRGB and ColorRGBA --- src/libslic3r/Color.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libslic3r/Color.cpp b/src/libslic3r/Color.cpp index 7b5a7f3ba..4d3bc6793 100644 --- a/src/libslic3r/Color.cpp +++ b/src/libslic3r/Color.cpp @@ -130,6 +130,8 @@ bool ColorRGB::operator < (const ColorRGB& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] < other.m_data[i]) return true; + else if (m_data[i] > other.m_data[i]) + return false; } return false; @@ -140,6 +142,8 @@ bool ColorRGB::operator > (const ColorRGB& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] > other.m_data[i]) return true; + else if (m_data[i] < other.m_data[i]) + return false; } return false; @@ -179,6 +183,8 @@ bool ColorRGBA::operator < (const ColorRGBA& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] < other.m_data[i]) return true; + else if (m_data[i] > other.m_data[i]) + return false; } return false; @@ -189,6 +195,8 @@ bool ColorRGBA::operator > (const ColorRGBA& other) const for (size_t i = 0; i < 3; ++i) { if (m_data[i] > other.m_data[i]) return true; + else if (m_data[i] < other.m_data[i]) + return false; } return false;