mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #19309 from calixteman/make_unique_id_draw_layer
[Editor] Set a unique id for each element in the draw layer
This commit is contained in:
commit
f1166f480f
3 changed files with 75 additions and 6 deletions
|
@ -24,12 +24,12 @@ import { shadow } from "../shared/util.js";
|
|||
class DrawLayer {
|
||||
#parent = null;
|
||||
|
||||
#id = 0;
|
||||
|
||||
#mapping = new Map();
|
||||
|
||||
#toUpdate = new Map();
|
||||
|
||||
static #id = 0;
|
||||
|
||||
constructor({ pageIndex }) {
|
||||
this.pageIndex = pageIndex;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ class DrawLayer {
|
|||
}
|
||||
|
||||
draw(properties, isPathUpdatable = false, hasClip = false) {
|
||||
const id = this.#id++;
|
||||
const id = DrawLayer.#id++;
|
||||
const root = this.#createSVG();
|
||||
|
||||
const defs = DrawLayer._svgFactory.createElement("defs");
|
||||
|
@ -129,7 +129,7 @@ class DrawLayer {
|
|||
// it composes with its parent with mix-blend-mode: multiply.
|
||||
// But the outline has a different mix-blend-mode, so we need to draw it in
|
||||
// its own SVG.
|
||||
const id = this.#id++;
|
||||
const id = DrawLayer.#id++;
|
||||
const root = this.#createSVG();
|
||||
const defs = DrawLayer._svgFactory.createElement("defs");
|
||||
root.append(defs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue