jwfwessels / AFK

Automated Battle Ground.
MIT License
1 stars 1 forks source link

Arena panel does not fit window. #4

Closed danini-the-panini closed 11 years ago

danini-the-panini commented 11 years ago

Description:

When running a game, the Arena Panel does not match the size of its container. Rather, the panel remains at its original size of 1280x768, as observed by the following output:

Resized. New width = 1280 and new height = 768.

The following image showcases the problem: image

Note: The following line in Tokyo.java may have to be commented out to test this bug (depending on your window manager):

jFrame.setResizable(false);

Affects Area:

danini-the-panini commented 11 years ago

Fixed the problem using the following dodgy hack:

pnlArena.addComponentListener(new ComponentAdapter() {

    @Override
    public void componentResized(ComponentEvent e)
    {
        super.componentResized(e);
        glCanvas.setSize(pnlArena.getSize());
    }
});

The fix is currently in branch athensCleanup

danini-the-panini commented 11 years ago

Fix has been merged with master.

danini-the-panini commented 11 years ago

This bug is present again since the GUI refactor.

jwfwessels commented 11 years ago

added a check too the layout manager that only sets he component sizes if the container size has changed. default swing behaviour was causing reshape in Athens to be called almost constantly