smooth numerical values displayed in watchers

pull/3/merge
jmoenig 2013-10-01 15:50:53 +02:00
rodzic dc709c2e12
commit 9a0881b96a
2 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -1929,3 +1929,7 @@ ______
130930
------
* Blocks: fixed #186 (can't duplicate blocks with anchored comments)
131001
------
* Objects: smooth numerical values displayed in watchers

Wyświetl plik

@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.objects = '2013-September-19';
modules.objects = '2013-October-01';
var SpriteMorph;
var StageMorph;
@ -5986,13 +5986,16 @@ WatcherMorph.prototype.update = function () {
} else {
newValue = this.target[this.getter]();
}
num = parseFloat(newValue);
if (!isNaN(num)) {
newValue = Math.round(newValue * 1000000000) / 1000000000;
}
if (newValue !== this.currentValue) {
this.changed();
this.cellMorph.contents = newValue;
this.cellMorph.drawNew();
num = parseFloat(newValue);
if (!isNaN(num)) {
this.sliderMorph.value = num;
if (!isNaN(newValue)) {
this.sliderMorph.value = newValue;
this.sliderMorph.drawNew();
}
this.fixLayout();