mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
Clear out gradients when setting default colors
This commit is contained in:
parent
740f0e6b2b
commit
cf507eac06
2 changed files with 10 additions and 10 deletions
|
@ -83,11 +83,7 @@ class OvalMode extends React.Component {
|
|||
const strokeColor1 = this.props.colorState.strokeColor.primary;
|
||||
let strokeColor2 = this.props.colorState.strokeColor.secondary;
|
||||
let strokeGradient = this.props.colorState.strokeColor.gradientType;
|
||||
if (strokeColor1 === MIXED ||
|
||||
(strokeColor1 === null &&
|
||||
(strokeColor2 === null || strokeColor2 === MIXED))) {
|
||||
this.props.onChangeStrokeColor(DEFAULT_COLOR);
|
||||
}
|
||||
|
||||
if (fillColor2 === MIXED) {
|
||||
this.props.clearFillGradient();
|
||||
fillColor2 = null;
|
||||
|
@ -110,11 +106,15 @@ class OvalMode extends React.Component {
|
|||
|
||||
if (fillColorMissing && strokeColorMissing) {
|
||||
this.props.onChangeFillColor(DEFAULT_COLOR);
|
||||
this.props.clearFillGradient();
|
||||
this.props.onChangeStrokeColor(null);
|
||||
this.props.clearStrokeGradient();
|
||||
} else if (fillColorMissing && !strokeColorMissing) {
|
||||
this.props.onChangeFillColor(null);
|
||||
this.props.clearFillGradient();
|
||||
} else if (!fillColorMissing && strokeColorMissing) {
|
||||
this.props.onChangeStrokeColor(null);
|
||||
this.props.clearStrokeGradient();
|
||||
}
|
||||
}
|
||||
render () {
|
||||
|
|
|
@ -78,11 +78,7 @@ class RectMode extends React.Component {
|
|||
const strokeColor1 = this.props.colorState.strokeColor.primary;
|
||||
let strokeColor2 = this.props.colorState.strokeColor.secondary;
|
||||
let strokeGradient = this.props.colorState.strokeColor.gradientType;
|
||||
if (strokeColor1 === MIXED ||
|
||||
(strokeColor1 === null &&
|
||||
(strokeColor2 === null || strokeColor2 === MIXED))) {
|
||||
this.props.onChangeStrokeColor(DEFAULT_COLOR);
|
||||
}
|
||||
|
||||
if (fillColor2 === MIXED) {
|
||||
this.props.clearFillGradient();
|
||||
fillColor2 = null;
|
||||
|
@ -105,11 +101,15 @@ class RectMode extends React.Component {
|
|||
|
||||
if (fillColorMissing && strokeColorMissing) {
|
||||
this.props.onChangeFillColor(DEFAULT_COLOR);
|
||||
this.props.clearFillGradient();
|
||||
this.props.onChangeStrokeColor(null);
|
||||
this.props.clearStrokeGradient();
|
||||
} else if (fillColorMissing && !strokeColorMissing) {
|
||||
this.props.onChangeFillColor(null);
|
||||
this.props.clearFillGradient();
|
||||
} else if (!fillColorMissing && strokeColorMissing) {
|
||||
this.props.onChangeStrokeColor(null);
|
||||
this.props.clearStrokeGradient();
|
||||
}
|
||||
}
|
||||
deactivateTool () {
|
||||
|
|
Loading…
Reference in a new issue