reflect attribute inheritance status by ghosting / un-ghosting stage monitors

upd4.1
Jens Mönig 2017-06-30 08:47:17 +02:00
rodzic b55df2f72b
commit 6e74982fb3
2 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -3487,6 +3487,10 @@ Fixes:
------
* Objects: manage inheritance relationships when setting a prototype or deleting a sprite
170630
------
* Objects: reflect attribute inheritance status by ghosting / un-ghosting stage monitors
Features:
* polymorphic sprite-local custom blocks

Wyświetl plik

@ -82,7 +82,7 @@ SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
modules.objects = '2017-June-29';
modules.objects = '2017-June-30';
var SpriteMorph;
var StageMorph;
@ -8721,7 +8721,8 @@ WatcherMorph.prototype.setSliderMax = function (num, noUpdate) {
// WatcherMorph updating:
WatcherMorph.prototype.update = function () {
var newValue, sprite, num;
var newValue, sprite, num, att,
isGhosted = false;
if (this.target && this.getter) {
this.updateLabel();
@ -8749,6 +8750,14 @@ WatcherMorph.prototype.update = function () {
}
} else {
newValue = this.target[this.getter]();
// determine whether my getter is an inherited attribute
att = {
xPosition: 'x position',
yPosition: 'y position',
direction: 'direction',
getScale: 'size'} [this.getter];
isGhosted = att ? this.target.inheritsAttribute(att) : false;
}
if (newValue !== '' && !isNil(newValue)) {
num = +newValue;
@ -8759,6 +8768,11 @@ WatcherMorph.prototype.update = function () {
if (newValue !== this.currentValue) {
this.changed();
this.cellMorph.contents = newValue;
if (isGhosted) {
this.cellMorph.setColor(this.readoutColor.lighter(35));
} else {
this.cellMorph.setColor(this.readoutColor);
}
this.cellMorph.drawNew();
if (!isNaN(newValue)) {
this.sliderMorph.value = newValue;