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

@@ -1,4 +1,4 @@
import _ol_style_Atlas_ from '../../../../src/ol/style/Atlas.js';
import Atlas from '../../../../src/ol/style/Atlas.js';
import _ol_style_AtlasManager_ from '../../../../src/ol/style/AtlasManager.js';
@@ -10,7 +10,7 @@ describe('ol.style.Atlas', function() {
describe('#constructor', function() {
it('inits the atlas', function() {
var atlas = new _ol_style_Atlas_(256, 1);
var atlas = new Atlas(256, 1);
expect(atlas.emptyBlocks_).to.eql(
[{x: 0, y: 0, width: 256, height: 256}]);
});
@@ -19,7 +19,7 @@ describe('ol.style.Atlas', function() {
describe('#add (squares with same size)', function() {
it('adds one entry', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
var info = atlas.add('1', 32, 32, defaultRender);
expect(info).to.eql(
@@ -29,7 +29,7 @@ describe('ol.style.Atlas', function() {
});
it('adds two entries', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
atlas.add('1', 32, 32, defaultRender);
var info = atlas.add('2', 32, 32, defaultRender);
@@ -41,7 +41,7 @@ describe('ol.style.Atlas', function() {
});
it('adds three entries', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
atlas.add('1', 32, 32, defaultRender);
atlas.add('2', 32, 32, defaultRender);
@@ -54,7 +54,7 @@ describe('ol.style.Atlas', function() {
});
it('adds four entries (new row)', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
atlas.add('1', 32, 32, defaultRender);
atlas.add('2', 32, 32, defaultRender);
@@ -68,7 +68,7 @@ describe('ol.style.Atlas', function() {
});
it('returns null when an entry is too big', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
atlas.add('1', 32, 32, defaultRender);
atlas.add('2', 32, 32, defaultRender);
@@ -79,7 +79,7 @@ describe('ol.style.Atlas', function() {
});
it('fills up the whole atlas', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
for (var i = 1; i <= 16; i++) {
expect(atlas.add(i.toString(), 28, 28, defaultRender)).to.be.ok();
@@ -93,7 +93,7 @@ describe('ol.style.Atlas', function() {
describe('#add (rectangles with different sizes)', function() {
it('adds a bunch of rectangles', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
expect(atlas.add('1', 64, 32, defaultRender)).to.eql(
{offsetX: 1, offsetY: 1, image: atlas.canvas_});
@@ -116,7 +116,7 @@ describe('ol.style.Atlas', function() {
});
it('fills up the whole atlas (rectangles in portrait format)', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
for (var i = 1; i <= 32; i++) {
expect(atlas.add(i.toString(), 28, 14, defaultRender)).to.be.ok();
@@ -127,7 +127,7 @@ describe('ol.style.Atlas', function() {
});
it('fills up the whole atlas (rectangles in landscape format)', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
for (var i = 1; i <= 32; i++) {
expect(atlas.add(i.toString(), 14, 28, defaultRender)).to.be.ok();
@@ -141,7 +141,7 @@ describe('ol.style.Atlas', function() {
describe('#add (rendering)', function() {
it('calls the render callback with the right values', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
var rendererCallback = sinon.spy();
atlas.add('1', 32, 32, rendererCallback);
@@ -156,7 +156,7 @@ describe('ol.style.Atlas', function() {
});
it('is possible to actually draw on the canvas', function() {
var atlas = new _ol_style_Atlas_(128, 1);
var atlas = new Atlas(128, 1);
var rendererCallback = function(context, x, y) {
context.fillStyle = '#FFA500';