Rename _ol_style_Atlas_ to Atlas

This commit is contained in:
Tim Schaub
2018-01-11 10:56:24 -07:00
parent 019933ef25
commit 12d4db5045
3 changed files with 23 additions and 23 deletions

View File

@@ -20,7 +20,7 @@ import {createCanvasContext2D} from '../dom.js';
* edges overlap when being rendered). To avoid this we add a
* padding around each image.
*/
var _ol_style_Atlas_ = function(size, space) {
var Atlas = function(size, space) {
/**
* @private
@@ -58,7 +58,7 @@ var _ol_style_Atlas_ = function(size, space) {
* @param {string} id The identifier of the entry to check.
* @return {?ol.AtlasInfo} The atlas info.
*/
_ol_style_Atlas_.prototype.get = function(id) {
Atlas.prototype.get = function(id) {
return this.entries_[id] || null;
};
@@ -73,7 +73,7 @@ _ol_style_Atlas_.prototype.get = function(id) {
* `renderCallback`.
* @return {?ol.AtlasInfo} The position and atlas image for the entry.
*/
_ol_style_Atlas_.prototype.add = function(id, width, height, renderCallback, opt_this) {
Atlas.prototype.add = function(id, width, height, renderCallback, opt_this) {
var block, i, ii;
for (i = 0, ii = this.emptyBlocks_.length; i < ii; ++i) {
block = this.emptyBlocks_[i];
@@ -110,7 +110,7 @@ _ol_style_Atlas_.prototype.add = function(id, width, height, renderCallback, opt
* @param {number} width The width of the entry to insert.
* @param {number} height The height of the entry to insert.
*/
_ol_style_Atlas_.prototype.split_ = function(index, block, width, height) {
Atlas.prototype.split_ = function(index, block, width, height) {
var deltaWidth = block.width - width;
var deltaHeight = block.height - height;
@@ -168,7 +168,7 @@ _ol_style_Atlas_.prototype.split_ = function(index, block, width, height) {
* @param {ol.AtlasBlock} newBlock1 The 1st block to add.
* @param {ol.AtlasBlock} newBlock2 The 2nd block to add.
*/
_ol_style_Atlas_.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
Atlas.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
var args = [index, 1];
if (newBlock1.width > 0 && newBlock1.height > 0) {
args.push(newBlock1);
@@ -178,4 +178,4 @@ _ol_style_Atlas_.prototype.updateBlocks_ = function(index, newBlock1, newBlock2)
}
this.emptyBlocks_.splice.apply(this.emptyBlocks_, args);
};
export default _ol_style_Atlas_;
export default Atlas;

View File

@@ -2,7 +2,7 @@
* @module ol/style/AtlasManager
*/
import {WEBGL_MAX_TEXTURE_SIZE, nullFunction} from '../index.js';
import _ol_style_Atlas_ from '../style/Atlas.js';
import Atlas from '../style/Atlas.js';
/**
@@ -66,7 +66,7 @@ var _ol_style_AtlasManager_ = function(opt_options) {
* @private
* @type {Array.<ol.style.Atlas>}
*/
this.atlases_ = [new _ol_style_Atlas_(this.currentSize_, this.space_)];
this.atlases_ = [new Atlas(this.currentSize_, this.space_)];
/**
* The size in pixels of the latest atlas image for hit-detection images.
@@ -79,7 +79,7 @@ var _ol_style_AtlasManager_ = function(opt_options) {
* @private
* @type {Array.<ol.style.Atlas>}
*/
this.hitAtlases_ = [new _ol_style_Atlas_(this.currentHitSize_, this.space_)];
this.hitAtlases_ = [new Atlas(this.currentHitSize_, this.space_)];
};
@@ -221,7 +221,7 @@ _ol_style_AtlasManager_.prototype.add_ = function(isHitAtlas, id, width, height,
size = Math.min(this.currentSize_ * 2, this.maxSize_);
this.currentSize_ = size;
}
atlas = new _ol_style_Atlas_(size, this.space_);
atlas = new Atlas(size, this.space_);
atlases.push(atlas);
// run the loop another time
++ii;