kopia lustrzana https://github.com/backface/turtlestitch
fixed #784
rodzic
834b3918ad
commit
9385e4b57c
|
@ -2485,3 +2485,7 @@ ______
|
|||
------
|
||||
* Threads: flush Stage>>keysPressed when prompting the user
|
||||
* Objects: fixed #770
|
||||
|
||||
150426
|
||||
------
|
||||
* Store: fixed #784
|
||||
|
|
78
store.js
78
store.js
|
@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.store = '2015-March-15';
|
||||
modules.store = '2015-April-26';
|
||||
|
||||
|
||||
// XML_Serializer ///////////////////////////////////////////////////////
|
||||
|
@ -491,7 +491,7 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
|
|||
/* Watchers */
|
||||
|
||||
model.sprites.childrenNamed('watcher').forEach(function (model) {
|
||||
var watcher, color, target, hidden, extX, extY;
|
||||
var watcher, color, target, hidden, extX, extY, vFrame;
|
||||
|
||||
color = myself.loadColor(model.attributes.color);
|
||||
target = Object.prototype.hasOwnProperty.call(
|
||||
|
@ -512,14 +512,20 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
|
|||
model.attributes,
|
||||
'var'
|
||||
)) {
|
||||
watcher = new WatcherMorph(
|
||||
model.attributes['var'],
|
||||
color,
|
||||
isNil(target) ? project.globalVariables
|
||||
: target.variables,
|
||||
model.attributes['var'],
|
||||
hidden
|
||||
);
|
||||
vFrame = isNil(target) ? project.globalVariables
|
||||
: target.variables;
|
||||
if (Object.prototype.hasOwnProperty.call(
|
||||
vFrame.vars,
|
||||
model.attributes['var']
|
||||
)) {
|
||||
watcher = new WatcherMorph(
|
||||
model.attributes['var'],
|
||||
color,
|
||||
vFrame,
|
||||
model.attributes['var'],
|
||||
hidden
|
||||
);
|
||||
}
|
||||
} else {
|
||||
watcher = new WatcherMorph(
|
||||
localize(myself.watcherLabels[model.attributes.s]),
|
||||
|
@ -529,33 +535,35 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode) {
|
|||
hidden
|
||||
);
|
||||
}
|
||||
watcher.setStyle(model.attributes.style || 'normal');
|
||||
if (watcher.style === 'slider') {
|
||||
watcher.setSliderMin(model.attributes.min || '1');
|
||||
watcher.setSliderMax(model.attributes.max || '100');
|
||||
}
|
||||
watcher.setPosition(
|
||||
project.stage.topLeft().add(new Point(
|
||||
+model.attributes.x || 0,
|
||||
+model.attributes.y || 0
|
||||
))
|
||||
);
|
||||
project.stage.add(watcher);
|
||||
watcher.onNextStep = function () {this.currentValue = null; };
|
||||
if (watcher) {
|
||||
watcher.setStyle(model.attributes.style || 'normal');
|
||||
if (watcher.style === 'slider') {
|
||||
watcher.setSliderMin(model.attributes.min || '1');
|
||||
watcher.setSliderMax(model.attributes.max || '100');
|
||||
}
|
||||
watcher.setPosition(
|
||||
project.stage.topLeft().add(new Point(
|
||||
+model.attributes.x || 0,
|
||||
+model.attributes.y || 0
|
||||
))
|
||||
);
|
||||
project.stage.add(watcher);
|
||||
watcher.onNextStep = function () {this.currentValue = null; };
|
||||
|
||||
// set watcher's contentsMorph's extent if it is showing a list and
|
||||
// its monitor dimensions are given
|
||||
if (watcher.currentValue instanceof List) {
|
||||
extX = model.attributes.extX;
|
||||
if (extX) {
|
||||
watcher.cellMorph.contentsMorph.setWidth(+extX);
|
||||
// set watcher's contentsMorph's extent if it is showing a list
|
||||
// and if its monitor dimensions are given
|
||||
if (watcher.currentValue instanceof List) {
|
||||
extX = model.attributes.extX;
|
||||
if (extX) {
|
||||
watcher.cellMorph.contentsMorph.setWidth(+extX);
|
||||
}
|
||||
extY = model.attributes.extY;
|
||||
if (extY) {
|
||||
watcher.cellMorph.contentsMorph.setHeight(+extY);
|
||||
}
|
||||
// adjust my contentsMorph's handle position
|
||||
watcher.cellMorph.contentsMorph.handle.drawNew();
|
||||
}
|
||||
extY = model.attributes.extY;
|
||||
if (extY) {
|
||||
watcher.cellMorph.contentsMorph.setHeight(+extY);
|
||||
}
|
||||
// adjust my contentsMorph's handle position
|
||||
watcher.cellMorph.contentsMorph.handle.drawNew();
|
||||
}
|
||||
});
|
||||
this.objects = {};
|
||||
|
|
Ładowanie…
Reference in New Issue