mirror of
https://github.com/atom/atom.git
synced 2026-02-06 20:55:33 -05:00
Use clientHeight for line-numbers and lines containers
This commit is contained in:
@@ -15,9 +15,6 @@ 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
|
||||
|
||||
@@ -48,6 +48,10 @@ 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 = {}
|
||||
|
||||
@@ -33,9 +33,9 @@ class LinesComponent extends TiledComponent
|
||||
@oldState.indentGuidesVisible isnt @newState.indentGuidesVisible
|
||||
|
||||
beforeUpdateSync: (state) ->
|
||||
if @newState.scrollHeight isnt @oldState.scrollHeight
|
||||
@domNode.style.height = @newState.scrollHeight + 'px'
|
||||
@oldState.scrollHeight = @newState.scrollHeight
|
||||
if @newState.clientHeight isnt @oldState.clientHeight
|
||||
@domNode.style.height = @newState.clientHeight + 'px'
|
||||
@oldState.clientHeight = @newState.clientHeight
|
||||
|
||||
if @newState.backgroundColor isnt @oldState.backgroundColor
|
||||
@domNode.style.backgroundColor = @newState.backgroundColor
|
||||
|
||||
@@ -453,6 +453,7 @@ class TextEditorPresenter
|
||||
return
|
||||
|
||||
updateLineNumberGutterState: ->
|
||||
@lineNumberGutter.height = @clientHeight
|
||||
@lineNumberGutter.maxLineNumberDigits = @model.getLineCount().toString().length
|
||||
|
||||
updateCommonGutterState: ->
|
||||
@@ -656,6 +657,7 @@ class TextEditorPresenter
|
||||
clientHeight = @height - @horizontalScrollbarHeight
|
||||
unless @clientHeight is clientHeight
|
||||
@clientHeight = clientHeight
|
||||
@state.content.clientHeight = @clientHeight
|
||||
@updateScrollHeight()
|
||||
@updateScrollTop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user