This commit is contained in:
psychedelicious 2022-11-21 20:34:35 +11:00 committed by blessedcoolant
parent ef1dbdb33d
commit e821b97cfc
7 changed files with 5 additions and 25 deletions

View File

@ -3,7 +3,6 @@ import { useLayoutEffect, useRef } from 'react';
import { useAppDispatch, useAppSelector } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/store';
import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
import { import {
resizeAndScaleCanvas,
resizeCanvas, resizeCanvas,
setCanvasContainerDimensions, setCanvasContainerDimensions,
setDoesCanvasNeedScaling, setDoesCanvasNeedScaling,

View File

@ -2,7 +2,6 @@ import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/store'; import { useAppSelector } from 'app/store';
import { GroupConfig } from 'konva/lib/Group'; import { GroupConfig } from 'konva/lib/Group';
import _ from 'lodash'; import _ from 'lodash';
import { useState } from 'react';
import { Group, Rect } from 'react-konva'; import { Group, Rect } from 'react-konva';
import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import IAICanvasImage from './IAICanvasImage'; import IAICanvasImage from './IAICanvasImage';

View File

@ -1,4 +1,4 @@
import { Box, ButtonGroup, Flex } from '@chakra-ui/react'; import { ButtonGroup, Flex } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit'; import { createSelector } from '@reduxjs/toolkit';
import { import {
clearMask, clearMask,
@ -17,16 +17,7 @@ import IAIColorPicker from 'common/components/IAIColorPicker';
import IAIButton from 'common/components/IAIButton'; import IAIButton from 'common/components/IAIButton';
import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import { useHotkeys } from 'react-hotkeys-hook'; import { useHotkeys } from 'react-hotkeys-hook';
import IAISelect from 'common/components/IAISelect'; import { rgbaColorToString } from 'features/canvas/util/colorToString';
import {
CanvasLayer,
LAYER_NAMES_DICT,
} from 'features/canvas/store/canvasTypes';
import { ChangeEvent } from 'react';
import {
rgbaColorToRgbString,
rgbaColorToString,
} from 'features/canvas/util/colorToString';
export const selector = createSelector( export const selector = createSelector(
[canvasSelector], [canvasSelector],

View File

@ -1,7 +1,6 @@
import { Flex } from '@chakra-ui/react'; import { Flex } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit'; import { createSelector } from '@reduxjs/toolkit';
import { import {
clearCanvasHistory,
setShouldAutoSave, setShouldAutoSave,
setShouldCropToBoundingBoxOnSave, setShouldCropToBoundingBoxOnSave,
setShouldDarkenOutsideBoundingBox, setShouldDarkenOutsideBoundingBox,
@ -13,11 +12,10 @@ import {
import { useAppDispatch, useAppSelector } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/store';
import _ from 'lodash'; import _ from 'lodash';
import IAIIconButton from 'common/components/IAIIconButton'; import IAIIconButton from 'common/components/IAIIconButton';
import { FaTrash, FaWrench } from 'react-icons/fa'; import { FaWrench } from 'react-icons/fa';
import IAIPopover from 'common/components/IAIPopover'; import IAIPopover from 'common/components/IAIPopover';
import IAICheckbox from 'common/components/IAICheckbox'; import IAICheckbox from 'common/components/IAICheckbox';
import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { canvasSelector } from 'features/canvas/store/canvasSelectors';
import IAIButton from 'common/components/IAIButton';
import EmptyTempFolderButtonModal from 'features/system/components/ClearTempFolderButtonModal'; import EmptyTempFolderButtonModal from 'features/system/components/ClearTempFolderButtonModal';
import ClearCanvasHistoryButtonModal from '../ClearCanvasHistoryButtonModal'; import ClearCanvasHistoryButtonModal from '../ClearCanvasHistoryButtonModal';

View File

@ -18,7 +18,6 @@ import { useHotkeys } from 'react-hotkeys-hook';
import IAIPopover from 'common/components/IAIPopover'; import IAIPopover from 'common/components/IAIPopover';
import IAISlider from 'common/components/IAISlider'; import IAISlider from 'common/components/IAISlider';
import IAIColorPicker from 'common/components/IAIColorPicker'; import IAIColorPicker from 'common/components/IAIColorPicker';
import { rgbaColorToString } from 'features/canvas/util/colorToString';
export const selector = createSelector( export const selector = createSelector(
[canvasSelector, isStagingSelector, systemSelector], [canvasSelector, isStagingSelector, systemSelector],
@ -31,7 +30,6 @@ export const selector = createSelector(
isStaging, isStaging,
isProcessing, isProcessing,
brushColor, brushColor,
brushColorString: rgbaColorToString(brushColor),
brushSize, brushSize,
}; };
}, },
@ -44,8 +42,7 @@ export const selector = createSelector(
const IAICanvasToolChooserOptions = () => { const IAICanvasToolChooserOptions = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { tool, brushColor, brushSize, brushColorString, isStaging } = const { tool, brushColor, brushSize, isStaging } = useAppSelector(selector);
useAppSelector(selector);
useHotkeys( useHotkeys(
['b'], ['b'],

View File

@ -1,4 +1,3 @@
import { Flex, ListItem, Tooltip, UnorderedList } from '@chakra-ui/react';
import { useHotkeys } from 'react-hotkeys-hook'; import { useHotkeys } from 'react-hotkeys-hook';
import { FaPlay } from 'react-icons/fa'; import { FaPlay } from 'react-icons/fa';
import { readinessSelector } from 'app/selectors/readinessSelector'; import { readinessSelector } from 'app/selectors/readinessSelector';
@ -8,7 +7,6 @@ import IAIButton, { IAIButtonProps } from 'common/components/IAIButton';
import IAIIconButton, { import IAIIconButton, {
IAIIconButtonProps, IAIIconButtonProps,
} from 'common/components/IAIIconButton'; } from 'common/components/IAIIconButton';
import IAIPopover from 'common/components/IAIPopover';
import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors';
interface InvokeButton interface InvokeButton
@ -19,7 +17,7 @@ interface InvokeButton
export default function InvokeButton(props: InvokeButton) { export default function InvokeButton(props: InvokeButton) {
const { iconButton = false, ...rest } = props; const { iconButton = false, ...rest } = props;
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { isReady, reasonsWhyNotReady } = useAppSelector(readinessSelector); const { isReady } = useAppSelector(readinessSelector);
const activeTabName = useAppSelector(activeTabNameSelector); const activeTabName = useAppSelector(activeTabNameSelector);
const handleClickGenerate = () => { const handleClickGenerate = () => {

View File

@ -24,14 +24,12 @@ import {
setShouldConfirmOnDelete, setShouldConfirmOnDelete,
setShouldDisplayGuides, setShouldDisplayGuides,
setShouldDisplayInProgressType, setShouldDisplayInProgressType,
SystemState,
} from 'features/system/store/systemSlice'; } from 'features/system/store/systemSlice';
import ModelList from './ModelList'; import ModelList from './ModelList';
import { IN_PROGRESS_IMAGE_TYPES } from 'app/constants'; import { IN_PROGRESS_IMAGE_TYPES } from 'app/constants';
import IAISwitch from 'common/components/IAISwitch'; import IAISwitch from 'common/components/IAISwitch';
import IAISelect from 'common/components/IAISelect'; import IAISelect from 'common/components/IAISelect';
import IAINumberInput from 'common/components/IAINumberInput'; import IAINumberInput from 'common/components/IAINumberInput';
import EmptyTempFolderButtonModal from '../ClearTempFolderButtonModal';
import { systemSelector } from 'features/system/store/systemSelectors'; import { systemSelector } from 'features/system/store/systemSelectors';
import { optionsSelector } from 'features/options/store/optionsSelectors'; import { optionsSelector } from 'features/options/store/optionsSelectors';
import { setShouldLoopback } from 'features/options/store/optionsSlice'; import { setShouldLoopback } from 'features/options/store/optionsSlice';