diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index dd57cb85..2b9a5ebc 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -463,6 +463,7 @@ class App { } if (Context.colorPickerCallback != null && (mouse.released() || mouse.released("right"))) { Context.colorPickerCallback = null; + Context.selectTool(Context.colorPickerPreviousTool); } handleDropPaths(); diff --git a/Sources/arm/Context.hx b/Sources/arm/Context.hx index f2a1ea7b..dd6c8e5e 100644 --- a/Sources/arm/Context.hx +++ b/Sources/arm/Context.hx @@ -66,6 +66,7 @@ class Context { public static var swatch: TSwatchColor; public static var pickedColor: TSwatchColor = Project.makeSwatch(); public static var colorPickerCallback: TSwatchColor->Void = null; + public static var colorPickerPreviousTool = ToolBrush; public static var materialIdPicked = 0; public static var uvxPicked = 0.0; public static var uvyPicked = 0.0; diff --git a/Sources/arm/ui/TabSwatches.hx b/Sources/arm/ui/TabSwatches.hx index abaa20e0..a211b7ad 100644 --- a/Sources/arm/ui/TabSwatches.hx +++ b/Sources/arm/ui/TabSwatches.hx @@ -132,6 +132,7 @@ class TabSwatches { h.color = Context.swatch.base; Context.swatch.base = zui.Ext.colorWheel(ui, h, false, null, 11 * ui.t.ELEMENT_H * ui.SCALE(), true, function () { + Context.colorPickerPreviousTool = Context.tool; Context.selectTool(ToolPicker); Context.colorPickerCallback = function (color: TSwatchColor) { Project.raw.swatches[i] = Project.cloneSwatch(color); diff --git a/Sources/arm/ui/UINodes.hx b/Sources/arm/ui/UINodes.hx index 0c8d6d15..d5a5ec2b 100644 --- a/Sources/arm/ui/UINodes.hx +++ b/Sources/arm/ui/UINodes.hx @@ -683,6 +683,7 @@ class UINodes { } if (nodes.colorPickerCallback != null) { + Context.colorPickerPreviousTool = Context.tool; Context.selectTool(ToolPicker); var tmp = nodes.colorPickerCallback; Context.colorPickerCallback = function(color: TSwatchColor) {