Add TextEditorPresenter::state.mousewheelScreenRow

This commit is contained in:
Nathan Sobo
2015-01-27 18:34:17 -07:00
parent a88486e950
commit da5ee3fa86
2 changed files with 44 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ class TextEditorPresenter
buildState: ->
@state =
scrollingVertically: false
mousewheelScreenRow: null
content:
blinkCursorsOff: false
lines: {}
@@ -360,10 +361,13 @@ class TextEditorPresenter
@stoppedScrollingTimeoutId = null
@stoppedScrollingTimeoutId = setTimeout(@didStopScrolling.bind(this), @stoppedScrollingDelay)
@state.scrollingVertically = true
@state.mousewheelScreenRow = @getMousewheelScreenRow()
@emitter.emit 'did-update-state'
didStopScrolling: ->
@state.scrollingVertically = false
@state.mousewheelScreenRow = null
@mousewheelScreenRow = null
@emitter.emit 'did-update-state'
getScrollTop: -> @scrollTop
@@ -413,6 +417,11 @@ class TextEditorPresenter
getLineHeight: -> @lineHeight
setMousewheelScreenRow: (@mousewheelScreenRow) ->
@state.mousewheelScreenRow = @mousewheelScreenRow if @state.scrollingVertically
getMousewheelScreenRow: -> @mousewheelScreenRow
setBaseCharacterWidth: (@baseCharacterWidth) ->
@characterWidthsChanged()