Map resizing, how to get a perfect fit?

On the subject of pop up windows (=map windows which a open/close button in the toolbar), I have made tests with simple empty maps containing only just one board.

It seems that some combinations of (witdth x height) are liked by Vassal (no grey space anywhere, perfect window fit), while others are not. I don’t understand why that is so and if there is a rationale behind it. The “accepted” combinations might even be screen dependent.

For example, on my screen (a 19" widescreen type monitor with resolution set at 1600x900) I have perfect fits with windows matching some supported resolutions on my screen, such as 800x600, 1024x768, 1280x720, 1360x768.

No such luck, instead, for random combinations I tried like

a) 100x100 and 500x300 (showing bottom and right edge extra “grey” screen),

b) 300x500 and 500x500 (showing extra “grey” screen at the bottom, but not to the right),

c) 1280x1024 and 1440x900 (both supported resolution on my screen, which one could expect to show only a right edge scrollbar for vertical scrolling, but instead also show narrower then required with a bottom scrollbar for horizontal scrolling)

I have attached a simple test module showcasing this. Just click on the various “1024x768”, “500x500” windows to see the extra grey space.

[attachment=0]mapsize_test.vmod[/attachment]

Is there any rule behind this behaviour?

Thanks.

Vassal does not scale graphics to match screen resolutions, never has, never will. It is not like a computer game in that respect which will resize everything to work perfectly.

Put another way, if you have a map that is 800 x 600 pixels its going to fit an 800 X 600 pixel resolution screen perfectly (well nearly when you consider program border etc…) but viewing it on a 1600 X 1000, it is still going to be a 800 X 600 image, on a 1024 X 768 it is still a 800 X 600 image and so on… it hasn’t been scaled, altered, resampled etc…

To compensate in Vassal we add the Zoom functionality which is really just an area focus scaling/magnification feature - you are never actually altering the images to fit the screen. It’s just not that fancy, so you are going to see the effect you are describing on different screen resolutions.

Generally the best thing that can be done is pick a size, go with it and leave it to the user to alter the zoom to their preferences be it view at 100%, 50%, fit all, fit width, fit height etc…

Tim, I think you missed my point here ;)

My point was:

I have a 500x500 board (single board on a pop up map). Vassal will add extra space at the bottom.

I have a 1280x1024 board (and my screen is set at 1600x900, thus horizontally it should fit with room to spare) and Vassal opens it smaller than expected and forces me to use horizontal scrollbar.

I have other examples like those, see test module.

Do you know why is that so? Is there a magic formula one should know to calculate Vassal-friendly (or Java-friendly) board sizes so that the window will open nicely, i.e. without extra space to the sides or scrollbars (if the user screen resolution is enough for it)?

That was my point.

I was just mentioning that, oddly as it might sound, 800x600, 1024x768, 1280x720… work perfectly well (=perfect fit) and as it happens they are well known standard screen resolutions for most graphic cards and display devices. Just coincidence?

they all open fine perfectly for me with no scroll bars or extra space. Therefore I dont see what your issue is

Actually I do see what you mean but only with the 100 X 100 size (small I missed it behind all the bigger ones) Seems there is space around top and bottom, no scroll bars though. Trying to resize to fit is not possible either so looks like there is a minimum window size that is larger than 100 X 100, but all the others are fine though

Well, not only 100x100 but also 500x500, 300x500, 500x300 etc don’t open fine on my screen, see original post.

I tried also changing the screen resolution to a more standard 1280x720 or 1024x768 even and same problem. However, even with 1024x768 (4:3) my screen/graphic card stretches it to display as 16:9, so that might be the issue.

I tried with my laptop, a 16:9 widescreen set at 1366x768 and I have exact same issues (with 1024x768 starting to show a horizontal bar which could/should not be there, instead of 1440x900 like on the bigger screen…).

Tested with both 3.1.18 and 3.2 build 8096. Windows 64 bit and Windows 32 bit.

What about you? Linux? Mac?

Thus spake barbanera:

On the subject of pop up windows (=map windows which a open/close button
in the toolbar), I have made tests with simple empty maps containing
only just one board.

It seems that some combinations of (witdth x height) are liked by Vassal
(no grey space anywhere, perfect window fit), while others are not. I
don’t understand why that is so and if there is a rationale behind it.
The “accepted” combinations might even be screen dependent.

For example, on my screen (a 19" widescreen type monitor with resolution
set at 1600x900) I have perfect fits with windows matching some
supported resolutions on my screen, such as 800x600, 1024x768, 1280x720,
1360x768.

No such luck, instead, for random combinations I tried like

a) 100x100 and 500x300 (showing bottom and right edge extra “grey”
screen),

b) 300x500 and 500x500 (showing extra “grey” screen at the bottom, but
not to the right),

c) 1280x1024 and 1440x900 (both supported resolution on my screen, which
one could expect to show only a right edge scrollbar for vertical
scrolling, but instead also show narrower then required with a bottom
scrollbar for horizontal scrolling)

I have attached a simple test module showcasing this. Just click on the
various “1024x768”, “500x500” windows to see the extra grey space.

All except the one which is taller than my laptop pannel is high showed
up packed tight, with no borders. (The tall one had scroll bars.) I’m
running GNOME3 (blech!) on Linux right now, with OpenJDK 1.6.0_24.

Is there any rule behind this behaviour?

So far as I know, some combination of your window manager and JVM are
deciding how to size these windows.


J.

Althought the test module in question do opens normally on my PC, I have experienced what the original poster is saying. I have a module I’m working on right now that simply doesn’t work at the right dimension.

I think that it has some caching involved, as I noticed that if I create a map that is 500x500 and later increase that size, the window still opens as 500x500. If I remove the module from VASSAL (fully remove, not just quit) and later reload it, it does work.