mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fixed an error when previewing the first line with Markdown extension (#43835)
This commit is contained in:
parent
c168e385ef
commit
d17652218a
|
@ -155,9 +155,10 @@
|
|||
if (previous) {
|
||||
if (next) {
|
||||
const betweenProgress = (offset - window.scrollY - previous.element.getBoundingClientRect().top) / (next.element.getBoundingClientRect().top - previous.element.getBoundingClientRect().top);
|
||||
return previous.line + betweenProgress * (next.line - previous.line);
|
||||
const line = previous.line + betweenProgress * (next.line - previous.line);
|
||||
return (0 <= line) ? line : 0;
|
||||
} else {
|
||||
return previous.line;
|
||||
return (0 <= previous.line) ? previous.line : 0;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue