Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
os-lmo authored Oct 12, 2023
1 parent 75e0085 commit 92cc555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/monaco/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "monaco-editor-core",
"private": true,
"version": "0.31.1-os",
"version": "0.31.1-os2",
"description": "A browser based code editor",
"author": "Microsoft Corporation",
"license": "MIT",
Expand Down
10 changes: 8 additions & 2 deletions src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,14 @@ export function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y:
// Grab its rect
const rect = el.getBoundingClientRect();

// And its font
const font = window.getComputedStyle(el, null).getPropertyValue('font');
// And its font (the computed shorthand font property might be empty, see #3217)
const fontStyle = window.getComputedStyle(el, null).getPropertyValue('font-style');
const fontVariant = window.getComputedStyle(el, null).getPropertyValue('font-variant');
const fontWeight = window.getComputedStyle(el, null).getPropertyValue('font-weight');
const fontSize = window.getComputedStyle(el, null).getPropertyValue('font-size');
const lineHeight = window.getComputedStyle(el, null).getPropertyValue('line-height');
const fontFamily = window.getComputedStyle(el, null).getPropertyValue('font-family');
const font = `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}/${lineHeight} ${fontFamily}`;

// And also its txt content
const text = (el as any).innerText;
Expand Down

0 comments on commit 92cc555

Please sign in to comment.