From 06a3c76a60d383de8a602c24d35b463ac72d3f5e Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Fri, 17 Jul 2015 15:51:49 -0400 Subject: [PATCH] Improved battle low-res width scaling Should no longer cause flickering when resized on OSes with visible scrollbars. --- js/client-battle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/client-battle.js b/js/client-battle.js index 3f4470a4e..a9618afc0 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -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 + ')');