Skip to content

Fix the unexpected position of hover widgets - #205502

Merged
Daniel Imms (Tyriar) merged 9 commits into
microsoft:mainfrom
NriotHrreion:fix-205353
Feb 23, 2024
Merged

Daniel Imms (Tyriar) merged 9 commits into
microsoft:mainfrom
NriotHrreion:fix-205353

Conversation

@NriotHrreion

@NriotHrreion Norcleeh (NriotHrreion) commented Feb 19, 2024 •

Copy link
Copy Markdown
Contributor

fix #184740
fix #205353

Description

This is a brief explanation of the changes.

The original code

const top = Math.min(...targetBounds.map(e => e.top));
const right = Math.max(...targetBounds.map(e => e.right));
const bottom = Math.max(...targetBounds.map(e => e.bottom));
const left = Math.min(...targetBounds.map(e => e.left));

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

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@Tyriar Daniel Imms (Tyriar) added this to the March 2024 milestone Feb 23, 2024
auto-merge was automatically disabled February 23, 2024 22:06

Pull request was closed

@Tyriar
Daniel Imms (Tyriar) merged commit 1e07343 into microsoft:main Feb 23, 2024
@NriotHrreion
Norcleeh (NriotHrreion) deleted the fix-205353 branch February 24, 2024 01:40
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't hover over "Follow link" It's possible for terminal link hovers to be put in unhoverable locations

3 participants