mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Report the already calculated height to the model
This commit is contained in:
@@ -200,21 +200,13 @@ class DisplayBuffer extends Model
|
||||
setVerticalScrollbarWidth: (@verticalScrollbarWidth) -> @verticalScrollbarWidth
|
||||
|
||||
getHeight: ->
|
||||
if @height?
|
||||
@height
|
||||
else
|
||||
if @horizontallyScrollable()
|
||||
@getScrollHeight() + @getHorizontalScrollbarHeight()
|
||||
else
|
||||
@getScrollHeight()
|
||||
@height or 0
|
||||
|
||||
setHeight: (@height) -> @height
|
||||
setHeight: (@height) ->
|
||||
@height
|
||||
|
||||
getClientHeight: (reentrant) ->
|
||||
if @horizontallyScrollable(reentrant)
|
||||
@getHeight() - @getHorizontalScrollbarHeight()
|
||||
else
|
||||
@getHeight()
|
||||
@getHeight()
|
||||
|
||||
getClientWidth: (reentrant) ->
|
||||
if @verticallyScrollable(reentrant)
|
||||
|
||||
@@ -50,7 +50,7 @@ class TextEditorPresenter
|
||||
@emitter.emit "did-update-state" if @isBatching()
|
||||
|
||||
transferMeasurementsToModel: ->
|
||||
@model.setHeight(@explicitHeight) if @explicitHeight?
|
||||
# @model.setHeight(@explicitHeight) if @explicitHeight?
|
||||
@model.setWidth(@contentFrameWidth) if @contentFrameWidth?
|
||||
@model.setLineHeightInPixels(@lineHeight) if @lineHeight?
|
||||
@model.setDefaultCharWidth(@baseCharacterWidth) if @baseCharacterWidth?
|
||||
@@ -688,6 +688,7 @@ class TextEditorPresenter
|
||||
clientHeight = @height - @horizontalScrollbarHeight
|
||||
unless @clientHeight is clientHeight
|
||||
@clientHeight = clientHeight
|
||||
@model.setHeight(@clientHeight)
|
||||
@updateScrollHeight()
|
||||
@updateScrollTop()
|
||||
|
||||
@@ -919,7 +920,6 @@ class TextEditorPresenter
|
||||
setExplicitHeight: (explicitHeight) ->
|
||||
unless @explicitHeight is explicitHeight
|
||||
@explicitHeight = explicitHeight
|
||||
@model.setHeight(explicitHeight)
|
||||
@updateHeight()
|
||||
@shouldUpdateVerticalScrollState = true
|
||||
@shouldUpdateScrollbarsState = true
|
||||
|
||||
Reference in New Issue
Block a user