Skip to content

Commit

Permalink
fixup! Add logic to track rendering area of various PDF ops
Browse files Browse the repository at this point in the history
Fix linting
  • Loading branch information
nicolo-ribaudo committed Nov 18, 2024
1 parent 395be2b commit 49c4689
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ const MAX_SIZE_TO_COMPILE = 1000;

const FULL_CHUNK_HEIGHT = 16;

function allValues(obj) {
const values = [];
for (const key in obj) {
values.push(obj[key]);
}
return values;
}

/**
* Overrides certain methods on a 2d ctx so that when they are called they
* will also call the same method on the destCtx. The methods that are
Expand Down Expand Up @@ -619,7 +611,9 @@ class CanvasExtraStateDependenciesRecorder extends CanvasExtraState {
}

takeDependencies() {
if (this._dependencies.size === 0) return;
if (this._dependencies.size === 0) {
return undefined;
}

const arr = Array.from(this._dependencies);
this._dependencies.clear();
Expand Down
4 changes: 3 additions & 1 deletion src/display/canvas_recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ export class CanvasRecorder {
// console.warn(`Untracked call to ${name}`);
this.#unknown();
}
if (deps) this.#registerDependencies(deps);
if (deps) {
this.#registerDependencies(deps);
}
return this.#ctx[name](...args);
};
}
Expand Down

0 comments on commit 49c4689

Please sign in to comment.