diff options
author | bobzel <zzzman@gmail.com> | 2021-03-29 19:04:08 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-03-29 19:04:08 -0400 |
commit | 7db0fe589afa3281894afb0a0d3bd6b9983c9d33 (patch) | |
tree | 3c8f81ddb5049c4c15c4ca4f4487cb63e7539049 /src/client/util/DragManager.ts | |
parent | fa6aa3f3d13cade1cd46d954dbfee6f8566bcc86 (diff) |
still cleaning up all the active/selection code.
Diffstat (limited to 'src/client/util/DragManager.ts')
-rw-r--r-- | src/client/util/DragManager.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index 38d0ecaa6..abf1af669 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -379,7 +379,12 @@ export namespace DragManager { if (docsBeingDragged.length) { const pdfBox = dragElement.getElementsByTagName("canvas"); const pdfBoxSrc = ele.getElementsByTagName("canvas"); - Array.from(pdfBox).map((pb, i) => pb.getContext('2d')!.drawImage(pdfBoxSrc[i], 0, 0)); + Array.from(pdfBox).filter(pb => pb.width && pb.height).map((pb, i) => { + const context = pb.getContext('2d')!; + console.log(getComputedStyle(pb).width); + console.log(getComputedStyle(pdfBoxSrc[i]).width); + context.drawImage(pdfBoxSrc[i], 0, 0); + }); } [dragElement, ...Array.from(dragElement.getElementsByTagName('*'))].forEach(ele => ele.hasAttribute("style") && ((ele as any).style.pointerEvents = "none")); |