mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Use presenter’s scrollTop/scrollLeft in LinesComponent
This commit is contained in:
@@ -232,6 +232,7 @@ TextEditorComponent = React.createClass
|
||||
clientHeight: editor.getHeight()
|
||||
clientWidth: editor.getWidth()
|
||||
scrollTop: editor.getScrollTop()
|
||||
scrollLeft: editor.getScrollLeft()
|
||||
lineHeight: editor.getLineHeightInPixels()
|
||||
baseCharacterWidth: editor.getDefaultCharWidth()
|
||||
lineOverdrawMargin: lineOverdrawMargin
|
||||
@@ -393,7 +394,7 @@ TextEditorComponent = React.createClass
|
||||
@subscribe editor.onDidChangeCharacterWidths(@onCharacterWidthsChanged)
|
||||
@subscribe editor.onDidChangePlaceholderText(@onPlaceholderTextChanged)
|
||||
@subscribe editor.$scrollTop.changes, @onScrollTopChanged
|
||||
@subscribe editor.$scrollLeft.changes, @requestUpdate
|
||||
@subscribe editor.$scrollLeft.changes, @onScrollLeftChanged
|
||||
@subscribe editor.$verticalScrollbarWidth.changes, @requestUpdate
|
||||
@subscribe editor.$horizontalScrollbarHeight.changes, @requestUpdate
|
||||
@subscribe editor.$height.changes, @requestUpdate
|
||||
@@ -530,6 +531,7 @@ TextEditorComponent = React.createClass
|
||||
unless animationFramePending
|
||||
@requestAnimationFrame =>
|
||||
@props.editor.setScrollLeft(@pendingScrollLeft)
|
||||
@presenter?.setScrollLeft(@pendingScrollLeft)
|
||||
@pendingScrollLeft = null
|
||||
|
||||
onMouseWheel: (event) ->
|
||||
@@ -725,6 +727,10 @@ TextEditorComponent = React.createClass
|
||||
@onStoppedScrollingAfterDelay ?= debounce(@onStoppedScrolling, 200)
|
||||
@onStoppedScrollingAfterDelay()
|
||||
|
||||
onScrollLeftChanged: ->
|
||||
@presenter?.setScrollLeft(@props.editor.getScrollLeft())
|
||||
@requestUpdate()
|
||||
|
||||
onStoppedScrolling: ->
|
||||
return unless @isMounted()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user