vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Fix the unexpected position of hover widgets

Open NriotHrreion opened this issue 1 year ago • 0 comments

fix #205353

Description

This is a brief explanation of the changes.

The original code https://github.com/microsoft/vscode/blob/11095a2781bd2a14cbaddc1b925f196f1e9452bc/src/vs/editor/browser/widget/hoverWidget/hoverWidget.ts#L334-L337 will select a bound like this:

屏幕截图 2024-02-19 093414

which will position the hover widget at the top-left corner of the bound. And this will make the link in the widget impossible to reach for the mouse.

The changed code

const { top, right, bottom, left } = targetBounds[0];

will select a bound like this:

屏幕截图 2024-02-19 094124

which makes the widget reachable.

Effect

Before

image

After

image

NriotHrreion avatar Feb 19 '24 01:02 NriotHrreion