diff --git a/Nasal/canvas/tooltip.nas b/Nasal/canvas/tooltip.nas index dab11ce38..42fb45699 100644 --- a/Nasal/canvas/tooltip.nas +++ b/Nasal/canvas/tooltip.nas @@ -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();