Fixing CI
This commit is contained in:
parent
4b89e08ea6
commit
cd2873e9d3
@ -1444,8 +1444,8 @@ ${escapedMessage}
|
|||||||
*/
|
*/
|
||||||
private updateCameraOffset(): void {
|
private updateCameraOffset(): void {
|
||||||
const array = layoutManager.findBiggestAvailableArray();
|
const array = layoutManager.findBiggestAvailableArray();
|
||||||
let xCenter = (array.xEnd - array.xStart) / 2 + array.xStart;
|
const xCenter = (array.xEnd - array.xStart) / 2 + array.xStart;
|
||||||
let yCenter = (array.yEnd - array.yStart) / 2 + array.yStart;
|
const yCenter = (array.yEnd - array.yStart) / 2 + array.yStart;
|
||||||
|
|
||||||
const game = HtmlUtils.querySelectorOrFail<HTMLCanvasElement>('#game canvas');
|
const game = HtmlUtils.querySelectorOrFail<HTMLCanvasElement>('#game canvas');
|
||||||
// Let's put this in Game coordinates by applying the zoom level:
|
// Let's put this in Game coordinates by applying the zoom level:
|
||||||
|
@ -38,11 +38,7 @@ export class HdpiManager {
|
|||||||
|
|
||||||
let i = 1;
|
let i = 1;
|
||||||
|
|
||||||
while (true) {
|
while (realPixelNumber > this.minRecommendedGamePixelsNumber * i * i) {
|
||||||
if (realPixelNumber <= this.minRecommendedGamePixelsNumber * i * i) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class WaScaleManager {
|
|||||||
const style = this.scaleManager.canvas.style;
|
const style = this.scaleManager.canvas.style;
|
||||||
style.width = Math.ceil(realSize.width / devicePixelRatio) + 'px';
|
style.width = Math.ceil(realSize.width / devicePixelRatio) + 'px';
|
||||||
style.height = Math.ceil(realSize.height / devicePixelRatio) + 'px';
|
style.height = Math.ceil(realSize.height / devicePixelRatio) + 'px';
|
||||||
};
|
}
|
||||||
|
|
||||||
public get zoomModifier(): number {
|
public get zoomModifier(): number {
|
||||||
return this.hdpiManager.zoomModifier;
|
return this.hdpiManager.zoomModifier;
|
||||||
|
@ -35,7 +35,7 @@ describe("Test HdpiManager", () => {
|
|||||||
|
|
||||||
hdpiManager.zoomModifier = 11;
|
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.width).toEqual(64);
|
||||||
expect(result.game.height).toEqual(64);
|
expect(result.game.height).toEqual(64);
|
||||||
expect(hdpiManager.zoomModifier).toEqual(10);
|
expect(hdpiManager.zoomModifier).toEqual(10);
|
||||||
@ -47,7 +47,7 @@ describe("Test HdpiManager", () => {
|
|||||||
|
|
||||||
hdpiManager.zoomModifier = 1/10;
|
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.width).toEqual(1280);
|
||||||
expect(result.game.height).toEqual(768);
|
expect(result.game.height).toEqual(768);
|
||||||
expect(hdpiManager.zoomModifier).toEqual(1);
|
expect(hdpiManager.zoomModifier).toEqual(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user