mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Clean up reveal line logic
This commit is contained in:
parent
57e5420127
commit
7398d3be89
|
@ -156,9 +156,9 @@
|
|||
if (next) {
|
||||
const betweenProgress = (offset - window.scrollY - previous.element.getBoundingClientRect().top) / (next.element.getBoundingClientRect().top - previous.element.getBoundingClientRect().top);
|
||||
const line = previous.line + betweenProgress * (next.line - previous.line);
|
||||
return (0 <= line) ? line : 0;
|
||||
return Math.max(line, 0);
|
||||
} else {
|
||||
return (0 <= previous.line) ? previous.line : 0;
|
||||
return Math.max(previous.line, 0);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue