mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
tidy(ui): type "Dimensions" -> "Size"
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import type { PayloadAction, SliceCaseReducers } from '@reduxjs/toolkit';
|
||||
import type { BoundingBoxScaleMethod, CanvasV2State, Dimensions } from 'features/controlLayers/store/types';
|
||||
import type { BoundingBoxScaleMethod, CanvasV2State, Size } from 'features/controlLayers/store/types';
|
||||
import { getScaledBoundingBoxDimensions } from 'features/controlLayers/util/getScaledBoundingBoxDimensions';
|
||||
import { getOptimalDimension } from 'features/parameters/util/optimalDimension';
|
||||
import type { IRect } from 'konva/lib/types';
|
||||
import { pick } from 'lodash-es';
|
||||
|
||||
export const bboxReducers = {
|
||||
scaledBboxChanged: (state, action: PayloadAction<Partial<Dimensions>>) => {
|
||||
scaledBboxChanged: (state, action: PayloadAction<Partial<Size>>) => {
|
||||
state.layers.imageCache = null;
|
||||
state.bbox.scaledSize = { ...state.bbox.scaledSize, ...action.payload };
|
||||
},
|
||||
|
||||
@@ -780,7 +780,7 @@ export const isBoundingBoxScaleMethod = (v: unknown): v is BoundingBoxScaleMetho
|
||||
export type CanvasEntity = LayerEntity | ControlAdapterEntity | RegionEntity | InpaintMaskEntity | IPAdapterEntity;
|
||||
export type CanvasEntityIdentifier = Pick<CanvasEntity, 'id' | 'type'>;
|
||||
|
||||
export type Dimensions = {
|
||||
export type Size = {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { roundToMultiple } from 'common/util/roundDownToMultiple';
|
||||
import { CANVAS_GRID_SIZE_FINE } from 'features/controlLayers/konva/constants';
|
||||
import type { Dimensions } from 'features/controlLayers/store/types';
|
||||
import type { Size } from 'features/controlLayers/store/types';
|
||||
|
||||
/**
|
||||
* Scales the bounding box dimensions to the optimal dimension. The optimal dimensions should be the trained dimension
|
||||
@@ -8,7 +8,7 @@ import type { Dimensions } from 'features/controlLayers/store/types';
|
||||
* @param dimensions The un-scaled bbox dimensions
|
||||
* @param optimalDimension The optimal dimension to scale the bbox to
|
||||
*/
|
||||
export const getScaledBoundingBoxDimensions = (dimensions: Dimensions, optimalDimension: number): Dimensions => {
|
||||
export const getScaledBoundingBoxDimensions = (dimensions: Size, optimalDimension: number): Size => {
|
||||
const { width, height } = dimensions;
|
||||
|
||||
const scaledDimensions = { width, height };
|
||||
|
||||
Reference in New Issue
Block a user