diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/matches_controller.rb | 5 |
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 |