mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-16 18:24:04 +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]
|
||||
);
|
||||
|
||||
cache = this._cachedBitmapsMap.get(mainKey);
|
||||
if (!cache) {
|
||||
cache = new Map();
|
||||
this._cachedBitmapsMap.set(mainKey, cache);
|
||||
}
|
||||
cache = this._cachedBitmapsMap.getOrInsertComputed(
|
||||
mainKey,
|
||||
() => new Map()
|
||||
);
|
||||
const cachedImage = cache.get(cacheKey);
|
||||
if (cachedImage && !isPatternFill) {
|
||||
const offsetX = Math.round(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user