Explorar o código

Fix onPointerOut when delegatePickingToChildren is on

David Catuhe %!s(int64=6) %!d(string=hai) anos
pai
achega
2ca97212a8
Modificáronse 2 ficheiros con 8 adicións e 7 borrados
  1. 1 1
      .github/ISSUE_TEMPLATE.md
  2. 7 6
      gui/src/2D/controls/button.ts

+ 1 - 1
.github/ISSUE_TEMPLATE.md

@@ -1,4 +1,4 @@
-**Use Github issues ONLY for validated bugs**
+**Use Github issues ONLY for validated bugs. PLEASE DISCUSS THEM ON THE FORUM FIRST!**
 
 We have a really active forum to help answering questions (https://forum.babylonjs.com/)
 

+ 7 - 6
gui/src/2D/controls/button.ts

@@ -97,22 +97,23 @@ export class Button extends Rectangle {
             return false;
         }
 
-        let processObservables = true;
         if (this.delegatePickingToChildren) {
-            processObservables = false;
+            let contains = false;
             for (var index = this._children.length - 1; index >= 0; index--) {
                 var child = this._children[index];
                 if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
-                    processObservables = true;
+                    contains = true;
                     break;
                 }
             }
-        }
 
-        if (processObservables) {
-            this._processObservables(type, x, y, pointerId, buttonIndex);
+            if (!contains) {
+                return false;
+            }
         }
 
+        this._processObservables(type, x, y, pointerId, buttonIndex);
+
         return true;
     }