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 fill = state.fillStyle !== undefined;
|
||||||
var stroke = state.strokeStyle != undefined;
|
var stroke = state.strokeStyle != undefined;
|
||||||
var numEnds = ends.length;
|
var numEnds = ends.length;
|
||||||
if (!fill && !stroke) {
|
|
||||||
return ends[numEnds - 1];
|
|
||||||
}
|
|
||||||
var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH];
|
var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH];
|
||||||
this.instructions.push(beginPathInstruction);
|
this.instructions.push(beginPathInstruction);
|
||||||
this.hitDetectionInstructions.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) {
|
ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) {
|
||||||
var state = this.state_;
|
var state = this.state_;
|
||||||
ol.DEBUG && console.assert(state, 'state should not be null');
|
ol.DEBUG && console.assert(state, 'state should not be null');
|
||||||
var fillStyle = state.fillStyle;
|
|
||||||
var strokeStyle = state.strokeStyle;
|
var strokeStyle = state.strokeStyle;
|
||||||
if (fillStyle === undefined && strokeStyle === undefined) {
|
ol.DEBUG && console.assert(state.fillStyle === undefined && strokeStyle === undefined,
|
||||||
return;
|
'fillStyle or strokeStyle should be defined');
|
||||||
}
|
|
||||||
if (strokeStyle !== undefined) {
|
if (strokeStyle !== undefined) {
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
||||||
'state.lineWidth should be defined');
|
'state.lineWidth should be defined');
|
||||||
|
|||||||
Reference in New Issue
Block a user