mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): add missed ca layer opacity logic
didn't stage the right changes a few commits back
This commit is contained in:
parent
1f68a60752
commit
fa637b5c59
@ -40,7 +40,7 @@ export const initialRegionalPromptsState: RegionalPromptsState = {
|
||||
selectedLayerId: null,
|
||||
brushSize: 100,
|
||||
layers: [],
|
||||
globalMaskLayerOpacity: 0.5, // this globally changes all mask layers' opacity
|
||||
globalMaskLayerOpacity: 0.3, // this globally changes all mask layers' opacity
|
||||
isEnabled: true,
|
||||
positivePrompt: '',
|
||||
negativePrompt: '',
|
||||
@ -217,6 +217,13 @@ export const regionalPromptsSlice = createSlice({
|
||||
state.layers = state.layers.filter((l) => l.id !== state.selectedLayerId);
|
||||
state.selectedLayerId = state.layers[0]?.id ?? null;
|
||||
},
|
||||
layerOpacityChanged: (state, action: PayloadAction<{ layerId: string; opacity: number }>) => {
|
||||
const { layerId, opacity } = action.payload;
|
||||
const layer = state.layers.filter(isControlAdapterLayer).find((l) => l.id === layerId);
|
||||
if (layer) {
|
||||
layer.opacity = opacity;
|
||||
}
|
||||
},
|
||||
//#endregion
|
||||
|
||||
//#region Mask Layers
|
||||
@ -500,6 +507,7 @@ export const {
|
||||
maskedGuidanceLayerAdded,
|
||||
ipAdapterLayerAdded,
|
||||
controlAdapterLayerAdded,
|
||||
layerOpacityChanged,
|
||||
// Mask layer actions
|
||||
maskLayerLineAdded,
|
||||
maskLayerPointsAdded,
|
||||
|
Loading…
Reference in New Issue
Block a user