浏览代码

Add missing \n to world_wrap. Close #2516

The issue was that world_wrap would skip over newlines, without adding them to the output.
Bojidar Marinov 10 年之前
父节点
当前提交
d9583f8a72
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/ustring.cpp

+ 1 - 1
core/ustring.cpp

@@ -3066,7 +3066,7 @@ String String::world_wrap(int p_chars_per_line) const {
 		} else if (operator[](i)==' ' || operator[](i)=='\t') {
 			last_space=i;
 		} else if (operator[](i)=='\n') {
-			ret+=substr(from,i-from);
+			ret+=substr(from,i-from)+"\n";
 			from=i+1;
 			last_space=-1;
 		}