equal
deleted
inserted
replaced
264 XML.traverse_text(formatted)(if (XML.text_length(formatted) == 0) 0 else 1)( |
264 XML.traverse_text(formatted)(if (XML.text_length(formatted) == 0) 0 else 1)( |
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 (0.0 /: split_lines(XML.content(formatted)))({ 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 else margin |
272 else margin |
272 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 |
273 |
274 |
274 new Dimension(w min w_max, h min h_max) |
275 new Dimension(w min w_max, h min h_max) |
275 } |
276 } |