forked from ppfun/pixelplanet
fix little things
This commit is contained in:
parent
779ae55057
commit
d9f54486f1
|
@ -168,7 +168,6 @@ const TemplateSettings = () => {
|
|||
<input
|
||||
type="file"
|
||||
key="impin"
|
||||
accept="image/*"
|
||||
ref={importRef}
|
||||
style={{ display: 'none' }}
|
||||
onChange={(evt) => {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue
Block a user