mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: Hotkeys 'g' and 'o' not resizing the canvas
This commit is contained in:
parent
4975b1a704
commit
ab2343da51
@ -1,7 +1,9 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
|
import { requestCanvasRescale } from 'features/canvas/store/thunks/requestCanvasScale';
|
||||||
import { shiftKeyPressed } from 'features/ui/store/hotkeysSlice';
|
import { shiftKeyPressed } from 'features/ui/store/hotkeysSlice';
|
||||||
|
import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
|
||||||
import {
|
import {
|
||||||
setActiveTab,
|
setActiveTab,
|
||||||
toggleGalleryPanel,
|
toggleGalleryPanel,
|
||||||
@ -35,6 +37,7 @@ const globalHotkeysSelector = createSelector(
|
|||||||
const GlobalHotkeys: React.FC = () => {
|
const GlobalHotkeys: React.FC = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { shift } = useAppSelector(globalHotkeysSelector);
|
const { shift } = useAppSelector(globalHotkeysSelector);
|
||||||
|
const activeTabName = useAppSelector(activeTabNameSelector);
|
||||||
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'*',
|
'*',
|
||||||
@ -51,6 +54,9 @@ const GlobalHotkeys: React.FC = () => {
|
|||||||
|
|
||||||
useHotkeys('o', () => {
|
useHotkeys('o', () => {
|
||||||
dispatch(toggleParametersPanel());
|
dispatch(toggleParametersPanel());
|
||||||
|
if (activeTabName === 'unifiedCanvas') {
|
||||||
|
dispatch(requestCanvasRescale());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useHotkeys(['shift+o'], () => {
|
useHotkeys(['shift+o'], () => {
|
||||||
@ -59,6 +65,9 @@ const GlobalHotkeys: React.FC = () => {
|
|||||||
|
|
||||||
useHotkeys('g', () => {
|
useHotkeys('g', () => {
|
||||||
dispatch(toggleGalleryPanel());
|
dispatch(toggleGalleryPanel());
|
||||||
|
if (activeTabName === 'unifiedCanvas') {
|
||||||
|
dispatch(requestCanvasRescale());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useHotkeys(['shift+g'], () => {
|
useHotkeys(['shift+g'], () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user