calculate the correct height for resizing badges (fixes #153)