Skip to content

Commit

Permalink
Force map to stay in view when resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
platz1de committed Oct 6, 2024
1 parent 82e90d0 commit de61928
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/game/action/MapNavigationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
ScrollEventListener
} from "../../event/InteractionManager";
import {mapTransformHandler} from "../../event/MapTransformHandler";
import {gameMap} from "../GameData";
import {gameMap, isPlaying} from "../GameData";
import {windowResizeHandler} from "../../event/WindowResizeHandler";

/**
* Default map navigation handler.
Expand Down Expand Up @@ -121,4 +122,6 @@ class MapNavigationHandler implements ScrollEventListener, DragEventListener, Mu
}
}

export const mapNavigationHandler = new MapNavigationHandler();
export const mapNavigationHandler = new MapNavigationHandler();

windowResizeHandler.register(() => isPlaying && mapNavigationHandler.onDragMove(0, 0, 0, 0));

0 comments on commit de61928

Please sign in to comment.