Transformed
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.render.webgl.TextReplay');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Text');
|
||||
import _ol_dom_ from '../../../../../src/ol/dom.js';
|
||||
import _ol_geom_Point_ from '../../../../../src/ol/geom/Point.js';
|
||||
import _ol_render_webgl_TextReplay_ from '../../../../../src/ol/render/webgl/TextReplay.js';
|
||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
||||
|
||||
describe('ol.render.webgl.TextReplay', function() {
|
||||
var replay;
|
||||
|
||||
var createTextStyle = function(fillStyle, strokeStyle, text) {
|
||||
var textStyle = new ol.style.Text({
|
||||
var textStyle = new _ol_style_Text_({
|
||||
rotateWithView: true,
|
||||
rotation: 1.5,
|
||||
scale: 2,
|
||||
@@ -28,7 +28,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
beforeEach(function() {
|
||||
var tolerance = 0.1;
|
||||
var maxExtent = [-10000, -20000, 10000, 20000];
|
||||
replay = new ol.render.webgl.TextReplay(tolerance, maxExtent);
|
||||
replay = new _ol_render_webgl_TextReplay_(tolerance, maxExtent);
|
||||
});
|
||||
|
||||
describe('#setTextStyle', function() {
|
||||
@@ -37,10 +37,10 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
textStyle1 = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
new _ol_style_Stroke_({
|
||||
width: 1,
|
||||
color: [0, 0, 0, 1],
|
||||
lineCap: 'butt',
|
||||
@@ -51,10 +51,10 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
}),
|
||||
'someText');
|
||||
textStyle2 = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [255, 255, 255, 1]
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
new _ol_style_Stroke_({
|
||||
width: 1,
|
||||
color: [255, 255, 255, 1]
|
||||
}),
|
||||
@@ -62,10 +62,10 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
);
|
||||
textStyle3 = createTextStyle(null, null, 'someText');
|
||||
textStyle4 = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
new _ol_style_Stroke_({
|
||||
width: 1,
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
@@ -115,7 +115,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
describe('#drawText', function() {
|
||||
beforeEach(function() {
|
||||
var textStyle = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
null, 'someText');
|
||||
@@ -126,19 +126,19 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
var point;
|
||||
|
||||
point = [1000, 2000];
|
||||
replay.drawText(new ol.geom.Point(point), null);
|
||||
replay.drawText(new _ol_geom_Point_(point), null);
|
||||
expect(replay.vertices).to.have.length(256);
|
||||
expect(replay.indices).to.have.length(48);
|
||||
|
||||
point = [2000, 3000];
|
||||
replay.drawText(new ol.geom.Point(point), null);
|
||||
replay.drawText(new _ol_geom_Point_(point), null);
|
||||
expect(replay.vertices).to.have.length(512);
|
||||
expect(replay.indices).to.have.length(96);
|
||||
});
|
||||
|
||||
it('sets part of its state during drawing', function() {
|
||||
var point = [1000, 2000];
|
||||
replay.drawText(new ol.geom.Point(point), null);
|
||||
replay.drawText(new _ol_geom_Point_(point), null);
|
||||
|
||||
var height = replay.currAtlas_.height;
|
||||
var widths = replay.currAtlas_.width;
|
||||
@@ -162,7 +162,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
var point;
|
||||
|
||||
point = [1000, 2000];
|
||||
replay.drawText(new ol.geom.Point(point), null);
|
||||
replay.drawText(new _ol_geom_Point_(point), null);
|
||||
expect(replay.vertices).to.have.length(0);
|
||||
expect(replay.indices).to.have.length(0);
|
||||
});
|
||||
@@ -171,7 +171,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
describe('#addCharToAtlas_', function() {
|
||||
beforeEach(function() {
|
||||
var textStyle = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
null, 'someText');
|
||||
@@ -209,7 +209,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
describe('#getTextSize_', function() {
|
||||
beforeEach(function() {
|
||||
var textStyle = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
null, 'someText');
|
||||
@@ -242,7 +242,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
|
||||
it('returns the size of the label\'s bounding box in pixels', function() {
|
||||
var size;
|
||||
var mCtx = ol.dom.createCanvasContext2D(0, 0);
|
||||
var mCtx = _ol_dom_.createCanvasContext2D(0, 0);
|
||||
mCtx.font = '12px Arial';
|
||||
var width = mCtx.measureText('someText').width;
|
||||
var width2 = mCtx.measureText('anEvenLongerLine').width;
|
||||
@@ -261,7 +261,7 @@ describe('ol.render.webgl.TextReplay', function() {
|
||||
describe('#getAtlas_', function() {
|
||||
beforeEach(function() {
|
||||
var textStyle = createTextStyle(
|
||||
new ol.style.Fill({
|
||||
new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
}),
|
||||
null, 'someText');
|
||||
|
||||
Reference in New Issue
Block a user