ui: actually resolve circulars + fix flip bounding boxes AR unset

This commit is contained in:
blessedcoolant 2023-08-30 09:33:04 +12:00
parent 55f19aff3a
commit c6bab14043
2 changed files with 10 additions and 5 deletions

View File

@ -80,7 +80,16 @@ export default function ParamBoundingBoxSize() {
size="sm"
icon={<MdOutlineSwapVert />}
fontSize={20}
onClick={() => dispatch(flipBoundingBoxAxes())}
onClick={() => {
dispatch(flipBoundingBoxAxes());
if (
![null, 2 / 3, 16 / 9, 1 / 1].includes(
boundingBoxDimensions.height / boundingBoxDimensions.width
)
) {
dispatch(setAspectRatio(null));
}
}}
/>
<IAIIconButton
tooltip={t('ui.lockRatio')}

View File

@ -5,7 +5,6 @@ import { configChanged } from 'features/system/store/configSlice';
import { clamp } from 'lodash-es';
import { ImageDTO } from 'services/api/types';
import { flipBoundingBoxAxes } from 'features/canvas/store/canvasSlice';
import { clipSkipMap } from '../types/constants';
import {
CfgScaleParam,
@ -312,9 +311,6 @@ export const generationSlice = createSlice({
state.clipSkip = 0;
}
});
builder.addCase(flipBoundingBoxAxes, (state) => {
state.aspectRatio = null;
});
},
});