place the cursor next to the original

This commit is contained in:
Danil Boldyrev 2024-02-01 16:00:23 +03:00
parent 7eda3319de
commit b389727e31

View File

@ -785,10 +785,14 @@ onUiLoaded(async() => {
canvasCursors.forEach(cursor => cursor.style.display = "none"); 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"; paintCursorCopy.style.display = "none";
targetElement.appendChild(eraserCursorCopy); // targetElement.appendChild(eraserCursorCopy);
eraserCursorCopy.style.display = "none"; eraserCursorCopy.style.display = "none";
let activeCursor; let activeCursor;
@ -805,6 +809,8 @@ onUiLoaded(async() => {
activeButton.classList.add("active"); activeButton.classList.add("active");
inactiveButton.classList.remove("active"); inactiveButton.classList.remove("active");
// canvasCursors.forEach(cursor => cursor.style.display = "none");
if (activeCursor) { if (activeCursor) {
activeCursor.style.display = "none"; activeCursor.style.display = "none";
} }