We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 379f91f + 76daa1c commit 4783a86Copy full SHA for 4783a86
src/core/platform.ts
@@ -75,7 +75,7 @@ export const platformApi: Platform = {
75
text = text || '';
76
font = font || DEFAULT_FONT;
77
// Use font size if there is no other method can be used.
78
- const res = /(\d+)px/.exec(font);
+ const res = /((?:\d+)?\.?\d*)px/.exec(font);
79
const fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
80
let width = 0;
81
if (font.indexOf('mono') >= 0) { // is monospace
@@ -108,4 +108,4 @@ export function setPlatformAPI(newPlatformApis: Partial<Platform>) {
108
(platformApi as any)[key] = (newPlatformApis as any)[key];
109
}
110
111
-}
+}
0 commit comments