James
When the user drags KeyNo 12 over KeyNo 20, the dragged item has to sit between 19 and 20. So I am changing KeyNo 12 as 19.5.
Assume the user drags 10 over 20 again. Then KeyNo 10 is to be changed to a number between 19.5 and 20 ( 19.75 ). Another drag over 20 again? The new key number will be 19.875 and so on.
I chose more decimal places so that we dont hit a dead end soon.
In real time application, if we hit deadend our logic should renumber.
Hope I am clear