src/parse-map.js
function convertShapesToCoords(shapes) {
  var tile_width = 40;

  var new_shapes = map2d(shapes, function(loc) {
    // It would be loc.r + 1 and loc.c + 1 but that has been removed
    // to account for the one-tile width of padding added in doParse.
    var row = loc.r * tile_width;
    var col = loc.c * tile_width;
    return {x: row, y: col}
  });
  return new_shapes;
}
function convertShapesToCoords(shapes) {
  var tile_width = 40;

  var new_shapes = map2d(shapes, function(loc) {
    // It would be loc.r + 1 and loc.c + 1 but that has been removed
    // to account for the one-tile width of padding added in doParse.
    var row = loc.r * tile_width;
    var col = loc.c * tile_width;
    return {x: row, y: col}
  });
  return new_shapes;
}
function convertShapesToCoords ( shapes ) { var tile_width = 40 ; var new_shapes = map2d ( shapes , function ( loc ) { // It would be loc.r + 1 and loc.c + 1 but that has been removed // to account for the one-tile width of padding added in doParse. var row = loc . r * tile_width ; var col = loc . c * tile_width ; return { x : row , y : col } } ) ; return new_shapes ; }
Takes in an array of shapes and converts from contour grid layout
to actual coordinates.
@private
@param {Array.<Array.<ArrayLoc>>} shapes - output from generateShapes
@return {Array.<Array.<{{x: number, y: number}}>>}
Takes in an array of shapes and converts from contour grid layout to actual coordinates .