paintButtons: fix auto-spacing of buttins / labels

in space-restricted setups, buttons would be painted outside
of the assigned space due to errors in position calculations