mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
shouldShow checks added
This commit is contained in:
parent
b94a2addf3
commit
78af17cccf
1 changed files with 7 additions and 3 deletions
|
@ -9,7 +9,7 @@ import CopyPasteHOC from './copy-paste-hoc.jsx';
|
||||||
import {selectAllBitmap} from '../helper/bitmap';
|
import {selectAllBitmap} from '../helper/bitmap';
|
||||||
import {clearSelection, deleteSelection, getSelectedLeafItems,
|
import {clearSelection, deleteSelection, getSelectedLeafItems,
|
||||||
selectAllItems, selectAllSegments} from '../helper/selection';
|
selectAllItems, selectAllSegments} from '../helper/selection';
|
||||||
import {groupSelection, ungroupSelection} from '../helper/group';
|
import {groupSelection, shouldShowGroup, ungroupSelection, shouldShowUngroup} from '../helper/group';
|
||||||
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
|
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
|
||||||
import {changeMode} from '../reducers/modes';
|
import {changeMode} from '../reducers/modes';
|
||||||
|
|
||||||
|
@ -49,10 +49,14 @@ const KeyboardShortcutsHOC = function (WrappedComponent) {
|
||||||
} else if (event.key === 'z') {
|
} else if (event.key === 'z') {
|
||||||
this.props.onUndo();
|
this.props.onUndo();
|
||||||
} else if (event.shiftKey && event.key.toLowerCase() === 'g') {
|
} else if (event.shiftKey && event.key.toLowerCase() === 'g') {
|
||||||
|
if (shouldShowUngroup()) {
|
||||||
ungroupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
ungroupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
} else if (event.key === 'g') {
|
} else if (event.key === 'g') {
|
||||||
|
if (shouldShowGroup()) {
|
||||||
groupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
groupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
} else if (event.key === 'c') {
|
} else if (event.key === 'c') {
|
||||||
this.props.onCopyToClipboard();
|
this.props.onCopyToClipboard();
|
||||||
|
|
Loading…
Reference in a new issue