Fixed a bug in parsering a Point from a config file.
This commit is contained in:
parent
cc52654db3
commit
e3d84407e0
1 changed files with 3 additions and 6 deletions
|
@ -644,12 +644,9 @@ public:
|
|||
bool deserialize(const std::string &str, bool append = false) override
|
||||
{
|
||||
UNUSED(append);
|
||||
std::istringstream iss(str);
|
||||
iss >> this->value.x;
|
||||
iss.ignore(std::numeric_limits<std::streamsize>::max(), ',');
|
||||
iss.ignore(std::numeric_limits<std::streamsize>::max(), 'x');
|
||||
iss >> this->value.y;
|
||||
return true;
|
||||
char dummy;
|
||||
return sscanf(str.data(), " %lf , %lf %c", &this->value.x, &this->value.y, &dummy) == 2 ||
|
||||
sscanf(str.data(), " %lf x %lf %c", &this->value.x, &this->value.y, &dummy) == 2;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue