소스 검색

ADT: Better control behavior for buttons

David Catuhe 8 년 전
부모
커밋
4a769cf47a
4개의 변경된 파일6968개의 추가작업 그리고 6955개의 파일을 삭제
  1. 3477 3477
      dist/preview release/babylon.d.ts
  2. 3477 3477
      dist/preview release/babylon.module.d.ts
  3. 11 0
      gui/src/controls/button.ts
  4. 3 1
      gui/src/controls/control.ts

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3477 - 3477
dist/preview release/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3477 - 3477
dist/preview release/babylon.module.d.ts


+ 11 - 0
gui/src/controls/button.ts

@@ -6,6 +6,17 @@ module BABYLON.GUI {
             super(name);
         }
 
+        // While being a container, the button behaves like a control.
+        public _processPicking(x: number, y: number, type: number): boolean {
+            if (!this._contains(x, y)) {
+                return false;
+            }
+
+            this._processObservables(type);
+
+            return true;
+        }
+
         // Statics
         public static CreateImageButton(name: string, text: string, imageUrl: string): Button {
             var result = new Button(name);

+ 3 - 1
gui/src/controls/control.ts

@@ -407,7 +407,9 @@ module BABYLON.GUI {
                 return false;
             }
 
-            return this._processObservables(type);
+            this._processObservables(type);
+
+            return true;
         }
 
         protected _processObservables(type: number): boolean {