|
|
|
@ -2627,8 +2627,11 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
std::string Wrap(std::string str,vd2d size,bool proportional) { |
|
|
|
|
int marker=0; |
|
|
|
|
std::string newStr=""; |
|
|
|
|
bool firstChar=false; |
|
|
|
|
while (marker<str.length()) { |
|
|
|
|
newStr+=str[marker]; |
|
|
|
|
if (firstChar||!firstChar&&str[marker]!=' ') { |
|
|
|
|
newStr+=str[marker]; |
|
|
|
|
} |
|
|
|
|
vd2d siz; |
|
|
|
|
if (proportional) { |
|
|
|
|
siz=GetTextSizeProp(newStr); |
|
|
|
@ -2639,13 +2642,17 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
do { |
|
|
|
|
if (newStr[newStr.length()-1]!=' ') { |
|
|
|
|
marker--; |
|
|
|
|
//printf("%s\n",newStr.c_str());
|
|
|
|
|
} |
|
|
|
|
newStr.erase(newStr.end()-1); |
|
|
|
|
} while (newStr[newStr.length()-1]!=' '); |
|
|
|
|
newStr.erase(newStr.end()-1); |
|
|
|
|
//newStr.erase(newStr.end()-1);
|
|
|
|
|
newStr+='\n'; |
|
|
|
|
firstChar=false; |
|
|
|
|
} else { |
|
|
|
|
firstChar=true; |
|
|
|
|
marker++; |
|
|
|
|
} |
|
|
|
|
marker++; |
|
|
|
|
} |
|
|
|
|
return newStr; |
|
|
|
|
} |
|
|
|
|