diff --git a/src/components/TemplateSettings.jsx b/src/components/TemplateSettings.jsx index 9aa93a8a..d23a2559 100644 --- a/src/components/TemplateSettings.jsx +++ b/src/components/TemplateSettings.jsx @@ -168,7 +168,6 @@ const TemplateSettings = () => { { diff --git a/src/controls/PixelPainterControls.js b/src/controls/PixelPainterControls.js index e4722409..672f3986 100644 --- a/src/controls/PixelPainterControls.js +++ b/src/controls/PixelPainterControls.js @@ -420,7 +420,7 @@ class PixelPainterControls { if (!rgb) { return null; } - return state.canvas.palette.getIndexOfColor(...rgb); + return state.canvas.palette.getClosestIndexOfColor(...rgb); } return state.canvas.selectedColor; } diff --git a/src/ui/templateLoader.js b/src/ui/templateLoader.js index 02449c51..43dadd82 100644 --- a/src/ui/templateLoader.js +++ b/src/ui/templateLoader.js @@ -83,7 +83,7 @@ class TemplateLoader { const templatesInView = this.#store.getState().templates.list .filter((template) => ( template.enabled && template.canvasId === canvasId - && template.x < x && template.y < y + && template.x <= x && template.y <= y && template.x + template.width > x && template.y + template.height > y )); @@ -110,7 +110,7 @@ class TemplateLoader { return this.#store.getState().templates.list.filter((template) => ( template.enabled && template.canvasId === canvasId - && template.x < bottomX && template.y < bottomY + && template.x <= bottomX && template.y <= bottomY && template.x + template.width > topX && template.y + template.height > topY ));