File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
invokeai/frontend/web/src/features/canvas/store Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -462,10 +462,31 @@ export const canvasSlice = createSlice({
462462 } ,
463463 resetCanvas : ( state ) => {
464464 state . pastLayerStates . push ( cloneDeep ( state . layerState ) ) ;
465-
466465 state . layerState = cloneDeep ( initialLayerState ) ;
467466 state . futureLayerStates = [ ] ;
468467 state . batchIds = [ ] ;
468+ state . boundingBoxCoordinates = {
469+ ...initialCanvasState . boundingBoxCoordinates ,
470+ } ;
471+ state . boundingBoxDimensions = {
472+ ...initialCanvasState . boundingBoxDimensions ,
473+ } ;
474+ state . stageScale = calculateScale (
475+ state . stageDimensions . width ,
476+ state . stageDimensions . height ,
477+ state . boundingBoxDimensions . width ,
478+ state . boundingBoxDimensions . height ,
479+ STAGE_PADDING_PERCENTAGE
480+ ) ;
481+ state . stageCoordinates = calculateCoordinates (
482+ state . stageDimensions . width ,
483+ state . stageDimensions . height ,
484+ 0 ,
485+ 0 ,
486+ state . boundingBoxDimensions . width ,
487+ state . boundingBoxDimensions . height ,
488+ 1
489+ ) ;
469490 } ,
470491 canvasResized : (
471492 state ,
You can’t perform that action at this time.
0 commit comments