Skip to content

Commit e78cf88

Browse files
fix(ui): clip shift-draw strokes to bbox when clip to bbox enabled
Closes #7809
1 parent 5d13f0b commit e78cf88

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasBrushToolModule.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ export class CanvasBrushToolModule extends CanvasModuleBase {
301301
points,
302302
strokeWidth: settings.brushWidth,
303303
color: this.manager.stateApi.getCurrentColor(),
304-
// When shift is held, the line may extend beyond the clip region. No clip for these lines.
305-
clip: isShiftDraw ? null : this.parent.getClip(selectedEntity.state),
304+
// When shift is held, the line may extend beyond the clip region. Clip only if we are clipping to bbox. If we
305+
// are clipping to stage, we don't need to clip at all.
306+
clip: isShiftDraw && !settings.clipToBbox ? null : this.parent.getClip(selectedEntity.state),
306307
});
307308
} else {
308309
const lastLinePoint = getLastPointOfLastLine(selectedEntity.state.objects, 'brush_line');
@@ -325,8 +326,9 @@ export class CanvasBrushToolModule extends CanvasModuleBase {
325326
points,
326327
strokeWidth: settings.brushWidth,
327328
color: this.manager.stateApi.getCurrentColor(),
328-
// When shift is held, the line may extend beyond the clip region. No clip for these lines.
329-
clip: isShiftDraw ? null : this.parent.getClip(selectedEntity.state),
329+
// When shift is held, the line may extend beyond the clip region. Clip only if we are clipping to bbox. If we
330+
// are clipping to stage, we don't need to clip at all.
331+
clip: isShiftDraw && !settings.clipToBbox ? null : this.parent.getClip(selectedEntity.state),
330332
});
331333
}
332334
};

0 commit comments

Comments
 (0)