mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Address Yurys review comments
This commit is contained in:
parent
e48530d391
commit
f1e0edbaa9
4 changed files with 14 additions and 19 deletions
|
@ -509,19 +509,15 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
|
||||
getTextContent: function partialEvaluatorGetIRQueue(
|
||||
stream, resources, state) {
|
||||
var text;
|
||||
var dirs;
|
||||
var bidiTexts;
|
||||
|
||||
if (!state) {
|
||||
text = [];
|
||||
dirs = [];
|
||||
bidiTexts = [];
|
||||
state = {
|
||||
text: text,
|
||||
dirs: dirs
|
||||
bidiTexts: bidiTexts
|
||||
};
|
||||
} else {
|
||||
text = state.text;
|
||||
dirs = state.dirs;
|
||||
bidiTexts = state.bidiTexts;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
@ -627,9 +623,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
} // switch
|
||||
|
||||
if (chunk !== '') {
|
||||
var bidiText = PDFJS.bidi(chunk, -1);
|
||||
text.push(bidiText.str);
|
||||
dirs.push(bidiText.ltr);
|
||||
bidiTexts.push(PDFJS.bidi(chunk, -1));
|
||||
|
||||
chunk = '';
|
||||
}
|
||||
|
|
|
@ -3181,7 +3181,7 @@ var Font = (function FontClosure() {
|
|||
},
|
||||
|
||||
get spaceWidth() {
|
||||
if (this._shadowWidth !== undefined) {
|
||||
if ('_shadowWidth' in this) {
|
||||
return this._shadowWidth;
|
||||
}
|
||||
|
||||
|
@ -3212,6 +3212,8 @@ var Font = (function FontClosure() {
|
|||
break; // the non-zero width found
|
||||
}
|
||||
width = (width || this.defaultWidth) * this.widthMultiplier;
|
||||
// Do not shadow the property here. See discussion:
|
||||
// https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280
|
||||
this._shadowWidth = width;
|
||||
return width;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue