mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-25 16:37:22 +02:00
Use Map.prototype.getOrInsertComputed() in the src/display/canvas.js file
This commit is contained in:
parent
ab8e67ecff
commit
c81904ac0a
@ -989,11 +989,10 @@ class CanvasGraphics {
|
|||||||
: [currentTransform.slice(0, 4), fillColor]
|
: [currentTransform.slice(0, 4), fillColor]
|
||||||
);
|
);
|
||||||
|
|
||||||
cache = this._cachedBitmapsMap.get(mainKey);
|
cache = this._cachedBitmapsMap.getOrInsertComputed(
|
||||||
if (!cache) {
|
mainKey,
|
||||||
cache = new Map();
|
() => new Map()
|
||||||
this._cachedBitmapsMap.set(mainKey, cache);
|
);
|
||||||
}
|
|
||||||
const cachedImage = cache.get(cacheKey);
|
const cachedImage = cache.get(cacheKey);
|
||||||
if (cachedImage && !isPatternFill) {
|
if (cachedImage && !isPatternFill) {
|
||||||
const offsetX = Math.round(
|
const offsetX = Math.round(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user