Improved battle low-res width scaling

Should no longer cause flickering when resized on OSes with
visible scrollbars.
This commit is contained in:
Guangcong Luo
2015-07-17 15:51:49 -04:00
parent 34e49846fa
commit 06a3c76a60

View File

@@ -59,13 +59,13 @@
return true;
},
updateLayout: function () {
var width = this.$el.width();
var width = $(window).width();
if (width < 950) {
this.battle.messageDelay = 800;
} else {
this.battle.messageDelay = 8;
}
if (width < 640) {
if (width && width < 640) {
var scale = (width/640);
this.$battle.css('transform', 'scale(' + scale + ')');
this.$foeHint.css('transform', 'scale(' + scale + ')');