stop replacing the empty string with the number zero in watchers

fixed #473
pull/3/merge
jmoenig 2014-06-05 17:13:27 +02:00
rodzic cdfe8b900a
commit f80235ee43
2 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -2149,3 +2149,7 @@ ______
* Bug fixes from Nathan, yay, thanks, Nathan!!
* German translation update
* Paint Editor transforms, yay, thanks, Kartik!!
140605
------
* Objects: stop replacing the empty string with the number zero in watchers

Wyświetl plik

@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.objects = '2014-Jun-04';
modules.objects = '2014-Jun-05';
var SpriteMorph;
var StageMorph;
@ -6591,9 +6591,11 @@ WatcherMorph.prototype.update = function () {
} else {
newValue = this.target[this.getter]();
}
num = +newValue;
if (typeof newValue !== 'boolean' && !isNaN(num)) {
newValue = Math.round(newValue * 1000000000) / 1000000000;
if (newValue !== '' && !isNil(newValue)) {
num = +newValue;
if (typeof newValue !== 'boolean' && !isNaN(num)) {
newValue = Math.round(newValue * 1000000000) / 1000000000;
}
}
if (newValue !== this.currentValue) {
this.changed();