This commit is contained in:
Schluffe
2026-05-28 19:53:31 +02:00
parent 6a960d7785
commit f8efda0ada
5 changed files with 17 additions and 14 deletions
+5 -5
View File
@@ -29,7 +29,7 @@ sceneChangeSet.add((sceneData) => {
});
export function drawSprites(ctx: CanvasRenderingContext2D): void {
const { bounds } = viewport;
const { boundaries } = viewport;
visibleDrawables.length = 0;
for (const drawable of drawables) {
@@ -40,10 +40,10 @@ export function drawSprites(ctx: CanvasRenderingContext2D): void {
const relY = pos.y + sprite.offset.y;
if (
relX + sprite.width > bounds.minX &&
relX < bounds.maxX &&
relY + sprite.height > bounds.minY &&
relY < bounds.maxY
relX + sprite.width > boundaries.minX &&
relX < boundaries.maxX &&
relY + sprite.height > boundaries.minY &&
relY < boundaries.maxY
) {
visibleDrawables.push(drawable);
}