From 777a76e94e54fa7c0be3b493e9394e35513f5be7 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 24 Feb 2017 22:59:05 -0600 Subject: [PATCH] Zoom now works. --- game-client.js | 3 ++- public/bundle.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game-client.js b/game-client.js index 39cc532..5ce0515 100644 --- a/game-client.js +++ b/game-client.js @@ -462,7 +462,8 @@ $(function() { barOffset = ctx.measureText(user.name).width + 10; ctx.fillText(user.name, 5, CELL_WIDTH - 5); - zoom = .0014 / lagPortion; + zoom = 1 / (lagPortion + 1); //Zoom goes from 1 to .5, decreasing as portion goes up. TODO: maybe can modify this? + console.log(zoom); //Draw filled bar. ctx.fillStyle = "rgba(180, 180, 180, .3)"; diff --git a/public/bundle.js b/public/bundle.js index c83c4b8..1283900 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -560,7 +560,8 @@ $(function() { barOffset = ctx.measureText(user.name).width + 10; ctx.fillText(user.name, 5, CELL_WIDTH - 5); - zoom = .0014 / lagPortion; + zoom = 1 / (lagPortion + 1); //Zoom goes from 1 to .5, decreasing as portion goes up. TODO: maybe can modify this? + console.log(zoom); //Draw filled bar. ctx.fillStyle = "rgba(180, 180, 180, .3)";