mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #19085 from calixteman/simplify_drawer
[Editor] Simplify the draw layer code
This commit is contained in:
commit
5133e6b666
7 changed files with 322 additions and 234 deletions
|
@ -381,8 +381,40 @@ class Rasterize {
|
|||
);
|
||||
const drawLayer = new DrawLayer({ pageIndex: 0 });
|
||||
drawLayer.setParent(div);
|
||||
drawLayer.draw(outliner.getOutlines(), "orange", 0.4);
|
||||
drawLayer.drawOutline(outlinerForOutline.getOutlines());
|
||||
const outlines = outliner.getOutlines();
|
||||
drawLayer.draw(
|
||||
{
|
||||
bbox: outlines.box,
|
||||
root: {
|
||||
viewBox: "0 0 1 1",
|
||||
fill: "orange",
|
||||
"fill-opacity": 0.4,
|
||||
},
|
||||
rootClass: {
|
||||
highlight: true,
|
||||
free: false,
|
||||
},
|
||||
path: {
|
||||
d: outlines.toSVGPath(),
|
||||
},
|
||||
},
|
||||
/* isPathUpdatable = */ false,
|
||||
/* hasClip = */ true
|
||||
);
|
||||
const focusLine = outlinerForOutline.getOutlines();
|
||||
drawLayer.drawOutline(
|
||||
{
|
||||
rootClass: {
|
||||
highlightOutline: true,
|
||||
free: false,
|
||||
},
|
||||
bbox: focusLine.box,
|
||||
path: {
|
||||
d: focusLine.toSVGPath(),
|
||||
},
|
||||
},
|
||||
/* mustRemoveSelfIntersections = */ false
|
||||
);
|
||||
|
||||
svg.append(foreignObject);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue