Browse Source

trace bugfix in case stage height is lower than text height

Nicolas Cannasse 17 years ago
parent
commit
3c9e94b785
2 changed files with 2 additions and 2 deletions
  1. 1 1
      std/flash/Boot.hx
  2. 1 1
      std/flash9/Boot.hx

+ 1 - 1
std/flash/Boot.hx

@@ -183,7 +183,7 @@ class Boot {
 			var s = inf.fileName+(if( inf.lineNumber == null ) "" else ":"+inf.lineNumber)+": "+__string_rec(v,"");
 			var s = inf.fileName+(if( inf.lineNumber == null ) "" else ":"+inf.lineNumber)+": "+__string_rec(v,"");
 			var lines : Array<String> = root.__trace_lines["concat"](s.split("\n"));
 			var lines : Array<String> = root.__trace_lines["concat"](s.split("\n"));
 			tf.text = lines.join("\n");
 			tf.text = lines.join("\n");
-			while( tf.textHeight > Stage.height ) {
+			while( lines.length > 0 && tf.textHeight > Stage.height ) {
 				lines.shift();
 				lines.shift();
 				tf.text = lines.join("\n");
 				tf.text = lines.join("\n");
 			}
 			}

+ 1 - 1
std/flash9/Boot.hx

@@ -140,7 +140,7 @@ class Boot extends flash.display.MovieClip, implements Dynamic {
 		var stage = flash.Lib.current.stage;
 		var stage = flash.Lib.current.stage;
 		if( stage == null )
 		if( stage == null )
 			return;
 			return;
-		while( tf.height > stage.stageHeight ) {
+		while( lines.length > 0 && tf.height > stage.stageHeight ) {
 			lines.shift();
 			lines.shift();
 			tf.text = lines.join("\n");
 			tf.text = lines.join("\n");
 		}
 		}