mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
Correctly handle overflows caused by scrollbar for the opposite axis
This commit is contained in:
committed by
Antonio Scandurra
parent
0999d0bf02
commit
e6e5420f42
@@ -1581,7 +1581,10 @@ class TextEditorComponent {
|
||||
isVerticalScrollbarVisible () {
|
||||
return (
|
||||
this.getContentHeight() > this.getScrollContainerHeight() ||
|
||||
this.isContentMinimallyOverlappingBothScrollbars()
|
||||
(
|
||||
this.getContentWidth() > this.getScrollContainerWidth() &&
|
||||
this.getContentHeight() > (this.getScrollContainerHeight() - this.getHorizontalScrollbarHeight())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1590,23 +1593,14 @@ class TextEditorComponent {
|
||||
!this.props.model.isSoftWrapped() &&
|
||||
(
|
||||
this.getContentWidth() > this.getScrollContainerWidth() ||
|
||||
this.isContentMinimallyOverlappingBothScrollbars()
|
||||
(
|
||||
this.getContentHeight() > this.getScrollContainerHeight() &&
|
||||
this.getContentWidth() > (this.getScrollContainerWidth() - this.getVerticalScrollbarWidth())
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
isContentMinimallyOverlappingBothScrollbars () {
|
||||
const clientHeightWithHorizontalScrollbar =
|
||||
this.getScrollContainerHeight() - this.getHorizontalScrollbarHeight()
|
||||
const clientWidthWithVerticalScrollbar =
|
||||
this.getScrollContainerWidth() - this.getVerticalScrollbarWidth()
|
||||
|
||||
return (
|
||||
this.getContentHeight() > clientHeightWithHorizontalScrollbar &&
|
||||
this.getContentWidth() > clientWidthWithVerticalScrollbar
|
||||
)
|
||||
}
|
||||
|
||||
getScrollHeight () {
|
||||
if (this.props.model.getScrollPastEnd()) {
|
||||
return this.getContentHeight() + Math.max(
|
||||
|
||||
Reference in New Issue
Block a user