mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add TextEditorPresenter::state.mousewheelScreenRow
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user