fix little things

This commit is contained in:
HF 2024-02-05 11:03:54 +01:00
parent 779ae55057
commit d9f54486f1
3 changed files with 3 additions and 4 deletions

View File

@ -168,7 +168,6 @@ const TemplateSettings = () => {
<input
type="file"
key="impin"
accept="image/*"
ref={importRef}
style={{ display: 'none' }}
onChange={(evt) => {

View File

@ -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;
}

View File

@ -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
));