Split touch controls into separate flags

This commit is contained in:
luboslenco
2022-12-14 14:12:43 +01:00
parent ced7d71000
commit 47dee4c554
3 changed files with 4 additions and 9 deletions
+3 -3
View File
@@ -380,10 +380,10 @@ class App {
else dragStart = 0;
hasDrag = false;
}
var moved = Math.abs(mouse.movementX) > 1 && Math.abs(mouse.movementY) > 1;
if (mouse.released()) {
dragStart = 0;
}
var moved = Math.abs(mouse.movementX) > 1 && Math.abs(mouse.movementY) > 1;
if ((mouse.released() || moved) && !hasDrag) {
dragAsset = null;
dragMaterial = null;
@@ -394,7 +394,7 @@ class App {
isDragging = false;
}
// Disable touch scrolling while dragging is active
Zui.touchControls = !isDragging;
Zui.touchScroll = !isDragging;
}
if (hasDrag && (mouse.movementX != 0 || mouse.movementY != 0)) {
@@ -798,7 +798,7 @@ class App {
raw.layer_res = Res2048;
raw.dilate = DilateInstant;
raw.dilate_radius = 2;
#if arm_touchui
#if (krom_android || krom_ios)
raw.touch_ui = true;
#else
raw.touch_ui = false;
+1 -1
View File
@@ -94,7 +94,7 @@ class BoxPreferences {
ui.changed = false;
Config.raw.touch_ui = ui.check(Id.handle({ selected: Config.raw.touch_ui }), tr("Touch UI"));
if (ui.changed) {
Zui.touchControls = Config.raw.touch_ui;
Zui.touchScroll = Zui.touchHold = Zui.touchTooltip = Config.raw.touch_ui;
Config.loadTheme(Config.raw.theme);
UISidebar.inst.tagUIRedraw();
}
-5
View File
@@ -85,11 +85,6 @@ else if (process.platform === "darwin") {
project.addDefine("kha_darwin");
}
if (android || ios) {
project.addDefine("arm_touchui"); // Use touch friendly UI
project.addDefine("zui_touchui");
}
if (debug) {
project.addDefine("arm_debug");
project.addParameter("--times");