fix remaining space calculation
fix remaining space calculation

This was ported from some C/C++ code that I think was doing it this way
for a specific (and probably silly) reason which might not apply anymore.

gered/gdx-toolbox