src/Tools/jEdit/src/pretty_tooltip.scala
changeset 73359 d8a0e996614b
parent 73358 78aa7846e91f
child 73367 77ef8bef0593
equal deleted inserted replaced
73358:78aa7846e91f 73359:d8a0e996614b
   265           (n: Int, s: String) => n + s.iterator.count(_ == '\n'))
   265           (n: Int, s: String) => n + s.iterator.count(_ == '\n'))
   266 
   266 
   267       val h = painter.getLineHeight * lines + geometry.deco_height
   267       val h = painter.getLineHeight * lines + geometry.deco_height
   268       val margin1 =
   268       val margin1 =
   269         if (h <= h_max) {
   269         if (h <= h_max) {
   270           split_lines(XML.content(formatted)).foldLeft(0.0)({ case (m, line) => m max metric(line) })
   270           split_lines(XML.content(formatted)).foldLeft(0.0) { case (m, line) => m max metric(line) }
   271         }
   271         }
   272         else margin
   272         else margin
   273       val w = (metric.unit * (margin1 + metric.average)).round.toInt + geometry.deco_width
   273       val w = (metric.unit * (margin1 + metric.average)).round.toInt + geometry.deco_width
   274 
   274 
   275       new Dimension(w min w_max, h min h_max)
   275       new Dimension(w min w_max, h min h_max)