keep brush size when switch images
This commit is contained in:
@@ -48,6 +48,7 @@ interface AppState {
|
||||
showFileManager: boolean
|
||||
enableFileManager: boolean
|
||||
gifImage: HTMLImageElement | undefined
|
||||
brushSize: number
|
||||
}
|
||||
|
||||
export const appState = atom<AppState>({
|
||||
@@ -66,6 +67,7 @@ export const appState = atom<AppState>({
|
||||
showFileManager: false,
|
||||
enableFileManager: false,
|
||||
gifImage: undefined,
|
||||
brushSize: 40,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -91,6 +93,18 @@ export const isInpaintingState = selector({
|
||||
},
|
||||
})
|
||||
|
||||
export const brushSizeState = selector({
|
||||
key: 'brushSizeState',
|
||||
get: ({ get }) => {
|
||||
const app = get(appState)
|
||||
return app.brushSize
|
||||
},
|
||||
set: ({ get, set }, newValue: any) => {
|
||||
const app = get(appState)
|
||||
set(appState, { ...app, brushSize: newValue })
|
||||
},
|
||||
})
|
||||
|
||||
export const imageHeightState = selector({
|
||||
key: 'imageHeightState',
|
||||
get: ({ get }) => {
|
||||
|
||||
Reference in New Issue
Block a user