Hit-detect background fill and stroke

This commit is contained in:
Andreas Hocevar
2018-01-01 12:04:54 +01:00
parent 6dd7e5374d
commit 745bf3d79f
3 changed files with 25 additions and 13 deletions

View File

@@ -264,8 +264,10 @@ _ol_render_canvas_TextReplay_.prototype.drawText = function(geometry, feature) {
this.beginGeometry(geometry, feature);
if (textState.backgroundFill || textState.backgroundStroke) {
this.setFillStrokeStyle(textState.backgroundFill, textState.backgroundStroke);
this.updateFillStyle(this.state, this.applyFill, geometry);
this.updateFillStyle(this.state, this.createFill, geometry);
this.hitDetectionInstructions.push(this.createFill(this.state, geometry));
this.updateStrokeStyle(this.state, this.applyStroke);
this.hitDetectionInstructions.push(this.createStroke(this.state));
}
this.drawTextImage_(label, begin, end);
this.endGeometry(geometry, feature);