mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 00:45:57 +08:00
Fixed is_nil(size_t) when checking out-of-range element
This commit is contained in:
parent
ae15032e0f
commit
24a91d7420
@ -776,7 +776,7 @@ public:
|
|||||||
static int nil_value() { return std::numeric_limits<int>::max(); }
|
static int nil_value() { return std::numeric_limits<int>::max(); }
|
||||||
// A scalar is nil, or all values of a vector are nil.
|
// A scalar is nil, or all values of a vector are nil.
|
||||||
bool is_nil() const override { for (auto v : this->values) if (v != nil_value()) return false; return true; }
|
bool is_nil() const override { for (auto v : this->values) if (v != nil_value()) return false; return true; }
|
||||||
bool is_nil(size_t idx) const override { return this->values[idx] == nil_value(); }
|
bool is_nil(size_t idx) const override { return values[idx < this->values.size() ? idx : 0] == nil_value(); }
|
||||||
|
|
||||||
std::string serialize() const override
|
std::string serialize() const override
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user