mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Pre-assign measuremets.scrollTop when autoscrolling
This avoids work when the scroll event happens asynchronously because we'll treat the event as a no-op since the measurements didn't change.
This commit is contained in:
committed by
Antonio Scandurra
parent
192e7c6b63
commit
55ed9e4f62
@@ -665,6 +665,10 @@ class TextEditorComponent {
|
||||
this.autoscrollTop = desiredScrollBottom - this.measurements.clientHeight
|
||||
}
|
||||
}
|
||||
|
||||
if (this.autoscrollTop != null) {
|
||||
this.measurements.scrollTop = this.autoscrollTop
|
||||
}
|
||||
}
|
||||
|
||||
getVerticalScrollMargin () {
|
||||
@@ -849,9 +853,7 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
getScrollTop () {
|
||||
if (this.autoscrollTop != null) {
|
||||
return this.autoscrollTop
|
||||
} else if (this.measurements != null) {
|
||||
if (this.measurements != null) {
|
||||
return this.measurements.scrollTop
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user