mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-10 17:18:44 +08:00
[ts][webgl] Use devicePixelRatio for hdpi screens
This commit is contained in:
parent
6c689eb5f8
commit
e6e2c95b2c
@ -10674,8 +10674,9 @@ var spine;
|
||||
};
|
||||
SceneRenderer.prototype.resize = function (resizeMode) {
|
||||
var canvas = this.canvas;
|
||||
var w = canvas.clientWidth;
|
||||
var h = canvas.clientHeight;
|
||||
var dpr = window.devicePixelRatio || 1;
|
||||
var w = Math.round(canvas.clientWidth * dpr);
|
||||
var h = Math.round(canvas.clientHeight * dpr);
|
||||
if (canvas.width != w || canvas.height != h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -10424,8 +10424,9 @@ var spine;
|
||||
};
|
||||
SceneRenderer.prototype.resize = function (resizeMode) {
|
||||
var canvas = this.canvas;
|
||||
var w = canvas.clientWidth;
|
||||
var h = canvas.clientHeight;
|
||||
var dpr = window.devicePixelRatio || 1;
|
||||
var w = Math.round(canvas.clientWidth * dpr);
|
||||
var h = Math.round(canvas.clientHeight * dpr);
|
||||
if (canvas.width != w || canvas.height != h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -10424,8 +10424,9 @@ var spine;
|
||||
};
|
||||
SceneRenderer.prototype.resize = function (resizeMode) {
|
||||
var canvas = this.canvas;
|
||||
var w = canvas.clientWidth;
|
||||
var h = canvas.clientHeight;
|
||||
var dpr = window.devicePixelRatio || 1;
|
||||
var w = Math.round(canvas.clientWidth * dpr);
|
||||
var h = Math.round(canvas.clientHeight * dpr);
|
||||
if (canvas.width != w || canvas.height != h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -15,7 +15,7 @@ body {
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="container" style="width:640px; height:380px"></div>
|
||||
<div id="container" style="width:100%; height:100px"></div>
|
||||
<div id="container-raptor" style="width:640px; height:380px"></div>
|
||||
<div>
|
||||
<button id="walk">Walk</button>
|
||||
|
||||
@ -447,8 +447,10 @@ module spine.webgl {
|
||||
|
||||
resize (resizeMode: ResizeMode) {
|
||||
let canvas = this.canvas;
|
||||
var w = canvas.clientWidth;
|
||||
var h = canvas.clientHeight;
|
||||
var dpr = window.devicePixelRatio || 1;
|
||||
var w = Math.round(canvas.clientWidth * dpr);
|
||||
var h = Math.round(canvas.clientHeight * dpr);
|
||||
|
||||
if (canvas.width != w || canvas.height != h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user