mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -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 {clearSelection, deleteSelection, getSelectedLeafItems,
|
||||
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 {changeMode} from '../reducers/modes';
|
||||
|
||||
|
@ -49,10 +49,14 @@ const KeyboardShortcutsHOC = function (WrappedComponent) {
|
|||
} else if (event.key === 'z') {
|
||||
this.props.onUndo();
|
||||
} else if (event.shiftKey && event.key.toLowerCase() === 'g') {
|
||||
ungroupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||
if (shouldShowUngroup()) {
|
||||
ungroupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||
}
|
||||
event.preventDefault();
|
||||
} else if (event.key === 'g') {
|
||||
groupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||
if (shouldShowGroup()) {
|
||||
groupSelection(clearSelectedItems, setSelectedItems, this.props.onUpdateImage);
|
||||
}
|
||||
event.preventDefault();
|
||||
} else if (event.key === 'c') {
|
||||
this.props.onCopyToClipboard();
|
||||
|
|
Loading…
Reference in a new issue