mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Take progress within element into account for markdown scroll sync
Fixes #65504
This commit is contained in:
parent
88bc3b3d35
commit
cba84fba5e
File diff suppressed because one or more lines are too long
|
@ -110,7 +110,8 @@ export function scrollToRevealSourceLine(line: number) {
|
|||
const elementOffset = next.element.getBoundingClientRect().top - previousTop;
|
||||
scrollTo = previousTop + betweenProgress * elementOffset;
|
||||
} else {
|
||||
scrollTo = previousTop;
|
||||
const progressInElement = line - Math.floor(line);
|
||||
scrollTo = previousTop + (rect.height * progressInElement);
|
||||
}
|
||||
window.scroll(window.scrollX, Math.max(1, window.scrollY + scrollTo));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue