fix: incorrect background fill button active state (#6491)
This commit is contained in:
parent
98a77d7426
commit
eea30da05a
@ -84,7 +84,7 @@ import {
|
|||||||
isSomeElementSelected,
|
isSomeElementSelected,
|
||||||
} from "../scene";
|
} from "../scene";
|
||||||
import { hasStrokeColor } from "../scene/comparisons";
|
import { hasStrokeColor } from "../scene/comparisons";
|
||||||
import { arrayToMap } from "../utils";
|
import { arrayToMap, getShortcutKey } from "../utils";
|
||||||
import { register } from "./register";
|
import { register } from "./register";
|
||||||
|
|
||||||
const FONT_SIZE_RELATIVE_INCREASE_STEP = 0.1;
|
const FONT_SIZE_RELATIVE_INCREASE_STEP = 0.1;
|
||||||
@ -314,9 +314,9 @@ export const actionChangeFillStyle = register({
|
|||||||
},
|
},
|
||||||
PanelComponent: ({ elements, appState, updateData }) => {
|
PanelComponent: ({ elements, appState, updateData }) => {
|
||||||
const selectedElements = getSelectedElements(elements, appState);
|
const selectedElements = getSelectedElements(elements, appState);
|
||||||
const allElementsZigZag = selectedElements.every(
|
const allElementsZigZag =
|
||||||
(el) => el.fillStyle === "zigzag",
|
selectedElements.length > 0 &&
|
||||||
);
|
selectedElements.every((el) => el.fillStyle === "zigzag");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@ -326,7 +326,9 @@ export const actionChangeFillStyle = register({
|
|||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
value: "hachure",
|
value: "hachure",
|
||||||
text: t("labels.hachure"),
|
text: `${
|
||||||
|
allElementsZigZag ? t("labels.zigzag") : t("labels.hachure")
|
||||||
|
} (${getShortcutKey("Alt-Click")})`,
|
||||||
icon: allElementsZigZag ? FillZigZagIcon : FillHachureIcon,
|
icon: allElementsZigZag ? FillZigZagIcon : FillHachureIcon,
|
||||||
active: allElementsZigZag ? true : undefined,
|
active: allElementsZigZag ? true : undefined,
|
||||||
},
|
},
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
"veryLarge": "Very large",
|
"veryLarge": "Very large",
|
||||||
"solid": "Solid",
|
"solid": "Solid",
|
||||||
"hachure": "Hachure",
|
"hachure": "Hachure",
|
||||||
|
"zigzag": "Zigzag",
|
||||||
"crossHatch": "Cross-hatch",
|
"crossHatch": "Cross-hatch",
|
||||||
"thin": "Thin",
|
"thin": "Thin",
|
||||||
"bold": "Bold",
|
"bold": "Bold",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user