diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index 5ca79944..54cfad40 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -652,7 +652,13 @@ class App { } public static function isScrolling(): Bool { - return UISidebar.inst.ui.isScrolling; + for (ui in getUIs()) if (ui.isScrolling) return true; + return false; + } + + public static function isComboSelected(): Bool { + for (ui in getUIs()) if (@:privateAccess ui.comboSelectedHandle != null) return true; + return false; } public static function getUIs(): Array { diff --git a/Sources/arm/node/brush/BrushOutputNode.hx b/Sources/arm/node/brush/BrushOutputNode.hx index bc265ce5..142ddcfa 100644 --- a/Sources/arm/node/brush/BrushOutputNode.hx +++ b/Sources/arm/node/brush/BrushOutputNode.hx @@ -103,15 +103,14 @@ class BrushOutputNode extends LogicNode { Context.paintVec.x < right && Context.paintVec.y > 0 && Context.paintVec.y < 1 && - !UISidebar.inst.ui.isHovered && - !UISidebar.inst.ui.isScrolling && !fillLayer && !groupLayer && (Context.layer.isVisible() || Context.paint2d) && + !UISidebar.inst.ui.isHovered && !arm.App.isDragging && !arm.App.isResizing && - @:privateAccess UISidebar.inst.ui.comboSelectedHandle == null && - @:privateAccess UIView2D.inst.ui.comboSelectedHandle == null) { // Header combos are in use + !arm.App.isScrolling() && + !arm.App.isComboSelected()) { // Set color pick var down = iron.system.Input.getMouse().down() || iron.system.Input.getPen().down(); diff --git a/Sources/arm/ui/UINodes.hx b/Sources/arm/ui/UINodes.hx index 68fbba0a..3dc46488 100644 --- a/Sources/arm/ui/UINodes.hx +++ b/Sources/arm/ui/UINodes.hx @@ -295,11 +295,13 @@ class UINodes { public static function getCanvasControl(ui: Zui): zui.Nodes.CanvasControl { var pan = ui.inputDownR || Operator.shortcut(Config.keymap.action_pan, ShortcutDown); var zoomDelta = Operator.shortcut(Config.keymap.action_zoom, ShortcutDown) ? getZoomDelta(ui) / 100.0 : 0.0; - return { + var control = { panX: pan ? ui.inputDX : 0.0, panY: pan ? ui.inputDY : 0.0, zoom: ui.inputWheelDelta != 0.0 ? -ui.inputWheelDelta / 10 : zoomDelta - } + }; + if (App.isComboSelected()) control.zoom = 0.0; + return control; } static function getZoomDelta(ui: Zui): Float { @@ -750,7 +752,7 @@ class UINodes { var cats = canvasType == CanvasMaterial ? NodesMaterial.categories : NodesBrush.categories; for (i in 0...cats.length) { - if ((ui.button(tr(cats[i]), Left) && UISidebar.inst.ui.comboSelectedHandle == null) || (ui.isHovered && drawMenu)) { + if ((ui.button(tr(cats[i]), Left) && !arm.App.isComboSelected()) || (ui.isHovered && drawMenu)) { addNodeButton = true; menuCategory = i; popupX = wx + ui._x; diff --git a/Sources/arm/ui/UISidebar.hx b/Sources/arm/ui/UISidebar.hx index b8056364..3d8c0bd7 100644 --- a/Sources/arm/ui/UISidebar.hx +++ b/Sources/arm/ui/UISidebar.hx @@ -551,7 +551,7 @@ class UISidebar { if (Context.brushTime == 0 && !App.isDragging && !App.isResizing && - @:privateAccess ui.comboSelectedHandle == null) { // Paint started + !App.isComboSelected()) { // Paint started // Draw line if (Operator.shortcut(Config.keymap.brush_ruler + "+" + Config.keymap.action_paint, ShortcutDown)) {