kopia lustrzana https://github.com/backface/turtlestitch
fix: add density warning mark to goto also
rodzic
7da6742527
commit
09adb5f484
|
@ -145,6 +145,7 @@ SpriteMorph.prototype.forward = function (steps) {
|
||||||
var dest,
|
var dest,
|
||||||
dist = steps * this.parent.scale || 0;
|
dist = steps * this.parent.scale || 0;
|
||||||
stage = this.parentThatIsA(StageMorph);
|
stage = this.parentThatIsA(StageMorph);
|
||||||
|
warn = false;
|
||||||
|
|
||||||
oldx = this.xPosition();
|
oldx = this.xPosition();
|
||||||
oldy = this.yPosition();
|
oldy = this.yPosition();
|
||||||
|
@ -163,6 +164,7 @@ SpriteMorph.prototype.forward = function (steps) {
|
||||||
oldx, oldy,
|
oldx, oldy,
|
||||||
this.xPosition(), this.yPosition(),
|
this.xPosition(), this.yPosition(),
|
||||||
this.isDown );
|
this.isDown );
|
||||||
|
|
||||||
if (warn) {
|
if (warn) {
|
||||||
this.addDensityPoint(this.xPosition(), this.yPosition());
|
this.addDensityPoint(this.xPosition(), this.yPosition());
|
||||||
}
|
}
|
||||||
|
@ -200,6 +202,7 @@ SpriteMorph.prototype.forwardBy = function (totalsteps, stepsize) {
|
||||||
SpriteMorph.prototype.origGotoXY = SpriteMorph.prototype.gotoXY;
|
SpriteMorph.prototype.origGotoXY = SpriteMorph.prototype.gotoXY;
|
||||||
SpriteMorph.prototype.gotoXY = function (x, y, justMe) {
|
SpriteMorph.prototype.gotoXY = function (x, y, justMe) {
|
||||||
var stage = this.parentThatIsA(StageMorph);
|
var stage = this.parentThatIsA(StageMorph);
|
||||||
|
warn = false;
|
||||||
oldx = this.xPosition();
|
oldx = this.xPosition();
|
||||||
oldy = this.yPosition();
|
oldy = this.yPosition();
|
||||||
this.origGotoXY(x, y, justMe);
|
this.origGotoXY(x, y, justMe);
|
||||||
|
@ -207,14 +210,17 @@ SpriteMorph.prototype.gotoXY = function (x, y, justMe) {
|
||||||
// jump in place - don't add / ignore
|
// jump in place - don't add / ignore
|
||||||
console.log("jump in place - don't add / ignore");
|
console.log("jump in place - don't add / ignore");
|
||||||
} else {
|
} else {
|
||||||
this.parentThatIsA(StageMorph).turtleShepherd.moveTo(
|
warn = this.parentThatIsA(StageMorph).turtleShepherd.moveTo(
|
||||||
oldx, oldy,
|
oldx, oldy,
|
||||||
this.xPosition(), this.yPosition(),
|
this.xPosition(), this.yPosition(),
|
||||||
this.isDown );
|
this.isDown );
|
||||||
|
|
||||||
if (this.isDown)
|
if (this.isDown) {
|
||||||
this.addStitch(oldx, oldy, this.xPosition(), this.yPosition());
|
this.addStitch(oldx, oldy, this.xPosition(), this.yPosition());
|
||||||
else {
|
if (warn) {
|
||||||
|
this.addDensityPoint(this.xPosition(), this.yPosition());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
this.addJumpLine(oldx, oldy, this.xPosition(), this.yPosition());
|
this.addJumpLine(oldx, oldy, this.xPosition(), this.yPosition());
|
||||||
}
|
}
|
||||||
this.addStitchPoint(oldx, oldy, this.xPosition(), this.yPosition());
|
this.addStitchPoint(oldx, oldy, this.xPosition(), this.yPosition());
|
||||||
|
|
Ładowanie…
Reference in New Issue