Commit 72e5ad44d1438a2ba98cc93d094b15977ccf2269

David McFarland 2014-08-02T21:12:12

Fix for incorrect handling of empty lines in FTSimpleLayout

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/FTLayout/FTSimpleLayout.cpp b/src/FTLayout/FTSimpleLayout.cpp
index 864cad7..d1a8e55 100644
--- a/src/FTLayout/FTSimpleLayout.cpp
+++ b/src/FTLayout/FTSimpleLayout.cpp
@@ -262,9 +262,12 @@ inline void FTSimpleLayoutImpl::WrapTextI(const T *buf, const int len,
                 ++breakChar; --charCount;
             }
 
-            OutputWrapped(lineStart.getBufferFromHere(), breakCharCount,
-                          //breakItr.getBufferFromHere() - lineStart.getBufferFromHere(),
-                          position, renderMode, remainingWidth, bounds);
+            if(breakCharCount >= 0)
+            {
+                OutputWrapped(lineStart.getBufferFromHere(), breakCharCount,
+                              //breakItr.getBufferFromHere() - lineStart.getBufferFromHere(),
+                              position, renderMode, remainingWidth, bounds);
+            }
 
             // Store the start of the next line
             lineStart = breakChar;