ingore leading jump stitches and clear cache on project loading

upd4.2
Michael Aschauer 2017-11-06 11:54:32 +01:00
rodzic aaabf734fc
commit d831ae27d6
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -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();
};

Wyświetl plik

@ -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++;