From 5ca44310407a7f70c10fefaa9c4a71ab896630e3 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 14 Dec 2022 15:34:39 +0100 Subject: [PATCH] Enable penPaintingOnly flag for touch ui --- Sources/arm/Context.hx | 2 -- Sources/arm/ui/UISidebar.hx | 15 +++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Sources/arm/Context.hx b/Sources/arm/Context.hx index e753639e..3a4bed27 100644 --- a/Sources/arm/Context.hx +++ b/Sources/arm/Context.hx @@ -279,9 +279,7 @@ class Context { public static var maximizedSidebarWidth = 0; public static var cameraControls = ControlsOrbit; public static var dragDestination = 0; - #if (krom_android || krom_ios) public static var penPaintingOnly = false; // Reject painting with finger when using pen - #end public static function selectMaterial(i: Int) { if (Project.materials.length <= i) return; diff --git a/Sources/arm/ui/UISidebar.hx b/Sources/arm/ui/UISidebar.hx index c528cf98..001ede3c 100644 --- a/Sources/arm/ui/UISidebar.hx +++ b/Sources/arm/ui/UISidebar.hx @@ -631,15 +631,14 @@ class UISidebar { Operator.shortcut(Config.keymap.brush_ruler + "+" + Config.keymap.action_paint, ShortcutDown) || (Input.getPen().down() && !kb.down("alt")); - #if (krom_android || krom_ios) - if (Input.getPen().down()) { - Context.penPaintingOnly = true; + if (Config.raw.touch_ui) { + if (Input.getPen().down()) { + Context.penPaintingOnly = true; + } + else if (Context.penPaintingOnly) { + down = false; + } } - else if (Context.penPaintingOnly) { - down = false; - } - #end - #if arm_physics if (Context.tool == ToolParticle && Context.particlePhysics) {