implement word wrap in text node

This commit is contained in:
2019-09-13 21:36:14 +02:00
parent 53787409cb
commit bbd9dfc4a9
4 changed files with 92 additions and 43 deletions

View File

@@ -544,23 +544,6 @@ glm::vec3 convert_rgb2hsv(const glm::vec3 c)
return glm::vec3(fabs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
std::vector<std::string> split(const std::string& subject, char d, int max_split/* = 0*/)
{
std::vector<std::string> ret;
size_t start = 0;
size_t n = subject.find_first_of(d);
while (n != std::string::npos)
{
ret.push_back(subject.substr(start, n - start));
start = n + 1;
if (max_split && ret.size() == max_split)
break;
n = subject.find_first_of(d, start);
}
ret.push_back(subject.substr(start));
return ret;
}
std::string unescape(const std::string& s)
{
std::string res;