changing new shape property sets it as default (#520)

* changing new shape property sets it as default

* set correct opacity while editing new test

Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
This commit is contained in:
lissitz 2020-01-25 18:58:57 +01:00 committed by Christopher Chedeau
parent 69061e20ac
commit 1bae203a78
5 changed files with 41 additions and 8 deletions

View file

@ -102,6 +102,7 @@ export const actionChangeFillStyle: Action = {
shape: null,
fillStyle: value,
})),
appState: { ...appState, currentItemFillStyle: value },
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
@ -136,6 +137,7 @@ export const actionChangeStrokeWidth: Action = {
shape: null,
strokeWidth: value,
})),
appState: { ...appState, currentItemStrokeWidth: value },
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
@ -168,6 +170,7 @@ export const actionChangeSloppiness: Action = {
shape: null,
roughness: value,
})),
appState: { ...appState, currentItemRoughness: value },
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
@ -200,6 +203,7 @@ export const actionChangeOpacity: Action = {
shape: null,
opacity: value,
})),
appState: { ...appState, currentItemOpacity: value },
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
@ -240,6 +244,12 @@ export const actionChangeFontSize: Action = {
return el;
}),
appState: {
...appState,
currentItemFont: `${value}px ${
appState.currentItemFont.split("px ")[1]
}`,
},
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
@ -281,6 +291,12 @@ export const actionChangeFontFamily: Action = {
return el;
}),
appState: {
...appState,
currentItemFont: `${
appState.currentItemFont.split("px ")[0]
}px ${value}`,
},
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (