Skip to content

Commit 5a3e061

Browse files
authored
Merge pull request #3621 from felixse/set-text-baseline-for-legacy-edge
fix text baseline for Legacy Edge
2 parents 6c18b7f + b246318 commit 5a3e061

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/browser/renderer/atlas/Constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* @license MIT
44
*/
55

6-
import { isFirefox } from 'common/Platform';
6+
import { isFirefox, isLegacyEdge } from 'common/Platform';
77

88
export const INVERTED_DEFAULT_COLOR = 257;
99
export const DIM_OPACITY = 0.5;
10-
// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox would
10+
// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge would
1111
// result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly
1212
// unaligned Powerline fonts (PR 3356#issuecomment-850928179).
13-
export const TEXT_BASELINE: CanvasTextBaseline = isFirefox ? 'bottom' : 'ideographic';
13+
export const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';
1414

1515
export const CHAR_ATLAS_CELL_SPACING = 1;

src/common/Platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const userAgent = (isNode) ? 'node' : navigator.userAgent;
1818
const platform = (isNode) ? 'node' : navigator.platform;
1919

2020
export const isFirefox = userAgent.includes('Firefox');
21+
export const isLegacyEdge = userAgent.includes('Edge');
2122
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
2223

2324
// Find the users platform. We use this to interpret the meta key

0 commit comments

Comments
 (0)