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.clearAll();
|
||||||
this.stage.rotateTurtle(this.stage.children[0].heading);
|
this.stage.rotateTurtle(this.stage.children[0].heading);
|
||||||
this.createStatusDisplay();
|
this.createStatusDisplay();
|
||||||
|
// clear stitch cache now (loading projects sends turtle move commands!)
|
||||||
|
this.stage.clearAll();
|
||||||
|
this.stage.turtleShepherd.clear();
|
||||||
this.stage.reRender();
|
this.stage.reRender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,10 @@ TurtleShepherd.prototype.moveTo= function(x1, y1, x2, y2, penState) {
|
||||||
x = Math.round(x);
|
x = Math.round(x);
|
||||||
y = Math.round(y);
|
y = Math.round(y);
|
||||||
|
|
||||||
|
// ignore jump stitches withouth any previous stitches
|
||||||
|
if (this.steps === 0 && !penState)
|
||||||
|
return
|
||||||
|
|
||||||
if (this.steps === 0) {
|
if (this.steps === 0) {
|
||||||
this.initX = x1;
|
this.initX = x1;
|
||||||
this.initY = y1;
|
this.initY = y1;
|
||||||
|
@ -172,9 +176,6 @@ TurtleShepherd.prototype.moveTo= function(x1, y1, x2, y2, penState) {
|
||||||
this.w = this.maxX - this.minX;
|
this.w = this.maxX - this.minX;
|
||||||
this.h = this.maxY - this.minY;
|
this.h = this.maxY - this.minY;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!penState)
|
if (!penState)
|
||||||
this.jumpCount++;
|
this.jumpCount++;
|
||||||
else {
|
else {
|
||||||
|
|
Ładowanie…
Reference in New Issue