summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
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 0074eb9..93b5514 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