src/Tools/jEdit/src/pretty_tooltip.scala
changeset 58767 30766b5fd0e1
parent 57849 6d8f97d555d8
child 64621 7116f2634e32
equal deleted inserted replaced
58766:5bab56d3dcd4 58767:30766b5fd0e1
   262       val formatted = Pretty.formatted(info.info, margin, metric)
   262       val formatted = Pretty.formatted(info.info, margin, metric)
   263       val lines =
   263       val lines =
   264         XML.traverse_text(formatted)(0)(
   264         XML.traverse_text(formatted)(0)(
   265           (n: Int, s: String) => n + s.iterator.filter(_ == '\n').length)
   265           (n: Int, s: String) => n + s.iterator.filter(_ == '\n').length)
   266 
   266 
   267       val h = painter.getFontMetrics.getHeight * (lines + 1) + geometry.deco_height
   267       val h = painter.getLineHeight * (lines + 1) + geometry.deco_height
   268       val margin1 =
   268       val margin1 =
   269         if (h <= h_max)
   269         if (h <= h_max)
   270           (0.0 /: split_lines(XML.content(formatted)))({ case (m, line) => m max metric(line) })
   270           (0.0 /: split_lines(XML.content(formatted)))({ case (m, line) => m max metric(line) })
   271         else margin
   271         else margin
   272       val w = (metric.unit * (margin1 + metric.average)).round.toInt + geometry.deco_width
   272       val w = (metric.unit * (margin1 + metric.average)).round.toInt + geometry.deco_width