The effect of star–disc interactions on the binary mass-ratio distribution