implement word wrap in text node
This commit is contained in:
17
src/util.cpp
17
src/util.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user