mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 14:02:50 -05:00
commit
0a308e8e44
2 changed files with 6 additions and 4 deletions
|
@ -151,13 +151,11 @@ const ModeToolsComponent = props => {
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
<InputGroup className={classNames(styles.modLabeledIconHeight)}>
|
<InputGroup className={classNames(styles.modLabeledIconHeight)}>
|
||||||
<LabeledIconButton
|
<LabeledIconButton
|
||||||
disabled={!props.selectedItems.length}
|
|
||||||
imgSrc={flipHorizontalIcon}
|
imgSrc={flipHorizontalIcon}
|
||||||
title={props.intl.formatMessage(messages.flipHorizontal)}
|
title={props.intl.formatMessage(messages.flipHorizontal)}
|
||||||
onClick={props.onFlipHorizontal}
|
onClick={props.onFlipHorizontal}
|
||||||
/>
|
/>
|
||||||
<LabeledIconButton
|
<LabeledIconButton
|
||||||
disabled={!props.selectedItems.length}
|
|
||||||
imgSrc={flipVerticalIcon}
|
imgSrc={flipVerticalIcon}
|
||||||
title={props.intl.formatMessage(messages.flipVertical)}
|
title={props.intl.formatMessage(messages.flipVertical)}
|
||||||
onClick={props.onFlipVertical}
|
onClick={props.onFlipVertical}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import bindAll from 'lodash.bindall';
|
||||||
import ModeToolsComponent from '../components/mode-tools/mode-tools.jsx';
|
import ModeToolsComponent from '../components/mode-tools/mode-tools.jsx';
|
||||||
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
|
import {clearSelectedItems, setSelectedItems} from '../reducers/selected-items';
|
||||||
import {incrementPasteOffset, setClipboardItems} from '../reducers/clipboard';
|
import {incrementPasteOffset, setClipboardItems} from '../reducers/clipboard';
|
||||||
import {clearSelection, getSelectedLeafItems, getSelectedRootItems} from '../helper/selection';
|
import {clearSelection, getSelectedLeafItems, getSelectedRootItems, getAllRootItems} from '../helper/selection';
|
||||||
import {HANDLE_RATIO, ensureClockwise} from '../helper/math';
|
import {HANDLE_RATIO, ensureClockwise} from '../helper/math';
|
||||||
|
|
||||||
class ModeTools extends React.Component {
|
class ModeTools extends React.Component {
|
||||||
|
@ -137,7 +137,11 @@ class ModeTools extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_handleFlip (horizontalScale, verticalScale) {
|
_handleFlip (horizontalScale, verticalScale) {
|
||||||
const selectedItems = getSelectedRootItems();
|
let selectedItems = getSelectedRootItems();
|
||||||
|
if (selectedItems.length === 0) {
|
||||||
|
// If nothing is selected, select everything
|
||||||
|
selectedItems = getAllRootItems();
|
||||||
|
}
|
||||||
// Record old indices
|
// Record old indices
|
||||||
for (const item of selectedItems) {
|
for (const item of selectedItems) {
|
||||||
item.data.index = item.index;
|
item.data.index = item.index;
|
||||||
|
|
Loading…
Reference in a new issue