mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[TextLayer] Only cache the originalTransform
when enhanceTextSelection
is enabled
Given that this is completely unused in "regular" text-selection mode, there's no reason to unconditionally store one string for every `textDiv`.
This commit is contained in:
parent
52c6b3c138
commit
6afe3221b7
1 changed files with 5 additions and 3 deletions
|
@ -560,7 +560,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 +670,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…
Add table
Add a link
Reference in a new issue