Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
CaviarChen committed Dec 9, 2024
1 parent 2514d28 commit cda871a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions editor/src/utils/MapRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class Internal {

const block =
fogMap.tiles[FogMap.FogMap.makeKeyXY(fowTileX, fowTileY)]?.blocks[
FogMap.FogMap.makeKeyXY(fowBlockX, fowBlockY)
FogMap.FogMap.makeKeyXY(fowBlockX, fowBlockY)
];

if (block) {
Expand Down Expand Up @@ -423,18 +423,18 @@ export class MapRenderer {
this.mainCanvas.height = 512 * (bottom - top + 1);
this.renderOnce();
const tileBounds = new mapboxgl.LngLatBounds(
tileXYToLngLat([left, top], zoom),
tileXYToLngLat([right + 1, bottom + 1], zoom)
tileXYToLngLat([left, bottom + 1], zoom),
tileXYToLngLat([right + 1, top], zoom)
);

const mainCanvasSource = this.mapboxMap.getSource(
"main-canvas-source"
) as mapboxgl.CanvasSource | undefined;
mainCanvasSource?.setCoordinates([
tileBounds.getSouthWest().toArray(),
tileBounds.getSouthEast().toArray(),
tileBounds.getNorthEast().toArray(),
tileBounds.getNorthWest().toArray(),
tileBounds.getNorthEast().toArray(),
tileBounds.getSouthEast().toArray(),
tileBounds.getSouthWest().toArray(),
]);
}

Expand Down

0 comments on commit cda871a

Please sign in to comment.