I came up with the numbers in 9fd2bbd (which is a simple first step). @stewsmith added these to deal with multiple directions, padding etc. These numbers should be rewritten as (1 + paddingRight) or (1 + distanceFromPointer) etc where appropriate.