[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
@ -560,7 +560,9 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
|||||||
transform = `rotate(${textDivProperties.angle}deg) ${transform}`;
|
transform = `rotate(${textDivProperties.angle}deg) ${transform}`;
|
||||||
}
|
}
|
||||||
if (transform.length > 0) {
|
if (transform.length > 0) {
|
||||||
textDivProperties.originalTransform = transform;
|
if (this._enhanceTextSelection) {
|
||||||
|
textDivProperties.originalTransform = transform;
|
||||||
|
}
|
||||||
textDiv.style.transform = transform;
|
textDiv.style.transform = transform;
|
||||||
}
|
}
|
||||||
this._textDivProperties.set(textDiv, textDivProperties);
|
this._textDivProperties.set(textDiv, textDivProperties);
|
||||||
@ -668,8 +670,8 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
|||||||
div.style.transform = transform;
|
div.style.transform = transform;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
div.style.padding = 0;
|
div.style.padding = null;
|
||||||
div.style.transform = divProps.originalTransform || '';
|
div.style.transform = divProps.originalTransform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user