diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index bbe1cbae46..4850fc74d0 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -197,8 +197,8 @@ private: int picking_id_component(int idx) const; public: - static const unsigned int PLATE_NAME_HOVER_ID = 6; - static const unsigned int GRABBER_COUNT = 8; + static constexpr unsigned int PLATE_NAME_HOVER_ID = 6; + static constexpr unsigned int GRABBER_COUNT = 8; static ColorRGBA SELECT_COLOR; static ColorRGBA UNSELECT_COLOR; @@ -630,7 +630,7 @@ public: void reset(); }; - static const unsigned int MAX_PLATES_COUNT = MAX_PLATE_COUNT; + static constexpr unsigned int MAX_PLATES_COUNT = MAX_PLATE_COUNT; static GLTexture bed_textures[(unsigned int)btCount]; static bool is_load_bedtype_textures; static bool is_load_cali_texture; diff --git a/src/slic3r/GUI/SceneRaycaster.cpp b/src/slic3r/GUI/SceneRaycaster.cpp index 08c3407632..64a091211b 100644 --- a/src/slic3r/GUI/SceneRaycaster.cpp +++ b/src/slic3r/GUI/SceneRaycaster.cpp @@ -9,6 +9,9 @@ namespace Slic3r { namespace GUI { +// EIdBase::Volume must be greater than PartPlateList::MAX_PLATES_COUNT * PartPlate::GRABBER_COUNT +static_assert((int) SceneRaycaster::EIdBase::Volume > PartPlateList::MAX_PLATES_COUNT * PartPlate::GRABBER_COUNT, "EIdBase::Volume too small"); + SceneRaycaster::SceneRaycaster() { #if ENABLE_RAYCAST_PICKING_DEBUG // hit point diff --git a/src/slic3r/GUI/SceneRaycaster.hpp b/src/slic3r/GUI/SceneRaycaster.hpp index 3d4473197c..99152712dd 100644 --- a/src/slic3r/GUI/SceneRaycaster.hpp +++ b/src/slic3r/GUI/SceneRaycaster.hpp @@ -52,7 +52,7 @@ public: enum class EIdBase { Bed = 0, - Volume = 1000, // Must be smaller than PartPlateList::MAX_PLATES_COUNT * PartPlate::GRABBER_COUNT + Volume = 1000, // Must be greater than PartPlateList::MAX_PLATES_COUNT * PartPlate::GRABBER_COUNT Gizmo = 1000000, FallbackGizmo = 2000000 };