(
lines: &[String],
x: i32,
y: i32,
size: i32,
line_height: i32,
class_name: &str,
)
| 258 | let mut current = String::new(); |
| 259 | for word in text.split_whitespace() { |
| 260 | if !current.is_empty() && current.len() + word.len() + 1 > max_chars { |
| 261 | lines.push(current); |
| 262 | current = String::new(); |
| 263 | if lines.len() == max_lines { |
| 264 | break; |
| 265 | } |
| 266 | } |
| 267 | if !current.is_empty() { |
| 268 | current.push(' '); |
| 269 | } |
| 270 | current.push_str(word); |
| 271 | } |
| 272 | if !current.is_empty() && lines.len() < max_lines { |
| 273 | lines.push(current); |
| 274 | } |
| 275 | lines |
| 276 | } |
| 277 | |
| 278 | #[cfg(feature = "ssr")] |
| 279 | fn svg_text_lines( |
| 280 | lines: &[String], |
| 281 | x: i32, |
| 282 | y: i32, |
| 283 | size: i32, |
| 284 | line_height: i32, |
no test coverage detected