From bf25532d0128dfd835e2daf5a5544697b0089e0e Mon Sep 17 00:00:00 2001
From: Jason Long <jason@long.name>
Date: Sat, 2 Aug 2014 20:31:49 -0400
Subject: [PATCH] gui: draw tool cursor using fillRect rather than drawLine

this should help with higher-resolution displays where the stroke
behavior can be unpredictable. It works better to use filled
shapes which are more predictable.
---
 .../gui/MicropolisDrawingArea.java            | 22 ++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/micropolisj/gui/MicropolisDrawingArea.java b/src/micropolisj/gui/MicropolisDrawingArea.java
index f353f1c..0ff67a7 100644
--- a/src/micropolisj/gui/MicropolisDrawingArea.java
+++ b/src/micropolisj/gui/MicropolisDrawingArea.java
@@ -219,20 +219,22 @@ public class MicropolisDrawingArea extends JComponent
 			int y1 = (toolCursor.rect.y + toolCursor.rect.height) * TILE_HEIGHT;
 
 			gr.setColor(Color.BLACK);
-			gr.drawLine(x0-1,y0-1,x0-1,y1-1);
-			gr.drawLine(x0-1,y0-1,x1-1,y0-1);
-			gr.drawLine(x1+3,y0-3,x1+3,y1+3);
-			gr.drawLine(x0-3,y1+3,x1+3,y1+3);
+			gr.fillRect(x0-1, y0-1, x1-(x0-1), 1);
+			gr.fillRect(x0-1, y0, 1, y1-y0);
+			gr.fillRect(x0-3, y1+3, x1+4-(x0-3), 1);
+			gr.fillRect(x1+3, y0-3, 1, y1+3-(y0-3));
 
 			gr.setColor(Color.WHITE);
-			gr.drawLine(x0-4,y0-4,x1+3,y0-4);
-			gr.drawLine(x0-4,y0-4,x0-4,y1+3);
-			gr.drawLine(x1,  y0-1,x1,  y1  );
-			gr.drawLine(x0-1,y1,  x1,  y1  );
+			gr.fillRect(x0-4, y0-4, x1+4-(x0-4), 1);
+			gr.fillRect(x0-4, y0-3, 1, (y1+4)-(y0-3));
+			gr.fillRect(x0-1, y1, x1+1-(x0-1), 1);
+			gr.fillRect(x1, y0-1, 1, y1-(y0-1));
 
 			gr.setColor(toolCursor.borderColor);
-			gr.drawRect(x0-3,y0-3,x1-x0+5,y1-y0+5);
-			gr.drawRect(x0-2,y0-2,x1-x0+3,y1-y0+3);
+			gr.fillRect(x0-3, y0-3, x1+1-(x0-3), 2);
+			gr.fillRect(x1+1, y0-3, 2, y1+1-(y0-3));
+			gr.fillRect(x0-1, y1+1, x1+3-(x0-1), 2);
+			gr.fillRect(x0-3, y0-1, 2, y1+3-(y0-1));
 
 			if (toolCursor.fillColor != null) {
 				gr.setColor(toolCursor.fillColor);