Remove unnecessary bitmapMode params

This commit is contained in:
adroitwhiz 2020-06-19 11:23:37 -04:00
parent a304dea338
commit 6ab7b4c67d
3 changed files with 3 additions and 11 deletions

View file

@ -58,7 +58,6 @@ const makeColorIndicator = (label, isStroke) => {
newColor,
this.props.colorIndex,
this.props.gradientType === GradientTypes.SOLID,
formatIsBitmap,
// In bitmap mode, only the fill color selector is used, but it applies to stroke if fillBitmapShapes
// is set to true via the "Fill"/"Outline" selector button
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
@ -71,7 +70,6 @@ const makeColorIndicator = (label, isStroke) => {
// Apply color and update redux, but do not update svg until picker closes.
const isDifferent = applyGradientTypeToSelection(
gradientType,
formatIsBitmap,
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
this.props.textEditTarget);
this._hasChanged = this._hasChanged || isDifferent;
@ -106,7 +104,6 @@ const makeColorIndicator = (label, isStroke) => {
if (getSelectedLeafItems().length) {
const formatIsBitmap = isBitmap(this.props.format);
const isDifferent = swapColorsInSelection(
formatIsBitmap,
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
this.props.textEditTarget);
this.props.setSelectedItems(this.props.format);

View file

@ -29,7 +29,6 @@ class StrokeWidthIndicator extends React.Component {
'#000',
0, // colorIndex,
true, // isSolidGradient
isBitmap(this.props.format),
true, // applyToStroke
this.props.textEditTarget) ||
changed;

View file

@ -100,7 +100,6 @@ const createGradientObject = function (color1, color2, gradientType, bounds, rad
* @param {boolean} isSolidGradient True if is solid gradient. Sometimes the item has a gradient but the color
* picker is set to a solid gradient. This happens when a mix of colors and gradient types is selected.
* When changing the color in this case, the solid gradient should override the existing gradient on the item.
* @param {?boolean} bitmapMode True if the color is being set in bitmap mode
* @param {?boolean} applyToStroke True if changing the selection's stroke, false if changing its fill.
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
* @return {boolean} Whether the color application actually changed visibly.
@ -109,7 +108,6 @@ const applyColorToSelection = function (
colorString,
colorIndex,
isSolidGradient,
bitmapMode,
applyToStroke,
textEditTargetId
) {
@ -159,12 +157,11 @@ const applyColorToSelection = function (
/**
* Called to swap gradient colors
* @param {?boolean} bitmapMode True if the fill color is being set in bitmap mode
* @param {?boolean} applyToStroke True if changing the selection's stroke, false if changing its fill.
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
* @return {boolean} Whether the color application actually changed visibly.
*/
const swapColorsInSelection = function (bitmapMode, applyToStroke, textEditTargetId) {
const swapColorsInSelection = function (applyToStroke, textEditTargetId) {
const items = _getColorStateListeners(textEditTargetId);
let changed = false;
for (const item of items) {
@ -194,12 +191,11 @@ const swapColorsInSelection = function (bitmapMode, applyToStroke, textEditTarge
/**
* Called when setting gradient type
* @param {GradientType} gradientType gradient type
* @param {?boolean} bitmapMode True if the fill color is being set in bitmap mode
* @param {boolean} applyToStroke True if changing the selection's stroke, false if changing its fill.
* @param {?boolean} applyToStroke True if changing the selection's stroke, false if changing its fill.
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
* @return {boolean} Whether the color application actually changed visibly.
*/
const applyGradientTypeToSelection = function (gradientType, bitmapMode, applyToStroke, textEditTargetId) {
const applyGradientTypeToSelection = function (gradientType, applyToStroke, textEditTargetId) {
const items = _getColorStateListeners(textEditTargetId);
let changed = false;
for (let item of items) {