mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
implement stroke style (#1571)
This commit is contained in:
parent
f6be200388
commit
39c56a4c01
20 changed files with 459 additions and 9 deletions
|
@ -227,6 +227,41 @@ export const actionChangeSloppiness = register({
|
|||
),
|
||||
});
|
||||
|
||||
export const actionChangeStrokeStyle = register({
|
||||
name: "changeStrokeStyle",
|
||||
perform: (elements, appState, value) => {
|
||||
return {
|
||||
elements: changeProperty(elements, appState, (el) =>
|
||||
newElementWith(el, {
|
||||
strokeStyle: value,
|
||||
}),
|
||||
),
|
||||
appState: { ...appState, currentItemStrokeStyle: value },
|
||||
commitToHistory: true,
|
||||
};
|
||||
},
|
||||
PanelComponent: ({ elements, appState, updateData }) => (
|
||||
<fieldset>
|
||||
<legend>{t("labels.strokeStyle")}</legend>
|
||||
<ButtonSelect
|
||||
group="strokeStyle"
|
||||
options={[
|
||||
{ value: "solid", text: t("labels.strokeStyle_solid") },
|
||||
{ value: "dashed", text: t("labels.strokeStyle_dashed") },
|
||||
{ value: "dotted", text: t("labels.strokeStyle_dotted") },
|
||||
]}
|
||||
value={getFormValue(
|
||||
elements,
|
||||
appState,
|
||||
(element) => element.strokeStyle,
|
||||
appState.currentItemStrokeStyle,
|
||||
)}
|
||||
onChange={(value) => updateData(value)}
|
||||
/>
|
||||
</fieldset>
|
||||
),
|
||||
});
|
||||
|
||||
export const actionChangeOpacity = register({
|
||||
name: "changeOpacity",
|
||||
perform: (elements, appState, value) => {
|
||||
|
|
|
@ -30,6 +30,7 @@ export type ActionName =
|
|||
| "changeFillStyle"
|
||||
| "changeStrokeWidth"
|
||||
| "changeSloppiness"
|
||||
| "changeStrokeStyle"
|
||||
| "changeOpacity"
|
||||
| "changeFontSize"
|
||||
| "toggleCanvasMenu"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue