aboutsummaryrefslogtreecommitdiffstats
path: root/library/place_on_line.moon
blob: 0d806bea6b2b337a5e375f72c26c28b7fb31c8b8 (plain)
1
2
3
4
5
6
7
8
9
10
=>
  input.selection @objs
  input.line @dest

  dest = @dest!
  step = (dest.to - dest.frm) / #@objs!

  for i, obj in ipairs @objs!
    pos = dest.frm + step * (i - .5)
    op.move obj, pos