Merge pull request #7130 from nschloe/patch-1
Add element to text layer even if width === 0
This commit is contained in:
commit
3d49879211
@ -156,10 +156,9 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
}
|
||||
|
||||
var width = ctx.measureText(textDiv.textContent).width;
|
||||
if (width > 0) {
|
||||
textLayerFrag.appendChild(textDiv);
|
||||
var transform;
|
||||
if (textDiv.dataset.canvasWidth !== undefined) {
|
||||
if (textDiv.dataset.canvasWidth !== undefined && width > 0) {
|
||||
// Dataset values come of type string.
|
||||
var textScale = textDiv.dataset.canvasWidth / width;
|
||||
transform = 'scaleX(' + textScale + ')';
|
||||
@ -174,7 +173,6 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
CustomStyle.setProp('transform' , textDiv, transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
capability.resolve();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user