Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #2293 and #2288 #2294

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions js/pastebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function PasteBox() {
this._container.visible = false;
this._refreshCanvas();
// paste.visible = false;
docById("paste").value = "";
docById("paste").style.visibility = "hidden";
}
};
Expand Down
8 changes: 3 additions & 5 deletions js/turtle.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ function Turtle(name, turtles, drum) {
// FIXME: Add SVG output
if (this.penState && this.hollowState) {
// Convert from turtle coordinates to screen coordinates.
var nx = x2;
var ny = y2;
var ix = this.turtles.turtleX2screenX(this.x);
var iy = this.turtles.turtleY2screenY(this.y);
var fx = this.turtles.turtleX2screenX(x2);
Expand Down Expand Up @@ -217,7 +215,7 @@ function Turtle(name, turtles, drum) {
degreesInitial += 360;
}
// The final heading is the angle between (cp2x, cp2y) and (fx, fy).
var degreesFinal = Math.atan2(nx - cp2x, ny - cp2y);
var degreesFinal = Math.atan2(x2 - cp2x, y2 - cp2y);
degreesFinal = (180 * degreesFinal) / Math.PI;
if (degreesFinal < 0) {
degreesFinal += 360;
Expand Down Expand Up @@ -388,8 +386,8 @@ function Turtle(name, turtles, drum) {
this.container.x = fx;
this.container.y = fy;

// The new heading is the angle between (cp2x, cp2y) and (nx, ny).
var degrees = Math.atan2(nx - cp2x, ny - cp2y);
// The new heading is the angle between (cp2x, cp2y) and (x2, y2).
var degrees = Math.atan2(x2 - cp2x, y2 - cp2y);
degrees = (180 * degrees) / Math.PI;
this.doSetHeading(degrees);
};
Expand Down