calculate height after resize

in addition, tweak the padding so that it doesn't scroll at all
fixes #364