提交 7398d3be 编写于 作者: M Matt Bierner

Clean up reveal line logic

上级 57e54201
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册