Browse Source

fixed interactive priority in flow (close #625)

Nicolas Cannasse 6 years ago
parent
commit
306f28e605
1 changed files with 4 additions and 1 deletions
  1. 4 1
      h2d/Flow.hx

+ 4 - 1
h2d/Flow.hx

@@ -452,6 +452,7 @@ class Flow extends Object {
 
 	override function addChildAt( s, pos ) {
 		if( background != null ) pos++;
+		if( interactive != null ) pos++;
 		var fp = getProperties(s);
 		super.addChildAt(s, pos);
 		if( fp == null ) fp = new FlowProperties(s) else properties.remove(fp);
@@ -560,7 +561,9 @@ class Flow extends Object {
 			return b;
 		if( b ) {
 			if( interactive == null ) {
-				interactive = new h2d.Interactive(0, 0, this);
+				var interactive = new h2d.Interactive(0, 0);
+				addChildAt(interactive,0);
+				this.interactive = interactive;
 				interactive.cursor = Default;
 				properties[properties.length - 1].isAbsolute = true;
 				if( !needReflow ) {