Fixed leaders on resize

Combined duplicated code to calculate offsets