You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2014/11/23 23:18:57 UTC

git commit: [flex-tlf] [refs/heads/tables] - Reverted a commit from Alex that was lost with the last merge. Fixed line start index for TextFlowLine initialization

Repository: flex-tlf
Updated Branches:
  refs/heads/tables 741a40a49 -> 863d00f86


Reverted a commit from Alex that was lost with the last merge.
Fixed line start index for TextFlowLine initialization


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

Branch: refs/heads/tables
Commit: 863d00f860cf36b9355f18f3d24186c0fb9cd2be
Parents: 741a40a
Author: Harbs <ha...@in-tools.com>
Authored: Mon Nov 24 00:18:51 2014 +0200
Committer: Harbs <ha...@in-tools.com>
Committed: Mon Nov 24 00:18:51 2014 +0200

----------------------------------------------------------------------
 .../src/flashx/textLayout/compose/BaseCompose.as       |  3 +--
 .../src/flashx/textLayout/compose/ComposeState.as      | 13 ++++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/863d00f8/textLayout/src/flashx/textLayout/compose/BaseCompose.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/BaseCompose.as b/textLayout/src/flashx/textLayout/compose/BaseCompose.as
index d1b675f..3ed8352 100644
--- a/textLayout/src/flashx/textLayout/compose/BaseCompose.as
+++ b/textLayout/src/flashx/textLayout/compose/BaseCompose.as
@@ -1390,8 +1390,6 @@ package flashx.textLayout.compose
 
 			_curLine.initialize(_curParaElement, targetWidth, lineOffset-_parcelList.insideListItemMargin, _curLineStart, textLine.rawTextLength, textLine);
 			CONFIG::debug { assert(_curLine.targetWidth == targetWidth,"Bad targetWidth"); }
-
-			_curLineStart += _curLine.textLength;
 			return textLine;
 		}
 		
@@ -1415,6 +1413,7 @@ package flashx.textLayout.compose
 		/** Called when we are finished composing a line, and it is committed. Handler for derived classes to override default behavior.  */
 		protected function endLine(textLine:TextLine):void	// No PMD
 		{
+			_curLineStart += _curLine.textLength;
 			_contentCommittedExtent = Math.max(_contentCommittedExtent, _workingContentExtent);
 			_contentCommittedHeight = Math.max(_contentCommittedHeight, _workingContentHeight);
 			_contentLogicalExtent = Math.max(_contentLogicalExtent, _workingContentLogicalExtent);

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/863d00f8/textLayout/src/flashx/textLayout/compose/ComposeState.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/compose/ComposeState.as b/textLayout/src/flashx/textLayout/compose/ComposeState.as
index e170bae..171e1b6 100644
--- a/textLayout/src/flashx/textLayout/compose/ComposeState.as
+++ b/textLayout/src/flashx/textLayout/compose/ComposeState.as
@@ -347,11 +347,14 @@ package flashx.textLayout.compose
 			var startCompose:int = _curElementStart + _curElementOffset - _curParaStart;
 			var line:TextFlowLine = _curLineIndex < _flowComposer.numLines ? (_flowComposer as StandardFlowComposer).lines[_curLineIndex] : null;
 			var useExistingLine:Boolean = line && (!line.isDamaged() || line.validity == FlowDamageType.GEOMETRY);
-			// if the line ends with a hyphen, don't use existing line because the player seems to mis-handle
-			// starting the next line.
-			if (useExistingLine && line.textLength > 0 &&
-				line.paragraph.getCharCodeAtPosition(line.absoluteStart + line.textLength - 1) == 0xAD)
-				useExistingLine = false;
+			if (ContainerController.tlf_internal::usesDiscretionaryHyphens)
+			{
+				// if the line ends with a hyphen, don't use existing line because the player seems to mis-handle
+				// starting the next line.
+				if (useExistingLine && line.textLength > 0 &&
+					line.paragraph.getCharCodeAtPosition(line.absoluteStart + line.textLength - 1) == 0xAD)
+					useExistingLine = false;
+			}
 			var numberLine:TextLine;
 			
 			// create numberLine if in a listElement