Prevent camera movement when combo is selected
This commit is contained in:
+7
-1
@@ -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<Zui> {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user