Fix linting issues

This commit is contained in:
GaborFarkas
2017-06-23 21:12:27 +02:00
parent b3407b0554
commit 619e85e737
3 changed files with 52 additions and 52 deletions

View File

@@ -150,7 +150,7 @@ if (ol.ENABLE_WEBGL) {
this.originY = charInfo.offsetY; this.originY = charInfo.offsetY;
this.height = glyphAtlas.height; this.height = glyphAtlas.height;
this.width = j === 0 || j === charArr.length - 1 ? 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.imageHeight = image.height;
this.imageWidth = image.width; this.imageWidth = image.width;
@@ -330,7 +330,7 @@ if (ol.ENABLE_WEBGL) {
} else { } else {
var textFillStyleColor = textFillStyle.getColor(); var textFillStyleColor = textFillStyle.getColor();
state.fillColor = ol.colorlike.asColorLike(textFillStyleColor ? state.fillColor = ol.colorlike.asColorLike(textFillStyleColor ?
textFillStyleColor : ol.render.webgl.defaultFillStyle); textFillStyleColor : ol.render.webgl.defaultFillStyle);
} }
if (!textStrokeStyle) { if (!textStrokeStyle) {
state.strokeColor = null; state.strokeColor = null;
@@ -338,7 +338,7 @@ if (ol.ENABLE_WEBGL) {
} else { } else {
var textStrokeStyleColor = textStrokeStyle.getColor(); var textStrokeStyleColor = textStrokeStyle.getColor();
state.strokeColor = ol.colorlike.asColorLike(textStrokeStyleColor ? 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.lineWidth = textStrokeStyle.getWidth() || ol.render.webgl.defaultLineWidth;
state.lineCap = textStrokeStyle.getLineCap() || ol.render.webgl.defaultLineCap; state.lineCap = textStrokeStyle.getLineCap() || ol.render.webgl.defaultLineCap;
state.lineDashOffset = textStrokeStyle.getLineDashOffset() || ol.render.webgl.defaultLineDashOffset; 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 textAlign = ol.render.webgl.TextReplay.Align_[textStyle.getTextAlign()];
var textBaseline = ol.render.webgl.TextReplay.Align_[textStyle.getTextBaseline()]; var textBaseline = ol.render.webgl.TextReplay.Align_[textStyle.getTextBaseline()];
this.textAlign_ = textAlign === undefined ? this.textAlign_ = textAlign === undefined ?
ol.render.webgl.defaultTextAlign : textAlign; ol.render.webgl.defaultTextAlign : textAlign;
this.textBaseline_ = textBaseline === undefined ? this.textBaseline_ = textBaseline === undefined ?
ol.render.webgl.defaultTextBaseline : textBaseline; ol.render.webgl.defaultTextBaseline : textBaseline;
this.offsetX_ = textStyle.getOffsetX() || 0; this.offsetX_ = textStyle.getOffsetX() || 0;
this.offsetY_ = textStyle.getOffsetY() || 0; this.offsetY_ = textStyle.getOffsetY() || 0;
this.rotateWithView = !!textStyle.getRotateWithView(); this.rotateWithView = !!textStyle.getRotateWithView();

View File

@@ -397,12 +397,12 @@ if (ol.ENABLE_WEBGL) {
} }
// continue with the next feature // continue with the next feature
start = (featureIndex === this.startIndices.length - 1) ? start = (featureIndex === this.startIndices.length - 1) ?
groupEnd : this.startIndices[featureIndex + 1]; groupEnd : this.startIndices[featureIndex + 1];
end = start; end = start;
} else { } else {
// the feature is not skipped, augment the end index // the feature is not skipped, augment the end index
end = (featureIndex === this.startIndices.length - 1) ? end = (featureIndex === this.startIndices.length - 1) ?
groupEnd : this.startIndices[featureIndex + 1]; groupEnd : this.startIndices[featureIndex + 1];
} }
featureIndex++; featureIndex++;
} }

View File

@@ -38,39 +38,39 @@ describe('ol.render.webgl.TextReplay', function() {
beforeEach(function() { beforeEach(function() {
textStyle1 = createTextStyle( textStyle1 = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
new ol.style.Stroke({ new ol.style.Stroke({
width: 1, width: 1,
color: [0, 0, 0, 1], color: [0, 0, 0, 1],
lineCap: 'butt', lineCap: 'butt',
lineJoin: 'bevel', lineJoin: 'bevel',
lineDash: [5, 5], lineDash: [5, 5],
lineDashOffset: 15, lineDashOffset: 15,
miterLimit: 2 miterLimit: 2
}), }),
'someText'); 'someText');
textStyle2 = createTextStyle( textStyle2 = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [255, 255, 255, 1] color: [255, 255, 255, 1]
}), }),
new ol.style.Stroke({ new ol.style.Stroke({
width: 1, width: 1,
color: [255, 255, 255, 1] color: [255, 255, 255, 1]
}), }),
'someText' 'someText'
); );
textStyle3 = createTextStyle(null, null, 'someText'); textStyle3 = createTextStyle(null, null, 'someText');
textStyle4 = createTextStyle( textStyle4 = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
new ol.style.Stroke({ new ol.style.Stroke({
width: 1, width: 1,
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
'' ''
); );
}); });
@@ -116,10 +116,10 @@ describe('ol.render.webgl.TextReplay', function() {
describe('#drawText', function() { describe('#drawText', function() {
beforeEach(function() { beforeEach(function() {
var textStyle = createTextStyle( var textStyle = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
null, 'someText'); null, 'someText');
replay.setTextStyle(textStyle); replay.setTextStyle(textStyle);
}); });
@@ -172,10 +172,10 @@ describe('ol.render.webgl.TextReplay', function() {
describe('#addCharToAtlas_', function() { describe('#addCharToAtlas_', function() {
beforeEach(function() { beforeEach(function() {
var textStyle = createTextStyle( var textStyle = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
null, 'someText'); null, 'someText');
replay.setTextStyle(textStyle); replay.setTextStyle(textStyle);
}); });
@@ -210,10 +210,10 @@ describe('ol.render.webgl.TextReplay', function() {
describe('#getTextSize_', function() { describe('#getTextSize_', function() {
beforeEach(function() { beforeEach(function() {
var textStyle = createTextStyle( var textStyle = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
null, 'someText'); null, 'someText');
textStyle.setScale(1); textStyle.setScale(1);
replay.setTextStyle(textStyle); replay.setTextStyle(textStyle);
}); });
@@ -262,10 +262,10 @@ describe('ol.render.webgl.TextReplay', function() {
describe('#getAtlas_', function() { describe('#getAtlas_', function() {
beforeEach(function() { beforeEach(function() {
var textStyle = createTextStyle( var textStyle = createTextStyle(
new ol.style.Fill({ new ol.style.Fill({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}), }),
null, 'someText'); null, 'someText');
replay.setTextStyle(textStyle); replay.setTextStyle(textStyle);
}); });