handle 0x2028 line separator apache-flex-sdk-4.11.0RC1
authorAlex Harui <aharui@apache.org>
Fri, 11 Oct 2013 06:22:57 +0000 (23:22 -0700)
committerAlex Harui <aharui@apache.org>
Fri, 11 Oct 2013 06:23:38 +0000 (23:23 -0700)
textLayout/src/flashx/textLayout/elements/ParagraphElement.as

index f8fea72..896f873 100644 (file)
@@ -488,6 +488,9 @@ package flashx.textLayout.elements
                                        tl = tl.previousLine;
                                        if (!tl)
                                                return -1;
+                                       // need this when 0x2028 line separator in use
+                                       if (tl.textBlockBeginIndex + tl.rawTextLength == relativePosition)
+                                               return tl.textBlockBeginIndex + tl.rawTextLength - 1;
                                        return tl.textBlockBeginIndex + tl.rawTextLength;
                                }
                                while (--relativePosition)