Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 8720ba3

Browse files
committed
better compatibility with older versions
1 parent e943c1b commit 8720ba3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ export const responsiveWidth = (w) => {
3737
};
3838

3939
export const responsiveFontSize = (f) => {
40-
return ((16/9)*width)*(f/100);
40+
const tempHeight = (16/9)*width;
41+
return Math.sqrt(Math.pow(tempHeight, 2) + Math.pow(width, 2))*(f/100);
4142
};

0 commit comments

Comments
 (0)