fix: change scale for solid textures and clean up

This commit is contained in:
trafficlunar 2025-01-12 14:25:59 +00:00
parent 5af7113247
commit 8a5182fa13
5 changed files with 4 additions and 11 deletions

View file

@ -48,7 +48,7 @@ function Blocks({
tilemap.clear();
// Tile solid colors at smaller scales
if (scale >= 0.5) {
if (scale >= 0.4) {
blocks.forEach((block) => {
tilemap.tile(textures[block.name] ?? missingTexture, block.x * 16, block.y * 16);
});

View file

@ -282,6 +282,7 @@ function Canvas() {
resizeCanvas();
return () => resizeObserver.disconnect();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [stageContainerRef]);
useEffect(() => {

View file

@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { CanvasContext } from "@/context/Canvas";
import { useContext, useEffect, useState } from "react";