flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/6] git commit: [flex-asjs] [refs/heads/tlf] - implement a few more things needed for backspace
Date Tue, 09 May 2017 17:59:59 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/tlf ccfe255e1 -> 4ab06d52c


implement a few more things needed for backspace


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3413a1e2
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3413a1e2
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3413a1e2

Branch: refs/heads/tlf
Commit: 3413a1e2a24921ca6da8fc25444df3da3f04a332
Parents: 95c47d3
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 9 08:10:52 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 9 08:14:03 2017 -0700

----------------------------------------------------------------------
 .../flex/org/apache/flex/text/html/TextBlock.as | 23 +++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3413a1e2/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
index 934b8e5..cb9cd5d 100644
--- a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
+++ b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
@@ -219,6 +219,7 @@ package org.apache.flex.text.html
 				span.text = textElem.text;
 				//span.element.style.display = "block";
 				tl.addElement(span);
+				lines.push(tl);
 			}
 			if (previousLine == null)
 				_firstLine = tl;
@@ -230,8 +231,7 @@ package org.apache.flex.text.html
 		}
 		public function findNextAtomBoundary(afterCharIndex:int):int
 		{
-			trace("findNextAtomBoundary not implemented");
-			return 0;
+			return afterCharIndex + 1;
 		}
 		public function findNextWordBoundary(afterCharIndex:int):int
 		{
@@ -240,8 +240,7 @@ package org.apache.flex.text.html
 		}
 		public function findPreviousAtomBoundary(beforeCharIndex:int):int
 		{
-			trace("findPreviousAtomBoundary not implemented");
-			return 0;
+			return beforeCharIndex - 1;
 		}
 		public function findPreviousWordBoundary(beforeCharIndex:int):int
 		{
@@ -250,7 +249,21 @@ package org.apache.flex.text.html
 		}
 		public function getTextLineAtCharIndex(charIndex:int):ITextLine
 		{
-			trace("getTextLineAtCharIndex not implemented");
+			var lineIndex:int = 0;
+			for each (var line:TextLine in lines)
+			{
+				COMPILE::SWF
+				{
+				lineIndex += line.textField.text.length;
+				}
+				COMPILE::JS
+				{
+				lineIndex += line.element.firstChild.textContent.length;
+				}
+				if (lineIndex > charIndex)
+				  	return line;
+				
+			}
 			return null;
 		}
 		public function recreateTextLine(textLine:ITextLine, previousLine:ITextLine = null, width:Number
= 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):ITextLine


Mime
View raw message