mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): alt quick switches to color picker
This commit is contained in:
parent
4242e6e6c2
commit
9467b937ff
@ -864,6 +864,10 @@ export class CanvasToolModule extends CanvasModuleABC {
|
|||||||
this.manager.stateApi.$spaceKey.set(true);
|
this.manager.stateApi.$spaceKey.set(true);
|
||||||
this.manager.stateApi.$lastCursorPos.set(null);
|
this.manager.stateApi.$lastCursorPos.set(null);
|
||||||
this.manager.stateApi.$lastMouseDownPos.set(null);
|
this.manager.stateApi.$lastMouseDownPos.set(null);
|
||||||
|
} else if (e.key === 'Alt') {
|
||||||
|
// Select the color picker on alt key down
|
||||||
|
this.manager.stateApi.$toolBuffer.set(this.manager.stateApi.$tool.get());
|
||||||
|
this.manager.stateApi.$tool.set('colorPicker');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -880,6 +884,11 @@ export class CanvasToolModule extends CanvasModuleABC {
|
|||||||
this.manager.stateApi.$tool.set(toolBuffer ?? 'move');
|
this.manager.stateApi.$tool.set(toolBuffer ?? 'move');
|
||||||
this.manager.stateApi.$toolBuffer.set(null);
|
this.manager.stateApi.$toolBuffer.set(null);
|
||||||
this.manager.stateApi.$spaceKey.set(false);
|
this.manager.stateApi.$spaceKey.set(false);
|
||||||
|
} else if (e.key === 'Alt') {
|
||||||
|
// Revert the tool to the previous tool on alt key up
|
||||||
|
const toolBuffer = this.manager.stateApi.$toolBuffer.get();
|
||||||
|
this.manager.stateApi.$tool.set(toolBuffer ?? 'move');
|
||||||
|
this.manager.stateApi.$toolBuffer.set(null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user