mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes failed inpainting with float bounding box
This commit is contained in:
parent
accb1779cb
commit
4204740cb2
@ -64,11 +64,11 @@ const BoundingBoxSettings = () => {
|
||||
} = useAppSelector(boundingBoxDimensionsSelector);
|
||||
|
||||
const handleChangeBoundingBoxWidth = (v: number) => {
|
||||
dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, width: v }));
|
||||
dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, width: Math.floor(v) }));
|
||||
};
|
||||
|
||||
const handleChangeBoundingBoxHeight = (v: number) => {
|
||||
dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, height: v }));
|
||||
dispatch(setBoundingBoxDimensions({ ...boundingBoxDimensions, height: Math.floor(v) }));
|
||||
};
|
||||
|
||||
const handleShowBoundingBox = (e: ChangeEvent<HTMLInputElement>) =>
|
||||
@ -86,7 +86,7 @@ const BoundingBoxSettings = () => {
|
||||
dispatch(
|
||||
setBoundingBoxDimensions({
|
||||
...boundingBoxDimensions,
|
||||
width: canvasDimensions.width,
|
||||
width: Math.floor(canvasDimensions.width),
|
||||
})
|
||||
);
|
||||
};
|
||||
@ -95,7 +95,7 @@ const BoundingBoxSettings = () => {
|
||||
dispatch(
|
||||
setBoundingBoxDimensions({
|
||||
...boundingBoxDimensions,
|
||||
height: canvasDimensions.height,
|
||||
height: Math.floor(canvasDimensions.height),
|
||||
})
|
||||
);
|
||||
};
|
||||
|
@ -111,7 +111,7 @@ const InpaintingBoundingBoxPreview = () => {
|
||||
|
||||
const handleOnDragMove = useCallback(
|
||||
(e: KonvaEventObject<DragEvent>) => {
|
||||
dispatch(setBoundingBoxCoordinate({ x: e.target.x(), y: e.target.y() }));
|
||||
dispatch(setBoundingBoxCoordinate({ x: Math.floor(e.target.x()), y: Math.floor(e.target.y()) }));
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
@ -242,7 +242,7 @@ const InpaintingBoundingBoxPreview = () => {
|
||||
if (
|
||||
newBoundBox.width + newBoundBox.x > imageToInpaint.width * stageScale ||
|
||||
newBoundBox.height + newBoundBox.y >
|
||||
imageToInpaint.height * stageScale ||
|
||||
imageToInpaint.height * stageScale ||
|
||||
newBoundBox.x < 0 ||
|
||||
newBoundBox.y < 0
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user