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:
Nathan Sobo
2014-04-17 12:19:04 -06:00
parent f02d956362
commit 201e00aa83
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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