You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/06/05 01:03:57 UTC

git commit: [flex-sdk] [refs/heads/develop] - DisplayList compares will ignore weirdness with StaticText

Updated Branches:
  refs/heads/develop ba38ede4c -> 24d8f4262


DisplayList compares will ignore weirdness with StaticText


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

Branch: refs/heads/develop
Commit: 24d8f4262235f05288021e1953bc84986c61c658
Parents: ba38ede
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jun 4 23:58:38 2013 +0100
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jun 4 23:58:38 2013 +0100

----------------------------------------------------------------------
 mustella/as3/src/mustella/CompareBitmap.as |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/24d8f426/mustella/as3/src/mustella/CompareBitmap.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/CompareBitmap.as b/mustella/as3/src/mustella/CompareBitmap.as
index 2efdc99..b4a6f62 100644
--- a/mustella/as3/src/mustella/CompareBitmap.as
+++ b/mustella/as3/src/mustella/CompareBitmap.as
@@ -1311,7 +1311,7 @@ public class CompareBitmap extends Assert
 			{
 				a = trimTag(a);
 				b = trimTag(b);
-				if (a != b)
+				if (a != b && !nullChildOrStaticText(a, b))
 				{
 					retval = true;
 					var c:String = "";
@@ -1362,6 +1362,20 @@ public class CompareBitmap extends Assert
 		}
 		return a;
 	}
+	
+	// static text seems to float around a bit so ignore it.
+	private function nullChildOrStaticText(a:String, b:String):Boolean
+	{
+		if (a.indexOf("<NullChild") != -1)
+			return true;
+		if (b.indexOf("<NullChild") != -1)
+			return true;
+		if (a.indexOf("<flash.text.StaticText") != -1)
+			return true;
+		if (b.indexOf("<flash.text.StaticText") != -1)
+			return true;
+		return false;
+	}
 }
 
 }