From 8d489b4f905e20b228192f65b6636a06232cf7fb Mon Sep 17 00:00:00 2001 From: discomrade <83621080+discomrade@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:42:27 +0000 Subject: [PATCH] [notes] Round note dimensions to int --- ext/notes/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/notes/script.js b/ext/notes/script.js index 81cf56fe..80ea8995 100644 --- a/ext/notes/script.js +++ b/ext/notes/script.js @@ -124,10 +124,10 @@ function renderEditor(noteDiv, note) { function _commit() { noteDiv.classList.remove("dragging"); dragStart = null; - note.x1 = noteDiv.offsetLeft / scale; - note.y1 = noteDiv.offsetTop / scale; - note.width = noteDiv.offsetWidth / scale; - note.height = noteDiv.offsetHeight / scale; + note.x1 = Math.round(noteDiv.offsetLeft / scale); + note.y1 = Math.round(noteDiv.offsetTop / scale); + note.width = Math.round(noteDiv.offsetWidth / scale); + note.height = Math.round(noteDiv.offsetHeight / scale); renderNotes(); } noteDiv.addEventListener('mouseup', _commit);