 svg.append("path").classed("left-goal", true)
 svg.append("path").classed("right-goal", true)
 svg.append("text").classed("time-left", true)
+  .attr("lengthAdjust", "spacingAndGlyphs")
 svg.append("text").classed("team-name", true)
   .classed("left-name", true)
   .attr("text-anchor", "start")
-  .attr("alignment-baseline", "hanging")
+  .attr("lengthAdjust", "spacingAndGlyphs")
 svg.append("text").classed("team-name", true)
   .classed("right-name", true)
   .attr("text-anchor", "end")
-  .attr("alignment-baseline", "hanging")
+  .attr("lengthAdjust", "spacingAndGlyphs")
 
 # draw default sized field
 drawField(default_geometry_field)


  f.select(".field-line")
    .transition()
    .duration(750)
    .attr("d", field_path)

  f.select(".left-goal")
    .classed("blue", is_blue_left)
    .classed("yellow", not is_blue_left)
    .transition()
    .duration(750)
    .attr("d", left_goal_path)

  f.select(".right-goal")
    .classed("blue", not is_blue_left)
    .classed("yellow", is_blue_left)
    .transition()
    .duration(750)
    .attr("d", right_goal_path)

  sp = 25

  f.select(".time-left")
    .attr("x", 0)
    .attr("y", (f) -> -f.field_width / 2 - sp)

  f.select(".left-name")
    .attr("x", (f) -> -f.field_length / 2 + sp)
    .attr("y", (f) -> -f.field_width / 2 + sp)

  f.select(".right-name")
    .attr("x", (f) -> f.field_length / 2 - sp)
    .attr("y", (f) -> -f.field_width / 2 + sp)

# in miliseconds
max_screen_time = 100

# Time voodoo: converting ticks to minutes:seconds
#XXX: tried to use moment.js without success
ticks_to_time = (ticks) ->
  if ticks?
    time = "#{pad(~~(Math.abs(ticks) / (60 * 1000000)), 2, " ")}:#{pad(Math.abs(~~(ticks / 1000000)) % 60, 2)}"
    if ticks > 0 then time else "-#{time}"
