mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Remove unnecessary clean-up in Toolbar.#adjustScaleWidth
While zeroing the temporary `canvas` makes sense, manually clearing the canvas and its context doesn't really accomplish anything since those are tied to the scope of the method.
This commit is contained in:
parent
3dd8b9cccf
commit
efe3cb2982
1 changed files with 2 additions and 3 deletions
|
@ -260,8 +260,8 @@ class Toolbar {
|
|||
);
|
||||
|
||||
// The temporary canvas is used to measure text length in the DOM.
|
||||
let canvas = document.createElement("canvas");
|
||||
let ctx = canvas.getContext("2d", { alpha: false });
|
||||
const canvas = document.createElement("canvas");
|
||||
const ctx = canvas.getContext("2d", { alpha: false });
|
||||
ctx.font = `${style.fontSize} ${style.fontFamily}`;
|
||||
|
||||
let maxWidth = 0;
|
||||
|
@ -281,7 +281,6 @@ class Toolbar {
|
|||
// immediately, which can greatly reduce memory consumption.
|
||||
canvas.width = 0;
|
||||
canvas.height = 0;
|
||||
canvas = ctx = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue