summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-07 01:06:50 -0400
committertkimia <tkimia@purdue.edu>2014-04-07 01:06:50 -0400
commitc524bba025ffd09044ce35efc85ee720f3179111 (patch)
treeeee71355d8fbbf65179ccbc2a67ea091ecdb049a /app/controllers/matches_controller.rb
parent3602d46e95f9a13ec2a8ff0b0909059af64c55ba (diff)
lol# On branch master
Diffstat (limited to 'app/controllers/matches_controller.rb')
-rw-r--r--app/controllers/matches_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index f196978..1d4ee27 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -9,10 +9,11 @@ class MatchesController < ApplicationController
def index
@matches = @tournament.matches
- # width of SVG
- @width = 300 * (Math.log2(@matches.count).floor + 1);
+ # depth of SVG tree
+ @depth = Math.log2(@matches.count).floor+1;
# height of SVG
@height = 200 * 2**Math.log2(@matches.count).floor + 100;
+ @h_sector = 2**(@depth-1)+1
end
# For compatability with the router assumptions made by ApplicationController#check_permission