From b389727e31389cdde2f6467d544a0e1d4fa3a2b6 Mon Sep 17 00:00:00 2001 From: Danil Boldyrev Date: Thu, 1 Feb 2024 16:00:23 +0300 Subject: [PATCH] place the cursor next to the original --- .../canvas-zoom-and-pan/javascript/zoom.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js b/extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js index 6ce599659..b7b03ceae 100644 --- a/extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js +++ b/extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js @@ -785,10 +785,14 @@ onUiLoaded(async() => { canvasCursors.forEach(cursor => cursor.style.display = "none"); - targetElement.appendChild(paintCursorCopy); + canvasCursors[0].parentNode.insertBefore(paintCursorCopy, canvasCursors[0].nextSibling); + canvasCursors[1].parentNode.insertBefore(eraserCursorCopy, canvasCursors[1].nextSibling); + + + // targetElement.appendChild(paintCursorCopy); paintCursorCopy.style.display = "none"; - targetElement.appendChild(eraserCursorCopy); + // targetElement.appendChild(eraserCursorCopy); eraserCursorCopy.style.display = "none"; let activeCursor; @@ -805,6 +809,8 @@ onUiLoaded(async() => { activeButton.classList.add("active"); inactiveButton.classList.remove("active"); + // canvasCursors.forEach(cursor => cursor.style.display = "none"); + if (activeCursor) { activeCursor.style.display = "none"; }