src/Tools/Graphview/metrics.scala
changeset 59293 305e79989d48
parent 59290 569a8109eeb2
child 59302 4d985afc0565
equal deleted inserted replaced
59292:fef652c88263 59293:305e79989d48
    33   val space_width = string_bounds(" ").getWidth
    33   val space_width = string_bounds(" ").getWidth
    34   def char_width: Double = mix.getWidth / 3
    34   def char_width: Double = mix.getWidth / 3
    35   def height: Double = mix.getHeight
    35   def height: Double = mix.getHeight
    36   def ascent: Double = font.getLineMetrics("", Metrics.font_render_context).getAscent
    36   def ascent: Double = font.getLineMetrics("", Metrics.font_render_context).getAscent
    37   def gap: Double = mix.getWidth
    37   def gap: Double = mix.getWidth
    38   def pad: Double = char_width
    38   def pad_x: Double = char_width * 1.5
       
    39   def pad_y: Double = char_width
    39 
    40 
    40   def box_width2(node: Graph_Display.Node): Double =
    41   def box_width2(node: Graph_Display.Node): Double =
    41     ((string_bounds(node.toString).getWidth + pad) / 2).ceil
    42     ((string_bounds(node.toString).getWidth + pad_x) / 2).ceil
    42   def box_gap: Double = gap.ceil
    43   def box_gap: Double = gap.ceil
    43   def box_height(n: Int): Double = (char_width * 1.5 * (5 max n)).ceil
    44   def box_height(n: Int): Double = (char_width * 1.5 * (5 max n)).ceil
    44 }
    45 }
    45 
    46