changeset 202:54dd56b9bee6

Some work on board scaling.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Apr 2019 15:50:17 +0300
parents bd3cde4bc15c
children 20231e8bbc43
files game/Engine.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/game/Engine.java	Thu Apr 25 12:58:17 2019 +0300
+++ b/game/Engine.java	Thu Apr 25 15:50:17 2019 +0300
@@ -215,8 +215,8 @@
         g.setPaint(new Color(0.0f, 0.0f, 0.0f, 0.2f));
         g.setStroke(new BasicStroke(5.0f));
         g.draw(new RoundRectangle2D.Float(getScaledX(), getScaledY(),
-            boardSize * pscale, boardSize * pscale,
-            pscale / 5, pscale / 5));
+            boardSize * pscale * scale.x, boardSize * pscale * scale.y,
+            pscale * scale.x / 5, pscale * scale.y / 5));
     }
 
     public void paintBoard(Graphics2D g, boolean drawCurrent)
@@ -229,8 +229,8 @@
                 (!drawCurrent && board[x][y] != currPiece))
             {
                 board[x][y].paint(g,
-                    getScaledX() + (x * pscale),
-                    getScaledY() + (y * pscale),
+                    getScaledX() + (x * pscale * scale.x),
+                    getScaledY() + (y * pscale * scale.y),
                     pscale - pscale / 10);
             }
         }