Repository: flex-tlf
Updated Branches:
  refs/heads/develop 446d1a03e -> 9280a37b9


FLEX-34649 Handle situation where textlines don't exist because they've been 
scrolled off-screen


Project: http://git-wip-us.apache.org/repos/asf/flex-tlf/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-tlf/commit/9280a37b
Tree: http://git-wip-us.apache.org/repos/asf/flex-tlf/tree/9280a37b
Diff: http://git-wip-us.apache.org/repos/asf/flex-tlf/diff/9280a37b

Branch: refs/heads/develop
Commit: 9280a37b9d26bc3f957c0801661793422b0b9a2b
Parents: 446d1a0
Author: Alex Harui <[email protected]>
Authored: Thu Dec 11 20:36:20 2014 -0800
Committer: Alex Harui <[email protected]>
Committed: Thu Dec 11 20:36:20 2014 -0800

----------------------------------------------------------------------
 .../src/flashx/textLayout/elements/ParagraphElement.as       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/9280a37b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/elements/ParagraphElement.as 
b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
index 5db84d0..2e8cd33 100644
--- a/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
+++ b/textLayout/src/flashx/textLayout/elements/ParagraphElement.as
@@ -801,9 +801,9 @@ package flashx.textLayout.elements
                        var tb:TextBlock = 
getTextBlockAtPosition(relativePosition);
                        var tbStart:int = getTextBlockStart(tb);
                        var textBlockPos:int = relativePosition - tbStart;
-                       if 
(ContainerController.tlf_internal::usesDiscretionaryHyphens)
+            var tl:TextLine = tb.getTextLineAtCharIndex(textBlockPos);
+                       if 
(ContainerController.tlf_internal::usesDiscretionaryHyphens && tl != null)
                        {
-                               var tl:TextLine = 
tb.getTextLineAtCharIndex(textBlockPos);
                                var currentAtomIndex:int = 
tl.getAtomIndexAtCharIndex(textBlockPos);
                 //trace("relpos", relativePosition, "atomIndex", 
currentAtomIndex);
                 var isRTL:Boolean = tl.getAtomBidiLevel(currentAtomIndex) == 1;
@@ -895,9 +895,9 @@ package flashx.textLayout.elements
                        var tb:TextBlock = 
getTextBlockAtPosition(relativePosition);
                        var tbStart:int = getTextBlockStart(tb);
                        var textBlockPos:int = relativePosition - tbStart;
-                       if 
(ContainerController.tlf_internal::usesDiscretionaryHyphens)
+            var tl:TextLine = tb.getTextLineAtCharIndex(textBlockPos);
+                       if 
(ContainerController.tlf_internal::usesDiscretionaryHyphens && tl != null)
                        {
-                               var tl:TextLine = 
tb.getTextLineAtCharIndex(textBlockPos);
                                var currentAtomIndex:int = 
tl.getAtomIndexAtCharIndex(textBlockPos);
                 //trace("relpos", relativePosition, "atomIndex", 
currentAtomIndex);
                 var isRTL:Boolean = tl.getAtomBidiLevel(currentAtomIndex) == 1;

Reply via email to