diff options
Diffstat (limited to 'src/MapScene.java')
-rw-r--r-- | src/MapScene.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/MapScene.java b/src/MapScene.java index af86431..7ed8e3b 100644 --- a/src/MapScene.java +++ b/src/MapScene.java @@ -46,15 +46,14 @@ public abstract class MapScene extends Scene implements ActionListener { protected int maxSize; protected AffineTransform tx = new AffineTransform(); - public MapScene(JFrame frame) { - super(frame); - + public MapScene() { + super(); //this.map = new Map(new Dimension(10, 10)); } @Override protected void render() { - if (this.WIDTH < this.HEIGHT) { + if (this.canvasSize.width < this.canvasSize.height) { this.maxSize = WIDTH; } else { this.maxSize = HEIGHT; @@ -68,7 +67,7 @@ public abstract class MapScene extends Scene implements ActionListener { Graphics2D g = (Graphics2D) this.buffer.getDrawGraphics(); //clear g.setColor(Palette.BLACK); - g.fillRect(0, 0, this.WIDTH, this.HEIGHT); + g.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height); //zoom and pan if (this.zooming) { |