mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Don't measure new lines when scrolling with the mousewheel
It impacts scrolling performance. We can measure when scrolling comes to a halt.
This commit is contained in:
@@ -257,7 +257,7 @@ EditorComponent = React.createClass
|
||||
# after mousewheel events stop being fired. Removing the target before then
|
||||
# will cause scrolling to stop suddenly.
|
||||
@preservedScreenRow = @screenRowForNode(event.target)
|
||||
@clearPreservedScreenRowAfterDelay ?= debounce(@clearPreservedScreenRow, 100)
|
||||
@clearPreservedScreenRowAfterDelay ?= debounce(@clearPreservedScreenRow, 300)
|
||||
@clearPreservedScreenRowAfterDelay()
|
||||
|
||||
# Only scroll in one direction at a time
|
||||
|
||||
@@ -44,7 +44,7 @@ LinesComponent = React.createClass
|
||||
componentDidUpdate: (prevProps) ->
|
||||
@updateModelDimensions() unless isEqualForProperties(prevProps, @props, 'fontSize', 'fontFamily', 'lineHeight')
|
||||
@clearScopedCharWidths() unless isEqualForProperties(prevProps, @props, 'fontSize', 'fontFamily')
|
||||
@measureCharactersInNewLines()
|
||||
@measureCharactersInNewLines() unless @props.preservedScreenRow?
|
||||
|
||||
updateModelDimensions: ->
|
||||
{editor} = @props
|
||||
|
||||
Reference in New Issue
Block a user