diff --git a/src/containers/oval-mode.jsx b/src/containers/oval-mode.jsx index c21b2af1..0d24e887 100644 --- a/src/containers/oval-mode.jsx +++ b/src/containers/oval-mode.jsx @@ -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 () { diff --git a/src/containers/rect-mode.jsx b/src/containers/rect-mode.jsx index 015d6530..49a9bb5c 100644 --- a/src/containers/rect-mode.jsx +++ b/src/containers/rect-mode.jsx @@ -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 () {