Ver código fonte

changed isInteractiveVisible to also check for removal

Nicolas Cannasse 5 anos atrás
pai
commit
192be406cf
2 arquivos alterados com 4 adições e 4 exclusões
  1. 2 2
      h2d/Scene.hx
  2. 2 2
      h3d/scene/Scene.hx

+ 2 - 2
h2d/Scene.hx

@@ -334,8 +334,8 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	@:dox(hide) @:noCompletion
 	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) : Bool {
 		var s : Object = cast i;
-		while( s != null ) {
-			if( !s.visible ) return false;
+		while( s != this ) {
+			if( s == null || !s.visible ) return false;
 			s = s.parent;
 		}
 		return true;

+ 2 - 2
h3d/scene/Scene.hx

@@ -105,8 +105,8 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 	@:dox(hide) @:noCompletion
 	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) {
 		var o : Object = cast i;
-		while( o != null ) {
-			if( !o.visible ) return false;
+		while( o != this ) {
+			if( o == null || !o.visible ) return false;
 			o = o.parent;
 		}
 		return true;