未验证 提交 52d00162 编写于 作者: A Alex Dima

Fixes #45742: Always reveal large boxes at the top

上级 69fd68da
......@@ -589,7 +589,10 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
let newScrollTop: number;
if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) {
if (boxEndY - boxStartY > viewportHeight) {
// the box is larger than the viewport ... scroll to its top
newScrollTop = boxStartY;
} else if (verticalType === viewEvents.VerticalRevealType.Center || verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport) {
if (verticalType === viewEvents.VerticalRevealType.CenterIfOutsideViewport && viewportStartY <= boxStartY && boxEndY <= viewportEndY) {
// Box is already in the viewport... do nothing
newScrollTop = viewportStartY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册