[TextLayer] Use template strings when updating the font property in the _layoutText
method
This commit is contained in:
parent
6afe3221b7
commit
a519ceffee
@ -537,14 +537,12 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
if (textDivProperties.isWhitespace) {
|
||||
return;
|
||||
}
|
||||
|
||||
let fontSize = textDiv.style.fontSize;
|
||||
let fontFamily = textDiv.style.fontFamily;
|
||||
const { fontSize, fontFamily, } = textDiv.style;
|
||||
|
||||
// Only build font string and set to context if different from last.
|
||||
if (fontSize !== this._layoutTextLastFontSize ||
|
||||
fontFamily !== this._layoutTextLastFontFamily) {
|
||||
this._layoutTextCtx.font = fontSize + ' ' + fontFamily;
|
||||
this._layoutTextCtx.font = `${fontSize} ${fontFamily}`;
|
||||
this._layoutTextLastFontSize = fontSize;
|
||||
this._layoutTextLastFontFamily = fontFamily;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user