From 4baf5724eb9adedb37f89ead9902360a0e091fee Mon Sep 17 00:00:00 2001 From: rxbn Date: Tue, 19 Nov 2019 13:52:54 +0100 Subject: [PATCH] hotfix: no window size fix resulted in ball out of border. --- src/break_out/model/Ball.java | 2 +- src/break_out/view/View.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/break_out/model/Ball.java b/src/break_out/model/Ball.java index af1cbf8..905bf78 100644 --- a/src/break_out/model/Ball.java +++ b/src/break_out/model/Ball.java @@ -75,7 +75,7 @@ public class Ball implements IBall{ if(this.position.getY() < 0) this.direction.setDy(-(this.direction.getDy())); // bottom border - if(this.position.getY()+2*Constants.BALL_DIAMETER > Constants.SCREEN_HEIGHT) this.direction.setDy(-(this.direction.getDy())); + if(this.position.getY()+Constants.BALL_DIAMETER > Constants.SCREEN_HEIGHT) this.direction.setDy(-(this.direction.getDy())); } } diff --git a/src/break_out/view/View.java b/src/break_out/view/View.java index e559199..8b1de7b 100644 --- a/src/break_out/view/View.java +++ b/src/break_out/view/View.java @@ -72,7 +72,7 @@ public class View extends JFrame { pack(); // hotfix: screen size - setMinimumSize(new Dimension((int) Constants.SCREEN_WIDTH, (int) Constants.SCREEN_HEIGHT)); + setMinimumSize(new Dimension(1, 1)); } /**