Restore previous tool after color picking

This commit is contained in:
MathemanFlo
2022-03-15 22:17:23 +01:00
parent 3c0bae578b
commit 67a4c21c4c
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -463,6 +463,7 @@ class App {
}
if (Context.colorPickerCallback != null && (mouse.released() || mouse.released("right"))) {
Context.colorPickerCallback = null;
Context.selectTool(Context.colorPickerPreviousTool);
}
handleDropPaths();
+1
View File
@@ -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;
+1
View File
@@ -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);
+1
View File
@@ -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) {