mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-25 06:27:34 -07:00
Make bool option compatible with array input
This commit is contained in:
parent
59bca995fb
commit
dd08cca05e
1 changed files with 16 additions and 7 deletions
|
|
@ -1804,14 +1804,23 @@ public:
|
|||
bool deserialize(const std::string &str, bool append = false) override
|
||||
{
|
||||
UNUSED(append);
|
||||
if (str == "1") {
|
||||
this->value = true;
|
||||
return true;
|
||||
}
|
||||
if (str == "0") {
|
||||
this->value = false;
|
||||
return true;
|
||||
|
||||
// Orca: take the first value if input is an array
|
||||
std::istringstream is(str);
|
||||
std::string item_str;
|
||||
if (std::getline(is, item_str, ',')) {
|
||||
boost::trim(item_str);
|
||||
|
||||
if (item_str == "1") {
|
||||
this->value = true;
|
||||
return true;
|
||||
}
|
||||
if (item_str == "0") {
|
||||
this->value = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue