# HG changeset patch # User Matti Hamalainen # Date 1296758254 -7200 # Node ID 6f6c551cc14c382b4e81c851aa1454ef2bcbe8ac # Parent 14f1abf53d8dc9246bb2cbe42548ad1bab50606a Fix piece connections rendering. diff -r 14f1abf53d8d -r 6f6c551cc14c game/Piece.java --- a/game/Piece.java Thu Feb 03 18:24:30 2011 +0200 +++ b/game/Piece.java Thu Feb 03 20:37:34 2011 +0200 @@ -107,6 +107,7 @@ float step = dim / 10; switch (index) { + // Normal line starting and ending points case 0: ox = 3.0f; oy = 0.4f; break; case 1: ox = 7.0f; oy = 0.4f; break; case 2: ox = 9.6f; oy = 3.0f; break; @@ -116,12 +117,13 @@ case 6: ox = 0.4f; oy = 7.0f; break; case 7: ox = 0.4f; oy = 3.0f; break; + // Matching control points for each point above (+8) case 8: ox = 3.0f; oy = 3.0f; break; case 9: ox = 7.0f; oy = 3.0f; break; case 10: ox = 7.0f; oy = 3.0f; break; case 11: ox = 7.0f; oy = 7.0f; break; case 12: ox = 7.0f; oy = 7.0f; break; - case 13: ox = 7.0f; oy = 7.0f; break; + case 13: ox = 3.0f; oy = 7.0f; break; case 14: ox = 3.0f; oy = 7.0f; break; case 15: ox = 3.0f; oy = 3.0f; break; } @@ -202,9 +204,6 @@ g.fill(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10)); - g.setPaint(Color.black); - g.setStroke(new BasicStroke(5.0f)); - g.draw(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10)); if (type == PieceType.START) return; @@ -243,5 +242,9 @@ drawn[i] = true; drawn[connections[i]] = true; } + + g.setPaint(Color.black); + g.setStroke(new BasicStroke(5.0f)); + g.draw(new RoundRectangle2D.Float(x, y, dim, dim, dim / 10, dim / 10)); } }