Revert "Use clientHeight for line-numbers and lines containers"

This reverts commit f2bab35f57c05d5a0bb21e9fb02117f802ff278b. It didn't actually
improve performance, nor memory usage, therefore I decided to avoid changing it
for the time being.
This commit is contained in:
Antonio Scandurra
2015-06-04 15:15:29 +02:00
parent 3e517e687a
commit 8abdc67e7e
4 changed files with 6 additions and 9 deletions

View File

@@ -15,6 +15,9 @@ module.exports =
# Sets scrollHeight, scrollTop, and backgroundColor on the given domNode.
setDimensionsAndBackground: (oldState, newState, domNode) ->
if newState.scrollHeight isnt oldState.scrollHeight
domNode.style.height = newState.scrollHeight + 'px'
oldState.scrollHeight = newState.scrollHeight
if newState.backgroundColor isnt oldState.backgroundColor
domNode.style.backgroundColor = newState.backgroundColor

View File

@@ -48,10 +48,6 @@ class LineNumberGutterComponent extends TiledComponent
setDimensionsAndBackground(@oldState.styles, @newState.styles, @lineNumbersNode)
if @newState.height isnt @oldState.height
@lineNumbersNode.style.height = @newState.height + "px"
@oldState.height = @newState.height
if @newState.maxLineNumberDigits isnt @oldState.maxLineNumberDigits
@updateDummyLineNumber()
@oldState.styles = {}

View File

@@ -33,9 +33,9 @@ class LinesComponent extends TiledComponent
@oldState.indentGuidesVisible isnt @newState.indentGuidesVisible
beforeUpdateSync: (state) ->
if @newState.clientHeight isnt @oldState.clientHeight
@domNode.style.height = @newState.clientHeight + 'px'
@oldState.clientHeight = @newState.clientHeight
if @newState.scrollHeight isnt @oldState.scrollHeight
@domNode.style.height = @newState.scrollHeight + 'px'
@oldState.scrollHeight = @newState.scrollHeight
if @newState.backgroundColor isnt @oldState.backgroundColor
@domNode.style.backgroundColor = @newState.backgroundColor

View File

@@ -453,7 +453,6 @@ class TextEditorPresenter
return
updateLineNumberGutterState: ->
@lineNumberGutter.height = @clientHeight
@lineNumberGutter.maxLineNumberDigits = @model.getLineCount().toString().length
updateCommonGutterState: ->
@@ -657,7 +656,6 @@ class TextEditorPresenter
clientHeight = @height - @horizontalScrollbarHeight
unless @clientHeight is clientHeight
@clientHeight = clientHeight
@state.content.clientHeight = @clientHeight
@updateScrollHeight()
@updateScrollTop()