mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Fixing the offset of vertical CJK text
This commit is contained in:
parent
077f08fa6d
commit
6c3e5e5d92
2 changed files with 5 additions and 15 deletions
|
@ -83,9 +83,6 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
var textScale = textDiv.dataset.canvasWidth / width;
|
||||
var rotation = textDiv.dataset.angle;
|
||||
var transform = 'scale(' + textScale + ', 1)';
|
||||
if (bidiTexts[i].dir === 'ttb') {
|
||||
rotation += 90;
|
||||
}
|
||||
transform = 'rotate(' + rotation + 'deg) ' + transform;
|
||||
CustomStyle.setProp('transform' , textDiv, transform);
|
||||
CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
|
||||
|
@ -161,7 +158,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
|
||||
textDiv.textContent = bidiText.str;
|
||||
// bidiText.dir may be 'ttb' for vertical texts.
|
||||
textDiv.dir = bidiText.dir === 'rtl' ? 'rtl' : 'ltr';
|
||||
textDiv.dir = bidiText.dir;
|
||||
}
|
||||
|
||||
this.setupRenderLayoutTimer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue