mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-11 11:30:07 +02:00
fix: getDefaultLineHeight should return default font family line height for unknown font (#6399)
* fix(getDefaultLineHeight): make getDefaultLineHeight always has a default value * test: add getDefaultLineHeight test case when using unknown font * test: add getDefaultLineHeight test case when using unknown font * Revert "test: add getDefaultLineHeight test case when using unknown font" This reverts commit d41da5493b6edab9e599a13a23c387d38345bf03. * test: add getDefaultLineHeight test case when using unknown font * newline * newline * tweaks * trigger action * trigger action * fix --------- Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
@@ -887,7 +887,7 @@ const DEFAULT_LINE_HEIGHT = {
|
||||
};
|
||||
|
||||
export const getDefaultLineHeight = (fontFamily: FontFamilyValues) => {
|
||||
if (fontFamily) {
|
||||
if (fontFamily in DEFAULT_LINE_HEIGHT) {
|
||||
return DEFAULT_LINE_HEIGHT[fontFamily];
|
||||
}
|
||||
return DEFAULT_LINE_HEIGHT[DEFAULT_FONT_FAMILY];
|
||||
|
Reference in New Issue
Block a user