From 1ba10b1f87bbf535e0f41b819e934865c3ed4cdd Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Sun, 13 Jan 2019 15:15:39 -0500 Subject: [PATCH] renaming things --- src/cartographerFlatXY.js | 4 ++-- src/cartographerFlatXYZ.js | 4 ++-- src/cartographerPointyXY.js | 4 ++-- src/cartographerPointyXYZ.js | 4 ++-- src/main.js | 20 ++++++++++---------- src/tessellate.js | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/cartographerFlatXY.js b/src/cartographerFlatXY.js index 882452f..661d9a4 100644 --- a/src/cartographerFlatXY.js +++ b/src/cartographerFlatXY.js @@ -7,8 +7,8 @@ import Point from './point.js'; import Square from './square.js'; const tilePointToSquare = ({tilePoint, mapPoint, pixelPoint}) => ({ - tilePoint: tilePoint instanceof Square ? tilePoint : new Square(tilePoint), - mapPoint: mapPoint instanceof Square ? mapPoint : new Square(mapPoint), + tile: tilePoint instanceof Square ? tilePoint : new Square(tilePoint), + mapTile: mapPoint instanceof Square ? mapPoint : new Square(mapPoint), pixelPoint, }); diff --git a/src/cartographerFlatXYZ.js b/src/cartographerFlatXYZ.js index 209915b..23bbdb1 100644 --- a/src/cartographerFlatXYZ.js +++ b/src/cartographerFlatXYZ.js @@ -7,8 +7,8 @@ import Hex from './hex.js'; import Point from './point.js'; const tilePointToHex = ({tilePoint, mapPoint, pixelPoint}) => ({ - tilePoint: tilePoint instanceof Hex ? tilePoint : new Hex(tilePoint), - mapPoint: mapPoint instanceof Hex ? mapPoint : new Hex(mapPoint), + tile: tilePoint instanceof Hex ? tilePoint : new Hex(tilePoint), + mapTile: mapPoint instanceof Hex ? mapPoint : new Hex(mapPoint), pixelPoint, }); diff --git a/src/cartographerPointyXY.js b/src/cartographerPointyXY.js index e6cdf8e..5215fed 100644 --- a/src/cartographerPointyXY.js +++ b/src/cartographerPointyXY.js @@ -7,8 +7,8 @@ import Square from './square.js'; import Point from './point.js'; const tilePointToSquare = ({tilePoint, mapPoint, pixelPoint}) => ({ - tilePoint: tilePoint instanceof Square ? tilePoint : new Square(tilePoint), - mapPoint: mapPoint instanceof Square ? mapPoint : new Square(mapPoint), + tile: tilePoint instanceof Square ? tilePoint : new Square(tilePoint), + mapTile: mapPoint instanceof Square ? mapPoint : new Square(mapPoint), pixelPoint, }); diff --git a/src/cartographerPointyXYZ.js b/src/cartographerPointyXYZ.js index 85a5296..6a7a2f1 100644 --- a/src/cartographerPointyXYZ.js +++ b/src/cartographerPointyXYZ.js @@ -7,8 +7,8 @@ import Hex from './hex.js'; import Point from './point.js'; const tilePointToHex = ({tilePoint, mapPoint, pixelPoint}) => ({ - tilePoint: tilePoint instanceof Hex ? tilePoint : new Hex(tilePoint), - mapPoint: mapPoint instanceof Hex ? mapPoint : new Hex(mapPoint), + tile: tilePoint instanceof Hex ? tilePoint : new Hex(tilePoint), + mapTile: mapPoint instanceof Hex ? mapPoint : new Hex(mapPoint), pixelPoint, }); diff --git a/src/main.js b/src/main.js index 4448b2e..2072350 100644 --- a/src/main.js +++ b/src/main.js @@ -225,17 +225,17 @@ class Demo { return tile; } - drawTile(pointGroup, context, scale) { - const pixelX = pointGroup.pixelPoint.getX(); - const pixelY = pointGroup.pixelPoint.getY(); + drawTile(locationSet, context, scale) { + const pixelX = locationSet.pixelPoint.getX(); + const pixelY = locationSet.pixelPoint.getY(); this.counts[0] += 1; - const key = keyTemplate(pointGroup.mapPoint); + const key = keyTemplate(locationSet.mapTile); this.map[key] = this.map[key] || this.createTile({ - x: pointGroup.mapPoint.x, - y: pointGroup.mapPoint.y, + x: locationSet.mapTile.x, + y: locationSet.mapTile.y, drawStyle: this.settings.style, tileStyle: this.settings.tile, orientation: this.settings.orientation, @@ -270,7 +270,7 @@ class Demo { } } - draw({context, height, width, scale, pointGroups, now, lastNow}) { + draw({context, height, width, scale, locationSets, now, lastNow}) { this.counts = [ 0, // tiles 0, // pips @@ -283,9 +283,9 @@ class Demo { blue: 128, }); - pointGroups - .filter(pointGroup => pointGroup.mapPoint) - .forEach(pointGroup => this.drawTile(pointGroup, context, scale)); + locationSets + .filter(locationSet => locationSet.mapTile) + .forEach(locationSet => this.drawTile(locationSet, context, scale)); this.ripples.forEach(({timestamp, cell}) => { const pressFactor = Math.min((now - timestamp) / PRESS_RIPPLE, 1); diff --git a/src/tessellate.js b/src/tessellate.js index 0870b24..ce5c648 100644 --- a/src/tessellate.js +++ b/src/tessellate.js @@ -87,7 +87,7 @@ export class Tessellate { 'zoom', 'pixelToTile', 'tileToPixel', - 'getTilePoints', + 'getLocationSets', 'draw', 'resize', 'remap', @@ -234,7 +234,7 @@ export class Tessellate { return this.cartographer.tileToPixel(tilePoint); } - getTilePoints ({upperLeftX, upperLeftY, lowerRightX, lowerRightY}) { + getLocationSets ({upperLeftX, upperLeftY, lowerRightX, lowerRightY}) { const upperLeft = new Point(upperLeftX, upperLeftY); const upperRight = new Point(lowerRightX, 0); const lowerLeft = new Point(0, lowerRightY); @@ -255,7 +255,7 @@ export class Tessellate { lowerRightY: height }; - const pointGroups = this.getTilePoints(corners); + const locationSets = this.getLocationSets(corners); this.settings.draw({ context, @@ -266,7 +266,7 @@ export class Tessellate { lastNow: context.lastUTC, now: context.utc, - pointGroups, + locationSets, }); }