Merge pull request #11086 from Snuffleupagus/textLayer-originalTransform
[TextLayer] Only cache the `originalTransform` when `enhanceTextSelection` is enabled
This commit is contained in:
commit
490deb1b65
@ -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;
|
||||
}
|
||||
@ -560,7 +558,9 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
transform = `rotate(${textDivProperties.angle}deg) ${transform}`;
|
||||
}
|
||||
if (transform.length > 0) {
|
||||
textDivProperties.originalTransform = transform;
|
||||
if (this._enhanceTextSelection) {
|
||||
textDivProperties.originalTransform = transform;
|
||||
}
|
||||
textDiv.style.transform = transform;
|
||||
}
|
||||
this._textDivProperties.set(textDiv, textDivProperties);
|
||||
@ -668,8 +668,8 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
div.style.transform = transform;
|
||||
}
|
||||
} else {
|
||||
div.style.padding = 0;
|
||||
div.style.transform = divProps.originalTransform || '';
|
||||
div.style.padding = null;
|
||||
div.style.transform = divProps.originalTransform;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user