瀏覽代碼

Using onPointerDown instead of onPointerUp for focus when clicking.

Flux159 4 年之前
父節點
當前提交
3109020de3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gui/src/2D/controls/focusableButton.ts

+ 2 - 2
gui/src/2D/controls/focusableButton.ts

@@ -85,11 +85,11 @@ export class FocusableButton extends Button implements IFocusableControl {
     }
 
     /** @hidden */
-    public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi: PointerInfoBase): void {
+    public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {
         // Clicking on button should focus
         this.focus();
 
-        super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi);
+        super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);
     }
 
     /** @hidden */