Only check for fill and stroke once
This commit is contained in:
@@ -80,9 +80,6 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo
|
||||
var fill = state.fillStyle !== undefined;
|
||||
var stroke = state.strokeStyle != undefined;
|
||||
var numEnds = ends.length;
|
||||
if (!fill && !stroke) {
|
||||
return ends[numEnds - 1];
|
||||
}
|
||||
var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH];
|
||||
this.instructions.push(beginPathInstruction);
|
||||
this.hitDetectionInstructions.push(beginPathInstruction);
|
||||
@@ -178,11 +175,9 @@ ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, f
|
||||
ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) {
|
||||
var state = this.state_;
|
||||
ol.DEBUG && console.assert(state, 'state should not be null');
|
||||
var fillStyle = state.fillStyle;
|
||||
var strokeStyle = state.strokeStyle;
|
||||
if (fillStyle === undefined && strokeStyle === undefined) {
|
||||
return;
|
||||
}
|
||||
ol.DEBUG && console.assert(state.fillStyle === undefined && strokeStyle === undefined,
|
||||
'fillStyle or strokeStyle should be defined');
|
||||
if (strokeStyle !== undefined) {
|
||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
||||
'state.lineWidth should be defined');
|
||||
|
||||
Reference in New Issue
Block a user