Skip to content

Commit

Permalink
Enable penPaintingOnly flag for touch ui
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Dec 14, 2022
1 parent db5a1e6 commit 5ca4431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 0 additions & 2 deletions Sources/arm/Context.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 7 additions & 8 deletions Sources/arm/ui/UISidebar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
else if (Context.penPaintingOnly) {
down = false;
if (Config.raw.touch_ui) {
if (Input.getPen().down()) {
Context.penPaintingOnly = true;
}
else if (Context.penPaintingOnly) {
down = false;
}
}
#end


#if arm_physics
if (Context.tool == ToolParticle && Context.particlePhysics) {
Expand Down

0 comments on commit 5ca4431

Please sign in to comment.