Fixed boxlayout spacing calculation, as it was adding an extra spacing amount than it should have