Merge pull request #560 from sbplat/main
fix(multitool): hide dragged pdf page at the start so it doesn't teleport
This commit is contained in:
commit
d894937c22
1 changed files with 8 additions and 10 deletions
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
class DragDropManager {
|
class DragDropManager {
|
||||||
dragContainer;
|
dragContainer;
|
||||||
wrapper;
|
wrapper;
|
||||||
|
@ -52,8 +50,7 @@ class DragDropManager {
|
||||||
imgEl.classList.add('dragged-img');
|
imgEl.classList.add('dragged-img');
|
||||||
imgEl.src = imageSrc;
|
imgEl.src = imageSrc;
|
||||||
this.draggedImageEl = imgEl;
|
this.draggedImageEl = imgEl;
|
||||||
imgEl.style.left = screenX;
|
imgEl.style.visibility = 'hidden';
|
||||||
imgEl.style.right = screenY;
|
|
||||||
imgEl.style.transform = `rotate(${img.style.rotate === '' ? '0deg' : img.style.rotate}) translate(-50%, -50%)`;
|
imgEl.style.transform = `rotate(${img.style.rotate === '' ? '0deg' : img.style.rotate}) translate(-50%, -50%)`;
|
||||||
this.dragContainer.appendChild(imgEl);
|
this.dragContainer.appendChild(imgEl);
|
||||||
|
|
||||||
|
@ -66,6 +63,7 @@ class DragDropManager {
|
||||||
onDragEl(mouseEvent) {
|
onDragEl(mouseEvent) {
|
||||||
const { clientX, clientY } = mouseEvent;
|
const { clientX, clientY } = mouseEvent;
|
||||||
if(this.draggedImageEl) {
|
if(this.draggedImageEl) {
|
||||||
|
this.draggedImageEl.style.visibility = 'visible';
|
||||||
this.draggedImageEl.style.left = `${clientX}px`;
|
this.draggedImageEl.style.left = `${clientX}px`;
|
||||||
this.draggedImageEl.style.top = `${clientY}px`;
|
this.draggedImageEl.style.top = `${clientY}px`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue