kopia lustrzana https://github.com/backface/turtlestitch
reflect attribute inheritance status by ghosting / un-ghosting stage monitors
rodzic
b55df2f72b
commit
6e74982fb3
|
@ -3487,6 +3487,10 @@ Fixes:
|
||||||
------
|
------
|
||||||
* Objects: manage inheritance relationships when setting a prototype or deleting a sprite
|
* 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:
|
Features:
|
||||||
* polymorphic sprite-local custom blocks
|
* polymorphic sprite-local custom blocks
|
||||||
|
|
18
objects.js
18
objects.js
|
@ -82,7 +82,7 @@ SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
|
||||||
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
||||||
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
|
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
|
||||||
|
|
||||||
modules.objects = '2017-June-29';
|
modules.objects = '2017-June-30';
|
||||||
|
|
||||||
var SpriteMorph;
|
var SpriteMorph;
|
||||||
var StageMorph;
|
var StageMorph;
|
||||||
|
@ -8721,7 +8721,8 @@ WatcherMorph.prototype.setSliderMax = function (num, noUpdate) {
|
||||||
// WatcherMorph updating:
|
// WatcherMorph updating:
|
||||||
|
|
||||||
WatcherMorph.prototype.update = function () {
|
WatcherMorph.prototype.update = function () {
|
||||||
var newValue, sprite, num;
|
var newValue, sprite, num, att,
|
||||||
|
isGhosted = false;
|
||||||
|
|
||||||
if (this.target && this.getter) {
|
if (this.target && this.getter) {
|
||||||
this.updateLabel();
|
this.updateLabel();
|
||||||
|
@ -8749,6 +8750,14 @@ WatcherMorph.prototype.update = function () {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newValue = this.target[this.getter]();
|
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)) {
|
if (newValue !== '' && !isNil(newValue)) {
|
||||||
num = +newValue;
|
num = +newValue;
|
||||||
|
@ -8759,6 +8768,11 @@ WatcherMorph.prototype.update = function () {
|
||||||
if (newValue !== this.currentValue) {
|
if (newValue !== this.currentValue) {
|
||||||
this.changed();
|
this.changed();
|
||||||
this.cellMorph.contents = newValue;
|
this.cellMorph.contents = newValue;
|
||||||
|
if (isGhosted) {
|
||||||
|
this.cellMorph.setColor(this.readoutColor.lighter(35));
|
||||||
|
} else {
|
||||||
|
this.cellMorph.setColor(this.readoutColor);
|
||||||
|
}
|
||||||
this.cellMorph.drawNew();
|
this.cellMorph.drawNew();
|
||||||
if (!isNaN(newValue)) {
|
if (!isNaN(newValue)) {
|
||||||
this.sliderMorph.value = newValue;
|
this.sliderMorph.value = newValue;
|
||||||
|
|
Ładowanie…
Reference in New Issue