Fix the gStateObj lookup in TranslatedFont._removeType3ColorOperators (PR 12718 follow-up)

As can be seen in 2cba290361/src/core/evaluator.js (L986) the `gStateObj` (which is actually an Array despite its name), is wrapped in Array when it's inserted into the OperatorList. Hence we obviously need to take this into account when accessing it in `TranslatedFont._removeType3ColorOperators`; this mistake happened because we don't have any test-cases for this particular code-path as far as I know.
This commit is contained in:
Jonas Jenwald 2021-01-22 12:27:38 +01:00
parent cfaf23dee2
commit 8137c0547d

View File

@ -3683,7 +3683,7 @@ class TranslatedFont {
continue;
case OPS.setGState:
const gStateObj = operatorList.argsArray[i];
const [gStateObj] = operatorList.argsArray[i];
let j = 0,
jj = gStateObj.length;
while (j < jj) {