Vector gradient ()

This commit is contained in:
DD Liu 2018-07-17 16:37:03 -04:00 committed by GitHub
parent 9be50ffaf6
commit 4ba79cacbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1092 additions and 99 deletions
src/containers

View file

@ -9,6 +9,7 @@ import {changeFillColor, DEFAULT_COLOR} from '../reducers/fill-color';
import {changeMode} from '../reducers/modes';
import {clearSelectedItems} from '../reducers/selected-items';
import {clearSelection} from '../helper/selection';
import {clearGradient} from '../reducers/selection-gradient-type';
import BitLineModeComponent from '../components/bit-line-mode/bit-line-mode.jsx';
import BitLineTool from '../helper/bit-tools/line-tool';
@ -33,7 +34,7 @@ class BitLineMode extends React.Component {
if (this.tool && nextProps.bitBrushSize !== this.props.bitBrushSize) {
this.tool.setLineSize(nextProps.bitBrushSize);
}
if (nextProps.isBitLineModeActive && !this.props.isBitLineModeActive) {
this.activateTool();
} else if (!nextProps.isBitLineModeActive && this.props.isBitLineModeActive) {
@ -45,6 +46,7 @@ class BitLineMode extends React.Component {
}
activateTool () {
clearSelection(this.props.clearSelectedItems);
this.props.clearGradient();
// Force the default line color if fill is MIXED or transparent
let color = this.props.color;
if (!color || color === MIXED) {
@ -76,6 +78,7 @@ class BitLineMode extends React.Component {
BitLineMode.propTypes = {
bitBrushSize: PropTypes.number.isRequired,
clearGradient: PropTypes.func.isRequired,
clearSelectedItems: PropTypes.func.isRequired,
color: PropTypes.string,
handleMouseDown: PropTypes.func.isRequired,
@ -93,6 +96,9 @@ const mapDispatchToProps = dispatch => ({
clearSelectedItems: () => {
dispatch(clearSelectedItems());
},
clearGradient: () => {
dispatch(clearGradient());
},
handleMouseDown: () => {
dispatch(changeMode(Modes.BIT_LINE));
},