kopia lustrzana https://github.com/backface/turtlestitch
ingore leading jump stitches and clear cache on project loading
rodzic
aaabf734fc
commit
d831ae27d6
|
@ -162,6 +162,9 @@ IDE_Morph.prototype.rawOpenProjectString = function (str) {
|
|||
this.stage.clearAll();
|
||||
this.stage.rotateTurtle(this.stage.children[0].heading);
|
||||
this.createStatusDisplay();
|
||||
// clear stitch cache now (loading projects sends turtle move commands!)
|
||||
this.stage.clearAll();
|
||||
this.stage.turtleShepherd.clear();
|
||||
this.stage.reRender();
|
||||
};
|
||||
|
||||
|
|
|
@ -121,6 +121,10 @@ TurtleShepherd.prototype.moveTo= function(x1, y1, x2, y2, penState) {
|
|||
x = Math.round(x);
|
||||
y = Math.round(y);
|
||||
|
||||
// ignore jump stitches withouth any previous stitches
|
||||
if (this.steps === 0 && !penState)
|
||||
return
|
||||
|
||||
if (this.steps === 0) {
|
||||
this.initX = x1;
|
||||
this.initY = y1;
|
||||
|
@ -171,9 +175,6 @@ TurtleShepherd.prototype.moveTo= function(x1, y1, x2, y2, penState) {
|
|||
|
||||
this.w = this.maxX - this.minX;
|
||||
this.h = this.maxY - this.minY;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!penState)
|
||||
this.jumpCount++;
|
||||
|
|
Ładowanie…
Reference in New Issue