Fix nomenclature of point scale/unscale methods, see #3570

This commit is contained in:
Iván Sánchez Ortega 2015-06-30 15:13:08 +02:00
parent c38159d986
commit 56be19a42d
2 changed files with 6 additions and 6 deletions

View File

@ -55,11 +55,11 @@ L.Point.prototype = {
return this; return this;
}, },
dotProduct: function(point) { scaleBy: function(point) {
return new L.Point(this.x * point.x, this.y * point.y); return new L.Point(this.x * point.x, this.y * point.y);
}, },
dotDivision: function(point) { unscaleBy: function(point) {
return new L.Point(this.x / point.x, this.y / point.y); return new L.Point(this.x / point.x, this.y / point.y);
}, },

View File

@ -513,7 +513,7 @@ L.GridLayer = L.Layer.extend({
var map = this._map, var map = this._map,
tileSize = this.getTileSize(), tileSize = this.getTileSize(),
nwPoint = coords.dotProduct(tileSize), nwPoint = coords.scaleBy(tileSize),
sePoint = nwPoint.add(tileSize), sePoint = nwPoint.add(tileSize),
nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)), nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)),
@ -644,7 +644,7 @@ L.GridLayer = L.Layer.extend({
}, },
_getTilePos: function (coords) { _getTilePos: function (coords) {
return coords.dotProduct(this.getTileSize()).subtract(this._level.origin); return coords.scaleBy(this.getTileSize()).subtract(this._level.origin);
}, },
_wrapCoords: function (coords) { _wrapCoords: function (coords) {
@ -658,8 +658,8 @@ L.GridLayer = L.Layer.extend({
_pxBoundsToTileRange: function (bounds) { _pxBoundsToTileRange: function (bounds) {
var tileSize = this.getTileSize(); var tileSize = this.getTileSize();
return new L.Bounds( return new L.Bounds(
bounds.min.dotDivision(tileSize).floor(), bounds.min.unscaleBy(tileSize).floor(),
bounds.max.dotDivision(tileSize).ceil().subtract([1, 1])); bounds.max.unscaleBy(tileSize).ceil().subtract([1, 1]));
}, },
_noTilesToLoad: function () { _noTilesToLoad: function () {