mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): lint
This commit is contained in:
committed by
Kent Keirsey
parent
870cc5b733
commit
ae8ffe9d51
@ -18,12 +18,14 @@ import {
|
||||
} from 'features/canvas/store/canvasNanostore';
|
||||
import {
|
||||
aspectRatioChanged,
|
||||
CANVAS_GRID_SIZE_COARSE,
|
||||
CANVAS_GRID_SIZE_FINE,
|
||||
setBoundingBoxCoordinates,
|
||||
setBoundingBoxDimensions,
|
||||
setShouldSnapToGrid,
|
||||
} from 'features/canvas/store/canvasSlice';
|
||||
import {
|
||||
CANVAS_GRID_SIZE_COARSE,
|
||||
CANVAS_GRID_SIZE_FINE,
|
||||
} from 'features/canvas/store/constants';
|
||||
import type Konva from 'konva';
|
||||
import type { GroupConfig } from 'konva/lib/Group';
|
||||
import type { KonvaEventObject } from 'konva/lib/Node';
|
||||
@ -161,7 +163,10 @@ const IAICanvasBoundingBox = (props: IAICanvasBoundingBoxPreviewProps) => {
|
||||
const y = Math.round(rect.y());
|
||||
|
||||
if (aspectRatio.isLocked) {
|
||||
const newHeight = roundDownToMultipleMin(width / aspectRatio.value, gridSize);
|
||||
const newHeight = roundDownToMultipleMin(
|
||||
width / aspectRatio.value,
|
||||
gridSize
|
||||
);
|
||||
dispatch(
|
||||
setBoundingBoxDimensions({
|
||||
width: roundDownToMultipleMin(width, gridSize),
|
||||
|
@ -30,15 +30,13 @@ import type {
|
||||
Dimensions,
|
||||
} from './canvasTypes';
|
||||
import { isCanvasAnyLine, isCanvasMaskLine } from './canvasTypes';
|
||||
import { CANVAS_GRID_SIZE_FINE } from './constants';
|
||||
|
||||
/**
|
||||
* The maximum history length to keep in the past/future layer states.
|
||||
*/
|
||||
const MAX_HISTORY = 128;
|
||||
|
||||
export const CANVAS_GRID_SIZE_FINE = 8;
|
||||
export const CANVAS_GRID_SIZE_COARSE = 64;
|
||||
|
||||
export const initialLayerState: CanvasLayerState = {
|
||||
objects: [],
|
||||
stagingArea: {
|
||||
|
@ -0,0 +1,2 @@
|
||||
export const CANVAS_GRID_SIZE_COARSE = 64;
|
||||
export const CANVAS_GRID_SIZE_FINE = 8;
|
@ -1,6 +1,6 @@
|
||||
import { roundToMultiple } from 'common/util/roundDownToMultiple';
|
||||
import { CANVAS_GRID_SIZE_FINE } from 'features/canvas/store/canvasSlice';
|
||||
import type { Dimensions } from 'features/canvas/store/canvasTypes';
|
||||
import { CANVAS_GRID_SIZE_FINE } from 'features/canvas/store/constants';
|
||||
|
||||
const getScaledBoundingBoxDimensions = (dimensions: Dimensions) => {
|
||||
const { width, height } = dimensions;
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { roundToMultiple } from 'common/util/roundDownToMultiple';
|
||||
import type { Dimensions } from 'features/canvas/store/canvasTypes';
|
||||
|
||||
const roundDimensionsToMultiple = (dimensions: Dimensions, multiple: number): Dimensions => {
|
||||
const roundDimensionsToMultiple = (
|
||||
dimensions: Dimensions,
|
||||
multiple: number
|
||||
): Dimensions => {
|
||||
return {
|
||||
width: roundToMultiple(dimensions.width, multiple),
|
||||
height: roundToMultiple(dimensions.height, multiple),
|
||||
|
Reference in New Issue
Block a user