Explorar o código

domkit inspector: correctly lookup in display order + skip transparent flows

Nicolas Cannasse %!s(int64=5) %!d(string=hai) anos
pai
achega
1a8f1b5c7c
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      h2d/domkit/Style.hx

+ 6 - 2
h2d/domkit/Style.hx

@@ -203,8 +203,9 @@ class Style extends domkit.CssStyle {
 	}
 
 	function lookupRec( obj : h2d.Object, e : hxd.Event ) {
-		for( s in obj ) {
-			if( lookupRec(s, e) )
+		var ch = @:privateAccess obj.children;
+		for( i in 0...ch.length ) {
+			if( lookupRec(ch[ch.length-1-i], e) )
 				return true;
 		}
 		if( obj.dom == null )
@@ -212,6 +213,9 @@ class Style extends domkit.CssStyle {
 		var b = obj.getBounds();
 		if( !b.contains(new h2d.col.Point(e.relX,e.relY)) )
 			return false;
+		var fl = Std.downcast(obj, h2d.Flow);
+		if( fl != null && fl.backgroundTile == null && fl.interactive == null )
+			return false;
 		setPreview(obj);
 		return true;
 	}