Restore previous tool after color picking
This commit is contained in:
@@ -463,6 +463,7 @@ class App {
|
||||
}
|
||||
if (Context.colorPickerCallback != null && (mouse.released() || mouse.released("right"))) {
|
||||
Context.colorPickerCallback = null;
|
||||
Context.selectTool(Context.colorPickerPreviousTool);
|
||||
}
|
||||
|
||||
handleDropPaths();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user