src/Viewer/ViewPropertyEvaluator.cxx: fix getSequenceDoubleValue()'s handling of default value.
If node's string value is '' then return <default_> - used to return 0.0 which is incorrect.
This commit is contained in:
parent
a3d75e8573
commit
1e07dab5c5
1 changed files with 6 additions and 1 deletions
|
@ -488,8 +488,13 @@ namespace ViewPropertyEvaluator {
|
|||
{
|
||||
SGPropertyNode* node = getSequenceNode(sequence);
|
||||
if (node) {
|
||||
if (node->getStringValue()[0] != 0) {
|
||||
return node->getDoubleValue();
|
||||
}
|
||||
/* If we reach here, the node exists but its value is an empty
|
||||
string, so node->getDoubleValue() would return 0 which isn't
|
||||
useful, so instead we return default_. */
|
||||
}
|
||||
return default_;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue