mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-07-05 17:51:08 -04:00
Don't clear gradient on entering vector line mode
This commit is contained in:
parent
4f86762737
commit
a97aee7913
1 changed files with 1 additions and 7 deletions
|
@ -9,7 +9,7 @@ import {clearSelection} from '../helper/selection';
|
||||||
import {endPointHit, touching} from '../helper/snapping';
|
import {endPointHit, touching} from '../helper/snapping';
|
||||||
import {drawHitPoint, removeHitPoint} from '../helper/guides';
|
import {drawHitPoint, removeHitPoint} from '../helper/guides';
|
||||||
import {styleShape} from '../helper/style-path';
|
import {styleShape} from '../helper/style-path';
|
||||||
import {changeStrokeColor, clearStrokeGradient} from '../reducers/stroke-style';
|
import {changeStrokeColor} from '../reducers/stroke-style';
|
||||||
import {changeStrokeWidth} from '../reducers/stroke-width';
|
import {changeStrokeWidth} from '../reducers/stroke-width';
|
||||||
import {changeMode} from '../reducers/modes';
|
import {changeMode} from '../reducers/modes';
|
||||||
import {clearSelectedItems} from '../reducers/selected-items';
|
import {clearSelectedItems} from '../reducers/selected-items';
|
||||||
|
@ -59,8 +59,6 @@ class LineMode extends React.Component {
|
||||||
}
|
}
|
||||||
activateTool () {
|
activateTool () {
|
||||||
clearSelection(this.props.clearSelectedItems);
|
clearSelection(this.props.clearSelectedItems);
|
||||||
this.props.clearGradient();
|
|
||||||
|
|
||||||
// Force the default line color if stroke is MIXED or transparent
|
// Force the default line color if stroke is MIXED or transparent
|
||||||
const strokeColor = this.props.colorState.strokeColor.primary;
|
const strokeColor = this.props.colorState.strokeColor.primary;
|
||||||
if (strokeColor === MIXED || strokeColor === null) {
|
if (strokeColor === MIXED || strokeColor === null) {
|
||||||
|
@ -275,7 +273,6 @@ class LineMode extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
LineMode.propTypes = {
|
LineMode.propTypes = {
|
||||||
clearGradient: PropTypes.func.isRequired,
|
|
||||||
clearSelectedItems: PropTypes.func.isRequired,
|
clearSelectedItems: PropTypes.func.isRequired,
|
||||||
colorState: PropTypes.shape({
|
colorState: PropTypes.shape({
|
||||||
fillColor: ColorStyleProptype,
|
fillColor: ColorStyleProptype,
|
||||||
|
@ -294,9 +291,6 @@ const mapStateToProps = state => ({
|
||||||
isLineModeActive: state.scratchPaint.mode === Modes.LINE
|
isLineModeActive: state.scratchPaint.mode === Modes.LINE
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
clearGradient: () => {
|
|
||||||
dispatch(clearStrokeGradient());
|
|
||||||
},
|
|
||||||
clearSelectedItems: () => {
|
clearSelectedItems: () => {
|
||||||
dispatch(clearSelectedItems());
|
dispatch(clearSelectedItems());
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue