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

@ -7,6 +7,7 @@ type TextWysiwygParams = {
y: number;
strokeColor: string;
font: string;
opacity: number;
onSubmit: (text: string) => void;
onCancel: () => void;
};
@ -23,6 +24,7 @@ export function textWysiwyg({
y,
strokeColor,
font,
opacity,
onSubmit,
onCancel,
}: TextWysiwygParams) {
@ -38,6 +40,7 @@ export function textWysiwyg({
Object.assign(editable.style, {
color: strokeColor,
position: "absolute",
opacity: opacity / 100,
top: y + "px",
left: x + "px",
transform: "translate(-50%, -50%)",