diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts index b29e048675..110e74f5b4 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts @@ -10,6 +10,7 @@ import { getKonvaNodeDebugAttrs, getPrefixedId, offsetCoord, + roundRect, } from 'features/controlLayers/konva/util'; import { selectSelectedEntityIdentifier } from 'features/controlLayers/store/selectors'; import type { Coordinate, Rect, RectWithRotation } from 'features/controlLayers/store/types'; @@ -773,7 +774,7 @@ export class CanvasEntityTransformer extends CanvasModuleBase { const rect = this.getRelativeRect(); const rasterizeResult = await withResultAsync(() => this.parent.renderer.rasterize({ - rect, + rect: roundRect(rect), replaceObjects: true, ignoreCache: true, attrs: { opacity: 1, filters: [] }, diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/util.ts b/invokeai/frontend/web/src/features/controlLayers/konva/util.ts index a2d28b5ac0..f5a30afcc7 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/util.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/util.ts @@ -740,3 +740,12 @@ export const getColorAtCoordinate = (stage: Konva.Stage, coord: Coordinate): Rgb return { r, g, b }; }; + +export const roundRect = (rect: Rect): Rect => { + return { + x: Math.round(rect.x), + y: Math.round(rect.y), + width: Math.round(rect.width), + height: Math.round(rect.height), + }; +};