From d9f54486f184551416545f6d4655158c5168586b Mon Sep 17 00:00:00 2001 From: HF Date: Mon, 5 Feb 2024 11:03:54 +0100 Subject: [PATCH] fix little things --- src/components/TemplateSettings.jsx | 1 - src/controls/PixelPainterControls.js | 2 +- src/ui/templateLoader.js | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) 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 ));