File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
invokeai/frontend/web/src/features/controlLayers Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ export class CanvasStateApiModule extends CanvasModuleBase {
231231 /**
232232 * Sets the drawing color, pushing state to redux.
233233 */
234- setColor = ( color : RgbaColor ) => {
234+ setColor = ( color : Partial < RgbaColor > ) => {
235235 return this . store . dispatch ( settingsColorChanged ( color ) ) ;
236236 } ;
237237
Original file line number Diff line number Diff line change @@ -406,8 +406,8 @@ export class CanvasColorPickerToolModule extends CanvasModuleBase {
406406 } ;
407407
408408 onStagePointerUp = ( _e : KonvaEventObject < PointerEvent > ) => {
409- const color = this . $colorUnderCursor . get ( ) ;
410- this . manager . stateApi . setColor ( { ... color , a : color . a / 255 } ) ;
409+ const { a : _ , ... color } = this . $colorUnderCursor . get ( ) ;
410+ this . manager . stateApi . setColor ( color ) ;
411411 } ;
412412
413413 onStagePointerMove = ( _e : KonvaEventObject < PointerEvent > ) => {
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ const slice = createSlice({
134134 settingsEraserWidthChanged : ( state , action : PayloadAction < CanvasSettingsState [ 'eraserWidth' ] > ) => {
135135 state . eraserWidth = Math . round ( action . payload ) ;
136136 } ,
137- settingsColorChanged : ( state , action : PayloadAction < CanvasSettingsState [ 'color' ] > ) => {
138- state . color = action . payload ;
137+ settingsColorChanged : ( state , action : PayloadAction < Partial < CanvasSettingsState [ 'color' ] > > ) => {
138+ state . color = { ... state . color , ... action . payload } ;
139139 } ,
140140 settingsInvertScrollForToolWidthChanged : (
141141 state ,
You can’t perform that action at this time.
0 commit comments