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,7 +488,12 @@ namespace ViewPropertyEvaluator {
|
|||
{
|
||||
SGPropertyNode* node = getSequenceNode(sequence);
|
||||
if (node) {
|
||||
return node->getDoubleValue();
|
||||
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