Skip to content

Commit

Permalink
Merge pull request #1300 from OpenGeoscience/skip-blank-text-render
Browse files Browse the repository at this point in the history
perf: Skip rendering empty text values
  • Loading branch information
manthey committed Oct 26, 2023
2 parents 605b5ba + fe85e5d commit c4aff97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/canvas/textFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ var canvas_textFeature = function (arg) {
}
m_this._canvasProperty(context2d, 'fillStyle', util.convertColorToRGBA(color));
text = textFunc(d, i);
if (text === undefined || text === null || text === '') {
return;
}
m_this._canvasProperty(context2d, 'font', m_this.getFontFromStyles(fontFromSubValues, d, i));
m_this._canvasProperty(context2d, 'textAlign', m_this.style.get('textAlign')(d, i) || 'center');
m_this._canvasProperty(context2d, 'textBaseline', m_this.style.get('textBaseline')(d, i) || 'middle');
Expand Down

0 comments on commit c4aff97

Please sign in to comment.