use a const for default font value (#834)

This commit is contained in:
Faustino Kialungila 2020-02-24 16:29:54 +01:00 committed by GitHub
parent 2131befd7a
commit 1355e0201c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import {
redrawTextBoundingBox,
} from "../element";
import { KEYS } from "../keys";
import { DEFAULT_FONT } from "../appState";
let copiedStyles: string = "{}";
@ -43,7 +44,7 @@ export const actionPasteStyles: Action = {
roughness: pastedElement?.roughness,
};
if (isTextElement(newElement)) {
newElement.font = pastedElement?.font || "20px Virgil";
newElement.font = pastedElement?.font || DEFAULT_FONT;
redrawTextBoundingBox(newElement);
}
return newElement;