Skip to content

Commit

Permalink
Merge pull request #12526 from Snuffleupagus/TilingPattern-args
Browse files Browse the repository at this point in the history
Improve argument/name handling when parsing TilingPatterns (PR 12458 follow-up)
  • Loading branch information
timvandermeij authored Oct 24, 2020
2 parents c493dc9 + b478d3e commit 180f35e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1224,10 +1224,12 @@ class PartialEvaluator {
localTilingPatternCache
) {
// compile tiling patterns
const patternName = args[args.length - 1];
const patternName = args.pop();
// SCN/scn applies patterns along with normal colors
if (patternName instanceof Name) {
const localTilingPattern = localTilingPatternCache.getByName(patternName);
const name = patternName.name;

const localTilingPattern = localTilingPatternCache.getByName(name);
if (localTilingPattern) {
try {
const color = cs.base ? cs.base.getRgb(args, 0) : null;
Expand All @@ -1249,7 +1251,7 @@ class PartialEvaluator {
// if and only if there are PDF documents where doing so would
// significantly improve performance.

let pattern = patterns.get(patternName.name);
let pattern = patterns.get(name);
if (pattern) {
var dict = isStream(pattern) ? pattern.dict : pattern;
var typeNum = dict.get("PatternType");
Expand All @@ -1264,7 +1266,7 @@ class PartialEvaluator {
dict,
operatorList,
task,
patternName,
/* cacheKey = */ name,
localTilingPatternCache
);
} else if (typeNum === PatternType.SHADING) {
Expand Down

0 comments on commit 180f35e

Please sign in to comment.