MCPcopy
hub / github.com/clientIO/joint / getGridOffsets

Function getGridOffsets

packages/joint-core/src/routers/manhattan.mjs:354–363  ·  view source on GitHub ↗
(directions, grid, opt)

Source from the content-addressed store, hash-verified

352
353// fix direction offsets according to current grid
354function 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
366function getGrid(step, source, target) {

Callers 1

findRouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected