diff --git a/stitchcode/gui.js b/stitchcode/gui.js index 91e41aad..076801ea 100644 --- a/stitchcode/gui.js +++ b/stitchcode/gui.js @@ -1093,12 +1093,11 @@ IDE_Morph.prototype.setProjectName = function (string) { if (string.replace(/['"]/g, '') != this.projectName || SnapCloud.username != this.creator) { this.remixHistory = this.creator + ":" + this.projectName + ";" + this.remixHistory - } - this.origCreator = SnapCloud.username != this.creator ? this.creator : SnapCloud.username; - this.creator = SnapCloud.username ? SnapCloud.username : "anonymous"; - if (string.replace(/['"]/g, '') != this.projectName) { this.origName = this.projectName; } + this.origName = this.projectName; + this.origCreator = SnapCloud.username != this.creator ? this.creator : SnapCloud.username; + this.creator = SnapCloud.username ? SnapCloud.username : "anonymous"; this.projectName = string.replace(/['"]/g, ''); // filter quotation marks this.hasChangedMedia = true; this.controlBar.updateLabel(); diff --git a/stitchcode/turtleShepherd.js b/stitchcode/turtleShepherd.js index 0f387f9c..fd7d142d 100644 --- a/stitchcode/turtleShepherd.js +++ b/stitchcode/turtleShepherd.js @@ -396,11 +396,14 @@ TurtleShepherd.prototype.toEXP = function() { dmax = Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0)); dsteps = Math.abs(dmax / 127); + if (!lastStitch.penDown) + move(0,0); + if (dsteps <= 1) { if (!stitch.penDown) { //ignore color - //expArr.push(0x80); - //expArr.push(0x04); + expArr.push(0x80); + expArr.push(0x04); } move(Math.round(x1 - x0), Math.round(y1 - y0)); } else { @@ -414,13 +417,13 @@ TurtleShepherd.prototype.toEXP = function() { sum_x += (x1 - x0)/dsteps; sum_y += (y1 - y0)/dsteps; } else { - move(Math.round((x1 - x0) - sum_x), - Math.round((y1 - y0) - sum_y)); + move(Math.round((x1 - x0) - sum_x), Math.round((y1 - y0) - sum_y)); } } } - - } + } else { + move(Math.round(Math.round(stitch.x * scale), -Math.round(stitch.y * scale))); + } lastStitch = stitch; hasFirst = true; } @@ -625,16 +628,15 @@ TurtleShepherd.prototype.toDST = function() { dmax = Math.max(Math.abs(x1 - x0), Math.abs(y1 - y0)); dsteps = Math.abs(dmax / 121); + if (!lastStitch.penDown) + encodeTajimaStitch(0,0,false); + if (dsteps <= 1) { encodeTajimaStitch((x1 - x0), (y1 - y0), !stitch.penDown); count_stitches++; } else { for(j=0;j