| 2432 | } // namespace |
| 2433 | |
| 2434 | float RichText::stripTrailingWhitespace(const Vector<ax::Node*>& row) |
| 2435 | { |
| 2436 | if (!row.empty()) |
| 2437 | { |
| 2438 | if (auto label = dynamic_cast<Label*>(row.back())) |
| 2439 | { |
| 2440 | const auto width = label->getContentSize().width; |
| 2441 | std::string trimmedString{label->getString()}; |
| 2442 | rtrim(trimmedString); |
| 2443 | if (label->getString() != trimmedString) |
| 2444 | { |
| 2445 | label->setString(trimmedString); |
| 2446 | return label->getContentSize().width - width; |
| 2447 | } |
| 2448 | } |
| 2449 | } |
| 2450 | return 0.0f; |
| 2451 | } |
| 2452 | |
| 2453 | void RichText::adaptRenderers() |
| 2454 | { |