flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject [11/25] git commit: [flex-tlf] [refs/heads/develop] - Cells were incorrectly setting padding every time they were composed which was causing cell lines to become incorrectly invalid and put cells into an unstable state. I think ContainerController should
Date Fri, 28 Nov 2014 00:20:51 GMT
Cells were incorrectly setting padding every time they were composed which was causing cell
lines to become incorrectly invalid and put cells into an unstable state.
I think ContainerController should be adding the array including tables to _shapeChildren
and not the old _linesInView which only contains pure lines.


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

Branch: refs/heads/develop
Commit: d159e00c74a698276221fe3c4e1d6e4a5fc14cb5
Parents: b901150
Author: Harbs <harbs@in-tools.com>
Authored: Sun Oct 26 23:08:40 2014 +0200
Committer: Harbs <harbs@in-tools.com>
Committed: Sun Oct 26 23:08:40 2014 +0200

----------------------------------------------------------------------
 .../textLayout/container/ContainerController.as |  3 +-
 .../textLayout/elements/TableCellElement.as     | 47 +++++++++++++++-----
 2 files changed, 39 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d159e00c/textLayout/src/flashx/textLayout/container/ContainerController.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/container/ContainerController.as b/textLayout/src/flashx/textLayout/container/ContainerController.as
index 2e375f4..eef34fb 100644
--- a/textLayout/src/flashx/textLayout/container/ContainerController.as
+++ b/textLayout/src/flashx/textLayout/container/ContainerController.as
@@ -3248,7 +3248,8 @@ package flashx.textLayout.container
 			{
 				// We only updated some of the lines. Remove the old versions off the end, and add in
the new ones from _linesInView
 				_shapeChildren.length = shapeChildrenStartIdx;		// truncate
-				_shapeChildren = _shapeChildren.concat(_linesInView);	// append _linesInView to end of
_shapeChildren
+				//_shapeChildren = _shapeChildren.concat(_linesInView);	// append _linesInView to end
of _shapeChildren
+				_shapeChildren = _shapeChildren.concat(newShapeChildren);	// append _linesInView to end
of _shapeChildren
 				_linesInView.length = 0;	// truncate
 			}
 			else

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/d159e00c/textLayout/src/flashx/textLayout/elements/TableCellElement.as
----------------------------------------------------------------------
diff --git a/textLayout/src/flashx/textLayout/elements/TableCellElement.as b/textLayout/src/flashx/textLayout/elements/TableCellElement.as
index 7f04939..197d4c9 100644
--- a/textLayout/src/flashx/textLayout/elements/TableCellElement.as
+++ b/textLayout/src/flashx/textLayout/elements/TableCellElement.as
@@ -27,6 +27,7 @@ package flashx.textLayout.elements
 	import flash.utils.getDefinitionByName;
 	import flash.utils.getQualifiedClassName;
 	
+	import flashx.textLayout.compose.FlowDamageType;
 	import flashx.textLayout.compose.TextFlowLine;
 	import flashx.textLayout.container.ContainerController;
 	import flashx.textLayout.edit.EditManager;
@@ -90,26 +91,52 @@ package flashx.textLayout.elements
 		}
 
 		public function isDamaged():Boolean {
-			return _damaged;
+			return _damaged || (_textFlow && _textFlow.flowComposer.isDamaged(_textFlow.textLength));
 		}
 		
+		private var _savedPaddingTop:Number = 0;
+		private var _savedPaddingBottom:Number = 0;
+		private var _savedPaddingLeft:Number = 0;
+		private var _savedPaddingRight:Number = 0;
+		
 		public function compose():Boolean {
+			
+			var pt:Number = getEffectivePaddingTop();
+			var pb:Number = getEffectivePaddingBottom();
+			var pl:Number = getEffectivePaddingLeft();
+			var pr:Number = getEffectivePaddingRight();
+
+			if(pt != _savedPaddingTop)
+			{
+				_controller.paddingTop = _savedPaddingTop = pt;
+			}
+			if(pb != _savedPaddingBottom)
+			{
+				_controller.paddingBottom = _savedPaddingBottom = pb;
+			}
+			if(pl != _savedPaddingLeft)
+			{
+				_controller.paddingLeft = _savedPaddingLeft = pl;
+			}
+			if(pr != _savedPaddingRight)
+			{
+				_controller.paddingRight = _savedPaddingRight = pr;
+			}
+
 			var table:TableElement = getTable();
-			width = 0;
+			
+			_damaged = false;
+			
+			var compWidth:Number = 0;
 			for(var i:int=0;i<columnSpan;i++)
 			{
 				if (table && table.getColumnAt(colIndex+i)) {
-					width += table.getColumnAt(colIndex+i).columnWidth;
+					compWidth += table.getColumnAt(colIndex+i).columnWidth;
 				}
 				
 			}
-			
-			_damaged = false;
-			_controller.paddingTop = getEffectivePaddingTop();
-			_controller.paddingBottom = getEffectivePaddingBottom();
-			_controller.paddingLeft = getEffectivePaddingLeft();
-			_controller.paddingRight = getEffectivePaddingRight();
-			
+			width = compWidth;
+
 			if (_textFlow && _textFlow.flowComposer) {
 				return _textFlow.flowComposer.compose();
 			}


Mime
View raw message