(directions, grid, opt)
| 352 | |
| 353 | // fix direction offsets according to current grid |
| 354 | function getGridOffsets(directions, grid, opt) { |
| 355 | |
| 356 | var step = opt.step; |
| 357 | |
| 358 | util.toArray(opt.directions).forEach(function(direction) { |
| 359 | |
| 360 | direction.gridOffsetX = (direction.offsetX / step) * grid.x; |
| 361 | direction.gridOffsetY = (direction.offsetY / step) * grid.y; |
| 362 | }); |
| 363 | } |
| 364 | |
| 365 | // get grid size in x and y dimensions, adapted to source and target positions |
| 366 | function getGrid(step, source, target) { |