From 04012a246e14c8ce22de2c06d99ea38e41a60b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Tue, 2 Feb 2021 18:03:34 +0100 Subject: bugfix x compared to height --- src/se/liu/gusso230/tetris/TetrisComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/se/liu/gusso230/tetris/TetrisComponent.java b/src/se/liu/gusso230/tetris/TetrisComponent.java index 898851a..cecce16 100644 --- a/src/se/liu/gusso230/tetris/TetrisComponent.java +++ b/src/se/liu/gusso230/tetris/TetrisComponent.java @@ -20,7 +20,7 @@ public class TetrisComponent extends JComponent { final Graphics2D g2d = (Graphics2D) g; for (int y = 0; y < board.getHeight(); y++) { - for (int x = 0; x < board.getHeight(); x++) { + for (int x = 0; x < board.getWidth(); x++) { g.setColor(getColor(x, y)); g.fillRect(x * (TILE_SIZE + TILE_GAP), y * (TILE_SIZE + TILE_GAP), TILE_SIZE, TILE_SIZE); } -- cgit v1.2.1