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