Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit df9e5a1

Browse files
Chapter 08 coordinates bug in rendering fixed.
1 parent c364f1f commit df9e5a1

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

‎08-Move-the-Box-Solver/03-Move-the-Box-Solver-Rendering/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void paintComponent(Graphics g) {
9393

9494
Color color = colorMap.get(c);
9595
AlgoVisHelper.setColor(g2d, color);
96-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
96+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
9797

9898
}
9999
}

‎08-Move-the-Box-Solver/04-Backtrack-to-Solve-Move-the-Box/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void paintComponent(Graphics g) {
9797

9898
Color color = colorMap.get(c);
9999
AlgoVisHelper.setColor(g2d, color);
100-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
100+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
101101

102102
}
103103
}

‎08-Move-the-Box-Solver/05-Drop/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void paintComponent(Graphics g) {
9797

9898
Color color = colorMap.get(c);
9999
AlgoVisHelper.setColor(g2d, color);
100-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
100+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
101101

102102
}
103103
}

‎08-Move-the-Box-Solver/06-Match/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void paintComponent(Graphics g) {
9797

9898
Color color = colorMap.get(c);
9999
AlgoVisHelper.setColor(g2d, color);
100-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
100+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
101101

102102
}
103103
}

‎08-Move-the-Box-Solver/07-Show-the-Results/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void paintComponent(Graphics g) {
9393

9494
Color color = colorMap.get(c);
9595
AlgoVisHelper.setColor(g2d, color);
96-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
96+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
9797

9898
AlgoVisHelper.setColor(g2d, AlgoVisHelper.White);
9999
String text = String.format("( %d , %d )", i, j);

‎08-Move-the-Box-Solver/Chapter-08-Completed-Codes/Move-the-Box-Solver/src/AlgoFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void paintComponent(Graphics g) {
9393

9494
Color color = colorMap.get(c);
9595
AlgoVisHelper.setColor(g2d, color);
96-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
96+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
9797

9898
AlgoVisHelper.setColor(g2d, AlgoVisHelper.White);
9999
String text = String.format("( %d , %d )", i, j);

‎08-Move-the-Box-Solver/Optional-01-Move-the-Box-Solver-with-Interactions/src/AlgoFrame.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void paintComponent(Graphics g) {
9797

9898
Color color = colorMap.get(c);
9999
AlgoVisHelper.setColor(g2d, color);
100-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
100+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
101101

102102
AlgoVisHelper.setColor(g2d, AlgoVisHelper.White);
103103
String text = String.format("( %d , %d )", i, j);
@@ -107,7 +107,7 @@ public void paintComponent(Graphics g) {
107107
if( i == data.clickx && j == data.clicky) {
108108
AlgoVisHelper.setColor(g2d, AlgoVisHelper.LightBlue);
109109
AlgoVisHelper.setStrokeWidth(g2d, 4);
110-
AlgoVisHelper.strokeRectangle(g2d, j * h + 2, i * w + 2, w - 4, h - 4);
110+
AlgoVisHelper.strokeRectangle(g2d, j * w + 2, i * h + 2, w - 4, h - 4);
111111
}
112112
}
113113
}

‎08-Move-the-Box-Solver/Optional-02-Move-the-Box-Solver-Using-HashSet/src/AlgoFrame.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void paintComponent(Graphics g) {
9797

9898
Color color = colorMap.get(c);
9999
AlgoVisHelper.setColor(g2d, color);
100-
AlgoVisHelper.fillRectangle(g2d, j*h+2, i*w+2, w-4, h-4);
100+
AlgoVisHelper.fillRectangle(g2d, j*w+2, i*h+2, w-4, h-4);
101101

102102
AlgoVisHelper.setColor(g2d, AlgoVisHelper.White);
103103
String text = String.format("( %d , %d )", i, j);
@@ -107,7 +107,7 @@ public void paintComponent(Graphics g) {
107107
if( i == data.clickx && j == data.clicky) {
108108
AlgoVisHelper.setColor(g2d, AlgoVisHelper.LightBlue);
109109
AlgoVisHelper.setStrokeWidth(g2d, 4);
110-
AlgoVisHelper.strokeRectangle(g2d, j * h + 2, i * w + 2, w - 4, h - 4);
110+
AlgoVisHelper.strokeRectangle(g2d, j * w + 2, i * h + 2, w - 4, h - 4);
111111
}
112112
}
113113
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /