diff options
author | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-07 01:26:49 -0400 |
---|---|---|
committer | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-07 01:26:49 -0400 |
commit | 366244bec2d0aa0c395949efadc0a6f714547aa1 (patch) | |
tree | c0cbb072b0394376a5f272aca9af191078bb702b /app/controllers | |
parent | eaa0539a0413578cc0815cda46d7dc2567ed28bd (diff) | |
parent | f6412084d6aafe51a5da6ca31b5f1e79f2ca0029 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
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 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 |