MCPcopy Create free account
hub / github.com/axmolengine/axmol / stripTrailingWhitespace

Method stripTrailingWhitespace

core/ui/UIRichText.cpp:2434–2451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2432} // namespace
2433
2434float 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
2453void RichText::adaptRenderers()
2454{

Callers

nothing calls this directly

Calls 6

rtrimFunction · 0.70
emptyMethod · 0.45
backMethod · 0.45
getContentSizeMethod · 0.45
getStringMethod · 0.45
setStringMethod · 0.45

Tested by

no test coverage detected