@@ -166,7 +166,7 @@ public void paintComponent(Graphics g) {
166
166
g2 .setRenderingHint (RenderingHints .KEY_ANTIALIASING , RenderingHints .VALUE_ANTIALIAS_ON );
167
167
g2 .setFont (font );
168
168
g2 .setColor (parent .colorPalette .get (0 ));
169
- g2 .drawString (msg , 50 , 50 );
169
+ g2 .drawString (msg , 50 , 50 + charHeight );
170
170
g2 .setRenderingHint (RenderingHints .KEY_ANTIALIASING , RenderingHints .VALUE_ANTIALIAS_OFF );
171
171
}
172
172
@@ -312,14 +312,14 @@ protected void drawTile(Graphics2D g2, int row, int col) {
312
312
int x0 = x + gridLineWidth , y0 = y + gridLineWidth , s = tileSize - gridLineWidth * 2 ;
313
313
314
314
Point p = new Point (row , col );
315
- if (p .equals (highlight )) {
315
+ if (type != '\0' ) {
316
+ drawTileType (g2 , type , x0 , y0 , s , color0 , color1 , parent .colorPalette .get (-1 ));
317
+ } else if (p .equals (highlight )) {
316
318
g2 .setColor (parent .colorPalette .get (6 ));
317
319
g2 .fillRect (x , y , s + gridLineWidth * 2 , s + gridLineWidth * 2 );
318
320
} else if (sample != null && p .equals (getBoardPosition (sample .x , sample .y ))) {
319
321
g2 .setColor (parent .colorPalette .get (board .getTurn ()? 4 : 3 ));
320
322
g2 .fillRect (x , y , s + gridLineWidth * 2 , s + gridLineWidth * 2 );
321
- } else {
322
- drawTileType (g2 , type , x0 , y0 , s , color0 , color1 , parent .colorPalette .get (-1 ));
323
323
}
324
324
325
325
g2 .setStroke (new BasicStroke (gridLineWidth ));
@@ -428,8 +428,6 @@ public void mouseDragged(MouseEvent e) {
428
428
@ Override
429
429
public void mouseMoved (MouseEvent e ) {
430
430
if (!isBoardRunning ()) {
431
- sample = null ;
432
- highlight = null ;
433
431
return ;
434
432
}
435
433
if (inSample (e .getPoint ())) {
0 commit comments