Skip to content

Commit 9258177

Browse files
committed
fix android tv resolution
1 parent 967c877 commit 9258177

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ app/qml.min.js
77
.cache/*
88
node_modules
99
.idea/
10+
.vscode
1011
test/qml/Output
1112
test/build.*
1213
test/.cache

platform/html5/html.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,19 @@ var WindowPrototype = exports.Window.prototype = Object.create(_globals.core.RAI
507507
WindowPrototype.constructor = exports.Window
508508

509509
WindowPrototype.width = function() {
510-
return this.dom.innerWidth
510+
if (navigator.userAgent.toLocaleLowerCase().match('android')) {
511+
return Math.floor(this.dom.innerWidth * this.dom.devicePixelRatio);
512+
} else {
513+
return this.dom.innerWidth;
514+
}
511515
}
512516

513517
WindowPrototype.height = function() {
514-
return this.dom.innerHeight
518+
if (navigator.userAgent.toLocaleLowerCase().match('android')) {
519+
return Math.floor(this.dom.innerHeight * this.dom.devicePixelRatio);
520+
} else {
521+
return this.dom.innerHeight;
522+
}
515523
}
516524

517525
WindowPrototype.scrollY = function() {

0 commit comments

Comments
 (0)