Skip to content

Commit 6e56803

Browse files
committed
First travel move wrong color
First travel move was appearing in white instead of the travel color.
1 parent 7869d7a commit 6e56803

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

Changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## 7.78.4
10+
### Fixed
11+
- First travel move was appearing in white instead of the travel color.
12+
13+
## 7.78.5
14+
15+
### Added
16+
- Drag + drop a file now adds that file to the "Recent Files" list.
1117

1218
### Fixed
1319
- MickeyMoe1992 now properly obeys the margin limits, same as the other converters.

src/main/java/com/marginallyclever/makelangelo/turtle/turtlerenderer/DefaultTurtleRenderer.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class DefaultTurtleRenderer implements TurtleRenderer {
2424
public void start(Graphics2D g2) {
2525
this.g2 = g2;
2626

27-
isPenUp = true;
27+
makePenUp();
2828
// set pen diameter
2929
g2.setStroke(new BasicStroke(penDiameter, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
3030
}
@@ -34,29 +34,29 @@ public void end() {}
3434

3535
@Override
3636
public void draw(Point2d p0, Point2d p1) {
37-
if(isPenUp) {
38-
g2.setColor(colorDraw);
39-
isPenUp = false;
40-
}
41-
37+
if(isPenUp) makePenDown();
4238
line.setLine(p0.x, p0.y, p1.x, p1.y);
4339
g2.draw(line);
4440
}
4541

4642
@Override
4743
public void travel(Point2d p0, Point2d p1) {
48-
if(!isPenUp) {
49-
isPenUp = true;
50-
if(showTravel) {
51-
g2.setColor(colorTravel);
52-
}
53-
}
44+
if(!isPenUp) makePenUp();
5445
if(!showTravel) return;
55-
5646
line.setLine(p0.x, p0.y, p1.x, p1.y);
5747
g2.draw(line);
5848
}
5949

50+
private void makePenUp() {
51+
isPenUp = true;
52+
g2.setColor(colorTravel);
53+
}
54+
55+
private void makePenDown() {
56+
isPenUp = false;
57+
g2.setColor(colorDraw);
58+
}
59+
6060
@Override
6161
public void setPenDownColor(Color color) {
6262
colorDraw = color;

src/main/java/com/marginallyclever/makelangelo/turtle/turtlerenderer/DirectionLoopTurtleRenderer.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ private void drawPoints() {
6060
@Override
6161
public void travel(Point2d p0, Point2d p1) {
6262
drawPoints();
63-
if(showTravel) {
64-
gl2.setColor(colorTravel);
65-
line.setLine(p0.x, p0.y, p1.x, p1.y);
66-
gl2.draw(line);
67-
}
63+
if(!showTravel) return;
64+
gl2.setColor(colorTravel);
65+
line.setLine(p0.x, p0.y, p1.x, p1.y);
66+
gl2.draw(line);
6867
}
6968

7069
@Override

0 commit comments

Comments
 (0)