diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts index 967b42ebca..ff949645af 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasStateApi.ts @@ -32,7 +32,6 @@ import { layerImageCacheChanged, layerRectShapeAdded, layerReset, - layerScaled, layerTranslated, rgBboxChanged, rgBrushLineAdded, @@ -91,9 +90,7 @@ export class CanvasStateApi { }; onScaleChanged = (arg: ScaleChangedArg, entityType: CanvasEntity['type']) => { log.debug('onScaleChanged'); - if (entityType === 'layer') { - this.store.dispatch(layerScaled(arg)); - } else if (entityType === 'inpaint_mask') { + if (entityType === 'inpaint_mask') { this.store.dispatch(imScaled(arg)); } else if (entityType === 'regional_guidance') { this.store.dispatch(rgScaled(arg)); diff --git a/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts b/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts index 8cf74b8bed..9435358d92 100644 --- a/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts +++ b/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts @@ -66,7 +66,6 @@ const initialState: CanvasV2State = { eraser: { width: 50, }, - isTransforming: false, }, bbox: { rect: { x: 0, y: 0, width: 512, height: 512 }, @@ -221,7 +220,6 @@ export const { layerImageAdded, layerAllDeleted, layerImageCacheChanged, - layerScaled, layerBrushLineAdded, layerEraserLineAdded, layerRectShapeAdded, diff --git a/invokeai/frontend/web/src/features/controlLayers/store/layersReducers.ts b/invokeai/frontend/web/src/features/controlLayers/store/layersReducers.ts index a05849153a..e58c2294a8 100644 --- a/invokeai/frontend/web/src/features/controlLayers/store/layersReducers.ts +++ b/invokeai/frontend/web/src/features/controlLayers/store/layersReducers.ts @@ -16,7 +16,6 @@ import type { LayerEntity, PositionChangedArg, RectShape, - ScaleChangedArg, } from './types'; import { imageDTOToImageObject, imageDTOToImageWithDims } from './types'; @@ -179,35 +178,6 @@ export const layersReducers = { layer.objects.push(rectShape); state.layers.imageCache = null; }, - layerScaled: (state, action: PayloadAction) => { - const { id, scale, position } = action.payload; - const layer = selectLayer(state, id); - if (!layer) { - return; - } - for (const obj of layer.objects) { - if (obj.type === 'brush_line') { - obj.points = obj.points.map((point) => Math.round(point * scale)); - obj.strokeWidth = Math.round(obj.strokeWidth * scale); - } else if (obj.type === 'eraser_line') { - obj.points = obj.points.map((point) => Math.round(point * scale)); - obj.strokeWidth = Math.round(obj.strokeWidth * scale); - } else if (obj.type === 'rect_shape') { - obj.x = Math.round(obj.x * scale); - obj.y = Math.round(obj.y * scale); - obj.height = Math.round(obj.height * scale); - obj.width = Math.round(obj.width * scale); - } else if (obj.type === 'image') { - obj.x = Math.round(obj.x * scale); - obj.y = Math.round(obj.y * scale); - obj.height = Math.round(obj.height * scale); - obj.width = Math.round(obj.width * scale); - } - } - layer.position.x = Math.round(position.x); - layer.position.y = Math.round(position.y); - state.layers.imageCache = null; - }, layerImageAdded: ( state, action: PayloadAction @@ -240,12 +210,3 @@ export const layersReducers = { state.layers.imageCache = null; }, } satisfies SliceCaseReducers; - -const scalePoints = (points: number[], scaleX: number, scaleY: number) => { - const newPoints: number[] = []; - for (let i = 0; i < points.length; i += 2) { - newPoints.push(points[i]! * scaleX); - newPoints.push(points[i + 1]! * scaleY); - } - return newPoints; -};