Pick a random float position between two positions instead of one exactly halfway

This commit is contained in:
Douwe Maan 2017-02-01 15:58:20 -06:00 committed by Phil Hughes
parent ac868482a7
commit be7d978a6a

View file

@ -118,7 +118,7 @@ module RelativePositioning
def position_between(pos_before, pos_after)
pos_before, pos_after = [pos_before, pos_after].sort
pos_before + (pos_after - pos_before) / 2
rand(pos_before.next_float..pos_after.prev_float)
end
def save_positionable_neighbours