Improve nested input handling

This commit is contained in:
Lubos Lenco
2021-08-10 11:44:57 +02:00
parent 9c64e757fd
commit 41a3831cc3
2 changed files with 3 additions and 7 deletions
+1 -2
View File
@@ -541,8 +541,7 @@ class UINodes {
if (!show || System.windowWidth() == 0 || System.windowHeight() == 0) return;
if (!App.uiEnabled && ui.inputRegistered) ui.unregisterInput();
if (App.uiEnabled && !ui.inputRegistered) ui.registerInput();
ui.inputEnabled = App.uiEnabled;
g.end();
+2 -5
View File
@@ -646,12 +646,9 @@ class UISidebar {
}
public function render(g: kha.graphics2.Graphics) {
if (System.windowWidth() == 0 || System.windowHeight() == 0) return;
if (!show || System.windowWidth() == 0 || System.windowHeight() == 0) return;
if (!App.uiEnabled && ui.inputRegistered) ui.unregisterInput();
if (App.uiEnabled && !ui.inputRegistered) ui.registerInput();
if (!show) return;
ui.inputEnabled = App.uiEnabled;
g.end();
ui.begin(g);