mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-24 05:09:52 -05:00
Remove unnecessary bitmapMode params
This commit is contained in:
parent
a304dea338
commit
6ab7b4c67d
3 changed files with 3 additions and 11 deletions
|
@ -58,7 +58,6 @@ const makeColorIndicator = (label, isStroke) => {
|
||||||
newColor,
|
newColor,
|
||||||
this.props.colorIndex,
|
this.props.colorIndex,
|
||||||
this.props.gradientType === GradientTypes.SOLID,
|
this.props.gradientType === GradientTypes.SOLID,
|
||||||
formatIsBitmap,
|
|
||||||
// In bitmap mode, only the fill color selector is used, but it applies to stroke if fillBitmapShapes
|
// 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
|
// is set to true via the "Fill"/"Outline" selector button
|
||||||
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
|
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.
|
// Apply color and update redux, but do not update svg until picker closes.
|
||||||
const isDifferent = applyGradientTypeToSelection(
|
const isDifferent = applyGradientTypeToSelection(
|
||||||
gradientType,
|
gradientType,
|
||||||
formatIsBitmap,
|
|
||||||
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
|
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
|
||||||
this.props.textEditTarget);
|
this.props.textEditTarget);
|
||||||
this._hasChanged = this._hasChanged || isDifferent;
|
this._hasChanged = this._hasChanged || isDifferent;
|
||||||
|
@ -106,7 +104,6 @@ const makeColorIndicator = (label, isStroke) => {
|
||||||
if (getSelectedLeafItems().length) {
|
if (getSelectedLeafItems().length) {
|
||||||
const formatIsBitmap = isBitmap(this.props.format);
|
const formatIsBitmap = isBitmap(this.props.format);
|
||||||
const isDifferent = swapColorsInSelection(
|
const isDifferent = swapColorsInSelection(
|
||||||
formatIsBitmap,
|
|
||||||
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
|
isStroke || (formatIsBitmap && !this.props.fillBitmapShapes),
|
||||||
this.props.textEditTarget);
|
this.props.textEditTarget);
|
||||||
this.props.setSelectedItems(this.props.format);
|
this.props.setSelectedItems(this.props.format);
|
||||||
|
|
|
@ -29,7 +29,6 @@ class StrokeWidthIndicator extends React.Component {
|
||||||
'#000',
|
'#000',
|
||||||
0, // colorIndex,
|
0, // colorIndex,
|
||||||
true, // isSolidGradient
|
true, // isSolidGradient
|
||||||
isBitmap(this.props.format),
|
|
||||||
true, // applyToStroke
|
true, // applyToStroke
|
||||||
this.props.textEditTarget) ||
|
this.props.textEditTarget) ||
|
||||||
changed;
|
changed;
|
||||||
|
|
|
@ -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
|
* @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.
|
* 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.
|
* 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 {?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
|
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
|
||||||
* @return {boolean} Whether the color application actually changed visibly.
|
* @return {boolean} Whether the color application actually changed visibly.
|
||||||
|
@ -109,7 +108,6 @@ const applyColorToSelection = function (
|
||||||
colorString,
|
colorString,
|
||||||
colorIndex,
|
colorIndex,
|
||||||
isSolidGradient,
|
isSolidGradient,
|
||||||
bitmapMode,
|
|
||||||
applyToStroke,
|
applyToStroke,
|
||||||
textEditTargetId
|
textEditTargetId
|
||||||
) {
|
) {
|
||||||
|
@ -159,12 +157,11 @@ const applyColorToSelection = function (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to swap gradient colors
|
* 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 {?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
|
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
|
||||||
* @return {boolean} Whether the color application actually changed visibly.
|
* @return {boolean} Whether the color application actually changed visibly.
|
||||||
*/
|
*/
|
||||||
const swapColorsInSelection = function (bitmapMode, applyToStroke, textEditTargetId) {
|
const swapColorsInSelection = function (applyToStroke, textEditTargetId) {
|
||||||
const items = _getColorStateListeners(textEditTargetId);
|
const items = _getColorStateListeners(textEditTargetId);
|
||||||
let changed = false;
|
let changed = false;
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
@ -194,12 +191,11 @@ const swapColorsInSelection = function (bitmapMode, applyToStroke, textEditTarge
|
||||||
/**
|
/**
|
||||||
* Called when setting gradient type
|
* Called when setting gradient type
|
||||||
* @param {GradientType} gradientType 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
|
* @param {?string} textEditTargetId paper.Item.id of text editing target, if any
|
||||||
* @return {boolean} Whether the color application actually changed visibly.
|
* @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);
|
const items = _getColorStateListeners(textEditTargetId);
|
||||||
let changed = false;
|
let changed = false;
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
|
|
Loading…
Reference in a new issue