minor format tweaks to "Screenshot" feature

pull/3/merge
jmoenig 2014-07-17 10:59:13 +02:00
rodzic c11e4c7c6d
commit 5decf8a0e0
3 zmienionych plików z 6 dodań i 7 usunięć

Wyświetl plik

@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2014-July-11'; modules.blocks = '2014-July-14';
var SyntaxElementMorph; var SyntaxElementMorph;

Wyświetl plik

@ -2202,3 +2202,4 @@ ______
------ ------
* new translation into Bangla (Bengali)!!! Yay, thanks, Mokter!! * new translation into Bangla (Bengali)!!! Yay, thanks, Mokter!!
* Lists: make internal list ops iterative (instead of recursive), thanks, Brian! * Lists: make internal list ops iterative (instead of recursive), thanks, Brian!
* Objects, Blocks: new feature (hidden in dev mode): Save screenshot, thanks, Viral!

Wyświetl plik

@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.objects = '2014-July-11'; modules.objects = '2014-July-14';
var SpriteMorph; var SpriteMorph;
var StageMorph; var StageMorph;
@ -1325,8 +1325,6 @@ SpriteMorph.prototype.init = function (globals) {
this.changed(); this.changed();
this.drawNew(); this.drawNew();
this.changed(); this.changed();
this.screenshotNames = {}; // Keeps track of stage image names
}; };
// SpriteMorph duplicating (fullCopy) // SpriteMorph duplicating (fullCopy)
@ -4095,7 +4093,7 @@ SpriteMorph.prototype.newCostumeName = function (name) {
p = null, p = null,
costume = null; costume = null;
for (i = 1; i <= this.costumes.length(); i++) { for (i = 1; i <= this.costumes.length(); i += 1) {
costume = this.costumes.at(i); costume = this.costumes.at(i);
if (costume !== null) { if (costume !== null) {
if (costume.name === name) { if (costume.name === name) {
@ -4115,7 +4113,7 @@ SpriteMorph.prototype.newCostumeName = function (name) {
lastIndex += 1; lastIndex += 1;
return name + '(' + lastIndex + ')'; // New index with a +1 return name + '(' + lastIndex + ')'; // New index with a +1
} }
return name + '(2)'; // No indexing has started so start it off with a (1) return name + '(2)'; // start off indexing with (1)
} }
return name; return name;
}; };
@ -4130,7 +4128,7 @@ SpriteMorph.prototype.doScreenshot = function (imgSource, data) {
} }
if (imgSource[0] === "pen trails") { if (imgSource[0] === "pen trails") {
canvas = stage.trailsCanvas; canvas = stage.trailsCanvas;
costume = new Costume(canvas, data).copy(); // Copy is required to prevent mutation costume = new Costume(canvas, data).copy(); // prevent mutation
} else if (imgSource[0] === "stage image") { } else if (imgSource[0] === "stage image") {
canvas = stage.fullImageClassic(); canvas = stage.fullImageClassic();
costume = new Costume(canvas, data); costume = new Costume(canvas, data);