| 2404 | } // namespace |
| 2405 | |
| 2406 | void RichText::doHorizontalAlignment(const Vector<ax::Node*>& row, float rowWidth) |
| 2407 | { |
| 2408 | const auto alignment = static_cast<HorizontalAlignment>(_defaults.at(KEY_HORIZONTAL_ALIGNMENT).asInt()); |
| 2409 | if (alignment != HorizontalAlignment::LEFT) |
| 2410 | { |
| 2411 | const auto diff = stripTrailingWhitespace(row); |
| 2412 | const auto leftOver = getContentSize().width - (rowWidth + diff); |
| 2413 | const float leftPadding = getPaddingAmount(alignment, leftOver); |
| 2414 | const Vec2 offset(leftPadding, 0.f); |
| 2415 | for (auto&& node : row) |
| 2416 | { |
| 2417 | node->setPosition(node->getPosition() + offset); |
| 2418 | } |
| 2419 | } |
| 2420 | } |
| 2421 | |
| 2422 | namespace |
| 2423 | { |
nothing calls this directly
no test coverage detected