Selaa lähdekoodia

dispatch ERelease event to event listeners if they had a prior EPush

ncannasse 11 vuotta sitten
vanhempi
commit
d573ba0635
1 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
  1. 8 2
      h2d/Scene.hx

+ 8 - 2
h2d/Scene.hx

@@ -213,8 +213,11 @@ class Scene extends Layers implements h3d.IDrawable {
 			event.kind = EMove;
 			currentOver = null;
 		}
-		if( !handled )
+		if( !handled ) {
+			if( event.kind == EPush )
+				pushList.push(null);
 			dispatchListeners(event);
+		}
 	}
 	
 	function hasEvents() {
@@ -252,7 +255,10 @@ class Scene extends Layers implements h3d.IDrawable {
 			if( e.kind == ERelease && pushList.length > 0 ) {
 				for( i in pushList ) {
 					// relX/relY is not correct here
-					i.handleEvent(e);
+					if( i == null )
+						dispatchListeners(e);
+					else
+						i.handleEvent(e);
 				}
 				pushList = new Array();
 			}