diff --git a/src/ol/render/webgl/textreplay.js b/src/ol/render/webgl/textreplay.js index 48f164c36b..56f02502db 100644 --- a/src/ol/render/webgl/textreplay.js +++ b/src/ol/render/webgl/textreplay.js @@ -150,7 +150,7 @@ if (ol.ENABLE_WEBGL) { this.originY = charInfo.offsetY; this.height = glyphAtlas.height; this.width = j === 0 || j === charArr.length - 1 ? - glyphAtlas.width[charArr[j]] + lineWidth : glyphAtlas.width[charArr[j]]; + glyphAtlas.width[charArr[j]] + lineWidth : glyphAtlas.width[charArr[j]]; this.imageHeight = image.height; this.imageWidth = image.width; @@ -330,7 +330,7 @@ if (ol.ENABLE_WEBGL) { } else { var textFillStyleColor = textFillStyle.getColor(); state.fillColor = ol.colorlike.asColorLike(textFillStyleColor ? - textFillStyleColor : ol.render.webgl.defaultFillStyle); + textFillStyleColor : ol.render.webgl.defaultFillStyle); } if (!textStrokeStyle) { state.strokeColor = null; @@ -338,7 +338,7 @@ if (ol.ENABLE_WEBGL) { } else { var textStrokeStyleColor = textStrokeStyle.getColor(); state.strokeColor = ol.colorlike.asColorLike(textStrokeStyleColor ? - textStrokeStyleColor : ol.render.webgl.defaultStrokeStyle); + textStrokeStyleColor : ol.render.webgl.defaultStrokeStyle); state.lineWidth = textStrokeStyle.getWidth() || ol.render.webgl.defaultLineWidth; state.lineCap = textStrokeStyle.getLineCap() || ol.render.webgl.defaultLineCap; state.lineDashOffset = textStrokeStyle.getLineDashOffset() || ol.render.webgl.defaultLineDashOffset; @@ -353,9 +353,9 @@ if (ol.ENABLE_WEBGL) { var textAlign = ol.render.webgl.TextReplay.Align_[textStyle.getTextAlign()]; var textBaseline = ol.render.webgl.TextReplay.Align_[textStyle.getTextBaseline()]; this.textAlign_ = textAlign === undefined ? - ol.render.webgl.defaultTextAlign : textAlign; + ol.render.webgl.defaultTextAlign : textAlign; this.textBaseline_ = textBaseline === undefined ? - ol.render.webgl.defaultTextBaseline : textBaseline; + ol.render.webgl.defaultTextBaseline : textBaseline; this.offsetX_ = textStyle.getOffsetX() || 0; this.offsetY_ = textStyle.getOffsetY() || 0; this.rotateWithView = !!textStyle.getRotateWithView(); diff --git a/src/ol/render/webgl/texturereplay.js b/src/ol/render/webgl/texturereplay.js index 4c97e8b5c2..3b2fb7b13b 100644 --- a/src/ol/render/webgl/texturereplay.js +++ b/src/ol/render/webgl/texturereplay.js @@ -397,12 +397,12 @@ if (ol.ENABLE_WEBGL) { } // continue with the next feature start = (featureIndex === this.startIndices.length - 1) ? - groupEnd : this.startIndices[featureIndex + 1]; + groupEnd : this.startIndices[featureIndex + 1]; end = start; } else { // the feature is not skipped, augment the end index end = (featureIndex === this.startIndices.length - 1) ? - groupEnd : this.startIndices[featureIndex + 1]; + groupEnd : this.startIndices[featureIndex + 1]; } featureIndex++; } diff --git a/test/spec/ol/render/webgl/textreplay.test.js b/test/spec/ol/render/webgl/textreplay.test.js index 610e49a02b..69dcaffbf9 100644 --- a/test/spec/ol/render/webgl/textreplay.test.js +++ b/test/spec/ol/render/webgl/textreplay.test.js @@ -38,39 +38,39 @@ describe('ol.render.webgl.TextReplay', function() { beforeEach(function() { textStyle1 = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - new ol.style.Stroke({ - width: 1, - color: [0, 0, 0, 1], - lineCap: 'butt', - lineJoin: 'bevel', - lineDash: [5, 5], - lineDashOffset: 15, - miterLimit: 2 - }), - 'someText'); + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + new ol.style.Stroke({ + width: 1, + color: [0, 0, 0, 1], + lineCap: 'butt', + lineJoin: 'bevel', + lineDash: [5, 5], + lineDashOffset: 15, + miterLimit: 2 + }), + 'someText'); textStyle2 = createTextStyle( - new ol.style.Fill({ - color: [255, 255, 255, 1] - }), - new ol.style.Stroke({ - width: 1, - color: [255, 255, 255, 1] - }), - 'someText' + new ol.style.Fill({ + color: [255, 255, 255, 1] + }), + new ol.style.Stroke({ + width: 1, + color: [255, 255, 255, 1] + }), + 'someText' ); textStyle3 = createTextStyle(null, null, 'someText'); textStyle4 = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - new ol.style.Stroke({ - width: 1, - color: [0, 0, 0, 1] - }), - '' + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + new ol.style.Stroke({ + width: 1, + color: [0, 0, 0, 1] + }), + '' ); }); @@ -116,10 +116,10 @@ describe('ol.render.webgl.TextReplay', function() { describe('#drawText', function() { beforeEach(function() { var textStyle = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - null, 'someText'); + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + null, 'someText'); replay.setTextStyle(textStyle); }); @@ -172,10 +172,10 @@ describe('ol.render.webgl.TextReplay', function() { describe('#addCharToAtlas_', function() { beforeEach(function() { var textStyle = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - null, 'someText'); + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + null, 'someText'); replay.setTextStyle(textStyle); }); @@ -210,10 +210,10 @@ describe('ol.render.webgl.TextReplay', function() { describe('#getTextSize_', function() { beforeEach(function() { var textStyle = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - null, 'someText'); + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + null, 'someText'); textStyle.setScale(1); replay.setTextStyle(textStyle); }); @@ -262,10 +262,10 @@ describe('ol.render.webgl.TextReplay', function() { describe('#getAtlas_', function() { beforeEach(function() { var textStyle = createTextStyle( - new ol.style.Fill({ - color: [0, 0, 0, 1] - }), - null, 'someText'); + new ol.style.Fill({ + color: [0, 0, 0, 1] + }), + null, 'someText'); replay.setTextStyle(textStyle); });