Fixing CI

This commit is contained in:
David Négrier 2021-05-05 13:14:00 +02:00
parent 4b89e08ea6
commit cd2873e9d3
4 changed files with 6 additions and 10 deletions

View File

@ -1444,8 +1444,8 @@ ${escapedMessage}
*/
private updateCameraOffset(): void {
const array = layoutManager.findBiggestAvailableArray();
let xCenter = (array.xEnd - array.xStart) / 2 + array.xStart;
let yCenter = (array.yEnd - array.yStart) / 2 + array.yStart;
const xCenter = (array.xEnd - array.xStart) / 2 + array.xStart;
const yCenter = (array.yEnd - array.yStart) / 2 + array.yStart;
const game = HtmlUtils.querySelectorOrFail<HTMLCanvasElement>('#game canvas');
// Let's put this in Game coordinates by applying the zoom level:

View File

@ -38,11 +38,7 @@ export class HdpiManager {
let i = 1;
while (true) {
if (realPixelNumber <= this.minRecommendedGamePixelsNumber * i * i) {
break;
}
while (realPixelNumber > this.minRecommendedGamePixelsNumber * i * i) {
i++;
}

View File

@ -32,7 +32,7 @@ class WaScaleManager {
const style = this.scaleManager.canvas.style;
style.width = Math.ceil(realSize.width / devicePixelRatio) + 'px';
style.height = Math.ceil(realSize.height / devicePixelRatio) + 'px';
};
}
public get zoomModifier(): number {
return this.hdpiManager.zoomModifier;

View File

@ -35,7 +35,7 @@ describe("Test HdpiManager", () => {
hdpiManager.zoomModifier = 11;
let result = hdpiManager.getOptimalGameSize({ width: 640, height: 640 });
const result = hdpiManager.getOptimalGameSize({ width: 640, height: 640 });
expect(result.game.width).toEqual(64);
expect(result.game.height).toEqual(64);
expect(hdpiManager.zoomModifier).toEqual(10);
@ -47,7 +47,7 @@ describe("Test HdpiManager", () => {
hdpiManager.zoomModifier = 1/10;
let result = hdpiManager.getOptimalGameSize({ width: 1280, height: 768 });
const result = hdpiManager.getOptimalGameSize({ width: 1280, height: 768 });
expect(result.game.width).toEqual(1280);
expect(result.game.height).toEqual(768);
expect(hdpiManager.zoomModifier).toEqual(1);