added 1/4 retina display
This commit is contained in:
parent
8c448a0fa0
commit
0e9db3d7ab
2 changed files with 9 additions and 1 deletions
|
@ -31,6 +31,8 @@
|
|||
|
||||
#canvas {
|
||||
position: absolute;
|
||||
left:0;
|
||||
right:0;
|
||||
/*height:100%;
|
||||
width:100%;*/
|
||||
background-color:#ecf0f1;
|
||||
|
@ -45,7 +47,7 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas" width="100%" height="100%"></canvas>
|
||||
<canvas id="canvas"></canvas>
|
||||
<div id='devtools' style='z-index:3;display:none;position:absolute;left:50%;width:400px;height:400px;top:50%;margin-top:-200px;margin-left:-200px;'>
|
||||
<h2 id = 'clickToExit' style = 'background-color:#fff;color:#000'>Click to exit</h2>
|
||||
<textarea id ='devtoolsText' style = 'height:300px;width:400px;'></textarea>
|
||||
|
|
|
@ -11,6 +11,12 @@ function scaleCanvas() {
|
|||
} else {
|
||||
settings.scale = canvas.height/800;
|
||||
}
|
||||
|
||||
if (window.devicePixelRatio) {
|
||||
canvas.style.width = canvas.width/window.devicePixelRatio + "px";
|
||||
canvas.style.height = canvas.height/window.devicePixelRatio + "px";
|
||||
ctx.scale(window.devicePixelRatio,window.devicePixelRatio)
|
||||
}
|
||||
}
|
||||
|
||||
var canvas = document.getElementById('canvas');
|
||||
|
|
Loading…
Reference in a new issue