equal
deleted
inserted
replaced
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 |