mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Use presenter’s scrollingVertically property to defer line measurement
This commit is contained in:
parent
d4517b1ab0
commit
b21b9c3402
@ -70,12 +70,12 @@ LinesComponent = React.createClass
|
||||
@overlayManager = new OverlayManager(@getDOMNode())
|
||||
|
||||
componentDidUpdate: ->
|
||||
{visible, scrollingVertically, presenter} = @props
|
||||
{visible, presenter} = @props
|
||||
return unless presenter?
|
||||
|
||||
@removeLineNodes() unless @oldState?.content.indentGuidesVisible is @newState?.content.indentGuidesVisible
|
||||
@updateLineNodes()
|
||||
@measureCharactersInNewLines() if visible and not scrollingVertically
|
||||
@measureCharactersInNewLines() if visible and not presenter.state.scrollingVertically
|
||||
|
||||
@overlayManager?.render(@props)
|
||||
|
||||
|
@ -33,7 +33,6 @@ TextEditorComponent = React.createClass
|
||||
updateRequestedWhilePaused: false
|
||||
cursorMoved: false
|
||||
selectionChanged: false
|
||||
scrollingVertically: false
|
||||
mouseWheelScreenRow: null
|
||||
mouseWheelScreenRowClearDelay: 150
|
||||
scrollSensitivity: 0.4
|
||||
@ -100,7 +99,7 @@ TextEditorComponent = React.createClass
|
||||
|
||||
LinesComponent {
|
||||
ref: 'lines', @presenter, editor, hostElement, @useHardwareAcceleration, useShadowDOM,
|
||||
@scrollingVertically, mouseWheelScreenRow, visible, placeholderText, @backgroundColor
|
||||
mouseWheelScreenRow, visible, placeholderText, @backgroundColor
|
||||
}
|
||||
|
||||
ScrollbarComponent
|
||||
@ -215,6 +214,7 @@ TextEditorComponent = React.createClass
|
||||
lineOverdrawMargin: lineOverdrawMargin
|
||||
cursorBlinkPeriod: cursorBlinkPeriod
|
||||
cursorBlinkResumeDelay: cursorBlinkResumeDelay
|
||||
stoppedScrollingDelay: 200
|
||||
backgroundColor: @backgroundColor
|
||||
@presenter.onDidUpdateState(@requestUpdate)
|
||||
|
||||
@ -610,7 +610,6 @@ TextEditorComponent = React.createClass
|
||||
@requestUpdate()
|
||||
|
||||
onScrollTopChanged: ->
|
||||
@scrollingVertically = true
|
||||
@presenter?.setScrollTop(@props.editor.getScrollTop())
|
||||
@requestUpdate()
|
||||
@onStoppedScrollingAfterDelay ?= debounce(@onStoppedScrolling, 200)
|
||||
@ -623,7 +622,6 @@ TextEditorComponent = React.createClass
|
||||
onStoppedScrolling: ->
|
||||
return unless @isMounted()
|
||||
|
||||
@scrollingVertically = false
|
||||
@mouseWheelScreenRow = null
|
||||
@requestUpdate()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user