Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve argument/name handling when parsing TilingPatterns (PR 12458 follow-up) #12526

Merged
merged 1 commit into from
Oct 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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