summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Mönig <jens@moenig.org>2015-04-15 17:32:08 +0200
committerJens Mönig <jens@moenig.org>2015-04-15 17:32:08 +0200
commit4f39a406da6dbbea1ae6a34cfcbc1026ef6ad6aa (patch)
tree318991c20980fdf0f4a448e879dc7024cd2ff81c
parent7eb778a98e08e4c79a73ed41be6beafa1fda5788 (diff)
downloadsnap-4f39a406da6dbbea1ae6a34cfcbc1026ef6ad6aa.tar.gz
snap-4f39a406da6dbbea1ae6a34cfcbc1026ef6ad6aa.zip
fixed #770
-rwxr-xr-xhistory.txt2
-rw-r--r--objects.js29
2 files changed, 27 insertions, 4 deletions
diff --git a/history.txt b/history.txt
index ef96624..b3b4da3 100755
--- a/history.txt
+++ b/history.txt
@@ -2497,4 +2497,4 @@ ______
150415
------
* Threads: flush Stage>>keysPressed when prompting the user
-
+* Objects: fixed #770
diff --git a/objects.js b/objects.js
index 66726a1..173be51 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2015-March-24';
+modules.objects = '2015-April-15';
var SpriteMorph;
var StageMorph;
@@ -2369,6 +2369,29 @@ SpriteMorph.prototype.freshPalette = function (category) {
}
});
+ // inherited custom blocks: (under construction...)
+
+ // y += unit * 1.6;
+ if (this.exemplar) {
+ this.exemplar.customBlocks.forEach(function (definition) {
+ var block;
+ if (definition.category === category ||
+ (category === 'variables'
+ && contains(
+ ['lists', 'other'],
+ definition.category
+ ))) {
+ block = definition.templateInstance();
+ y += unit * 0.3;
+ block.setPosition(new Point(x, y));
+ palette.addContents(block);
+ block.ghost();
+ x = 0;
+ y += block.height();
+ }
+ });
+ }
+
//layout
palette.scrollX(palette.padding);
@@ -3107,7 +3130,7 @@ SpriteMorph.prototype.setEffect = function (effect, value) {
if (eff === 'ghost') {
this.alpha = 1 - Math.min(Math.max(+value || 0, 0), 100) / 100;
} else {
- this.graphicsValues[eff] = value;
+ this.graphicsValues[eff] = +value;
}
this.drawNew();
this.changed();
@@ -3122,7 +3145,7 @@ SpriteMorph.prototype.changeEffect = function (effect, value) {
if (eff === 'ghost') {
this.setEffect(effect, this.getGhostEffect() + (+value || 0));
} else {
- this.setEffect(effect, this.graphicsValues[eff] + value);
+ this.setEffect(effect, +this.graphicsValues[eff] + (+value));
}
};