mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): missing rasterization cache invalidations
This commit is contained in:
parent
ca089a105e
commit
c8de2da3fc
@ -334,9 +334,9 @@ export const canvasV2Slice = createSlice({
|
||||
let selectedEntityIdentifier: CanvasEntityIdentifier = { type: state.inpaintMask.type, id: state.inpaintMask.id };
|
||||
|
||||
if (entityIdentifier.type === 'raster_layer') {
|
||||
// When deleting a raster layer, we need to invalidate the composite rasterization cache.
|
||||
const index = state.rasterLayers.entities.findIndex((layer) => layer.id === entityIdentifier.id);
|
||||
state.rasterLayers.entities = state.rasterLayers.entities.filter((layer) => layer.id !== entityIdentifier.id);
|
||||
// When deleting a raster layer, we need to invalidate the composite rasterization cache.
|
||||
state.rasterLayers.compositeRasterizationCache = [];
|
||||
const nextRasterLayer = state.rasterLayers.entities[index];
|
||||
if (nextRasterLayer) {
|
||||
@ -410,6 +410,7 @@ export const canvasV2Slice = createSlice({
|
||||
if (entity.type === 'raster_layer') {
|
||||
moveOneToStart(state.rasterLayers.entities, entity);
|
||||
// When arranging a raster layer, we need to invalidate the composite rasterization cache.
|
||||
state.rasterLayers.compositeRasterizationCache = [];
|
||||
} else if (entity.type === 'control_layer') {
|
||||
moveOneToStart(state.controlLayers.entities, entity);
|
||||
} else if (entity.type === 'regional_guidance') {
|
||||
@ -423,6 +424,7 @@ export const canvasV2Slice = createSlice({
|
||||
return;
|
||||
}
|
||||
if (entity.type === 'raster_layer') {
|
||||
// When arranging a raster layer, we need to invalidate the composite rasterization cache.
|
||||
moveToStart(state.rasterLayers.entities, entity);
|
||||
state.rasterLayers.compositeRasterizationCache = [];
|
||||
} else if (entity.type === 'control_layer') {
|
||||
@ -441,6 +443,7 @@ export const canvasV2Slice = createSlice({
|
||||
return;
|
||||
}
|
||||
entity.opacity = opacity;
|
||||
invalidateRasterizationCaches(entity, state);
|
||||
},
|
||||
allEntitiesOfTypeToggled: (state, action: PayloadAction<{ type: CanvasEntityIdentifier['type'] }>) => {
|
||||
const { type } = action.payload;
|
||||
|
Loading…
Reference in New Issue
Block a user