mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 14:02:50 -05:00
Simplify fill-color-2 reducer logic
why my brain hurt???
This commit is contained in:
parent
2218730c11
commit
604b450b5d
1 changed files with 5 additions and 6 deletions
|
@ -24,14 +24,13 @@ const reducer = function (state, action) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
const colors = getColorsFromSelection(action.selectedItems);
|
const colors = getColorsFromSelection(action.selectedItems);
|
||||||
if (colors.gradientType === GradientTypes.SOLID) {
|
|
||||||
// Gradient type may be solid when multiple gradient types are selected.
|
// Gradient type may be solid when multiple gradient types are selected.
|
||||||
// In this case, changing the first color should not change the second color.
|
// In this case, changing the first color should not change the second color.
|
||||||
if (colors.fillColor2 === MIXED) return MIXED;
|
if (colors.gradientType !== GradientTypes.SOLID || colors.fillColor2 === MIXED) {
|
||||||
return state;
|
|
||||||
}
|
|
||||||
return colors.fillColor2;
|
return colors.fillColor2;
|
||||||
}
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
case CLEAR_GRADIENT:
|
case CLEAR_GRADIENT:
|
||||||
return null;
|
return null;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue