mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-28 10:10:31 +00:00
Center map on start (#1013)
## Description: - Adds logic to hard-set the transform handler directly to a new position, without a movement animation - Implements #1004    - removed a second initialization of the TransformHandler to prevent transformation desyncs between layers. Incidentally this probably fixes #62 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: demonessica --------- Co-authored-by: tnhnblgl <51187395+tnhnblgl@users.noreply.github.com>
This commit is contained in:
@@ -265,11 +265,8 @@ export class GameRenderer {
|
||||
window.addEventListener("resize", () => this.resizeCanvas());
|
||||
this.resizeCanvas();
|
||||
|
||||
this.transformHandler = new TransformHandler(
|
||||
this.game,
|
||||
this.eventBus,
|
||||
this.canvas,
|
||||
);
|
||||
//show whole map on startup
|
||||
this.transformHandler.centerAll(0.9);
|
||||
|
||||
requestAnimationFrame(() => this.renderGame());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user