1
0
Fork 0

Bug Fix: #1732 Nasal runtime error with hovered tooltip

This commit is contained in:
Scott Giese 2018-10-03 01:49:50 -05:00
parent 2f0b9ecd00
commit 43ac415a8a

View file

@ -120,7 +120,7 @@ var Tooltip = {
_updateText: func
{
var msg = me._label;
if (me._property != nil) {
if (me._property != nil and me._label != nil) {
var val = me._property.getValue() or 0;
# https://code.google.com/p/flightgear-bugs/issues/detail?id=1454
@ -308,13 +308,7 @@ tooltip.createCanvas();
var innerSetTooltip = func(node)
{
tooltip.setLabel(cmdarg().getNode('label').getValue());
var measure = cmdarg().getNode('measure-text');
if (measure != nil) {
tooltip.setWidthText(measure.getValue());
} else {
tooltip.setWidthText(nil);
}
tooltip.setLabel(nil);
var propPath = cmdarg().getNode('property');
if (propPath != nil) {
@ -324,6 +318,15 @@ var innerSetTooltip = func(node)
tooltip.setProperty(nil);
}
tooltip.setLabel(cmdarg().getNode('label').getValue());
var measure = cmdarg().getNode('measure-text');
if (measure != nil) {
tooltip.setWidthText(measure.getValue());
} else {
tooltip.setWidthText(nil);
}
var mapping = cmdarg().getNode('mapping');
if (mapping != nil) {
var m = mapping.getValue();