Adding zoom out limit
This commit is contained in:
parent
85efe208b3
commit
613ff5d463
@ -41,6 +41,23 @@ export class HdpiManager {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Has the canvas more pixels than the screen? This is forbidden
|
||||||
|
if ((i - 1) * this._zoomModifier < 1) {
|
||||||
|
// Let's reset the zoom modifier (WARNING this is a SIDE EFFECT in a getter)
|
||||||
|
this._zoomModifier = 1 / (i - 1);
|
||||||
|
|
||||||
|
return {
|
||||||
|
game: {
|
||||||
|
width: realPixelScreenSize.width,
|
||||||
|
height: realPixelScreenSize.height,
|
||||||
|
},
|
||||||
|
real: {
|
||||||
|
width: realPixelScreenSize.width,
|
||||||
|
height: realPixelScreenSize.height,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
game: {
|
game: {
|
||||||
width: Math.ceil(realPixelScreenSize.width / (i - 1) / this._zoomModifier),
|
width: Math.ceil(realPixelScreenSize.width / (i - 1) / this._zoomModifier),
|
||||||
|
Loading…
Reference in New Issue
Block a user