Skip to content

Commit

Permalink
Fixed an issue with spectating battles on higher zoom levels
Browse files Browse the repository at this point in the history
The bar is far more useful when it’s on-screen.
  • Loading branch information
varkor committed Jan 9, 2016
1 parent a3345dc commit 7019e64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions battle/scripts/objects/general/BattleContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function BattleContext (client) {
originalContext.textBaseline = "middle";
originalContext.font = Font.load(10 * Game.zoom);
if (!Cursor.inArea(originalCanvas, position.x, position.y, position.width, position.height)) {
originalContext.fillTextHD("Spectating", (originalCanvasWidth / 2 + 10) * Game.zoom, position.y + position.height / 2);
originalContext.fillTextHD("Spectating", (originalCanvasWidth / 2 + 10 * Game.zoom), position.y + position.height / 2);
if (Math.floor(now / 1000) % 2) {
originalContext.fillStyle = "hsl(0, 100%, 50%)";
originalContext.fillCircleHD(position.x + 15 * Game.zoom, position.y + position.height / 2, 3 * Game.zoom);
Expand Down Expand Up @@ -565,7 +565,7 @@ function BattleContext (client) {
spectatingBar : function () {
var width = 80 * Game.zoom;
return {
x : (battleContext.canvas.width / window.devicePixelRatio * Game.zoom - width) / 2,
x : (battleContext.canvas.width / window.devicePixelRatio - width) / 2,
y : 0,
width,
height : 14 * Game.zoom
Expand Down

0 comments on commit 7019e64

Please sign in to comment.