Stop reporting scroll positions to the model

This commit is contained in:
Antonio Scandurra
2015-09-23 11:23:18 +02:00
parent fda981ed1d
commit 60fdd3793f
3 changed files with 5 additions and 12 deletions

View File

@@ -54,10 +54,6 @@ class TextEditorPresenter
@model.setWidth(@contentFrameWidth) if @contentFrameWidth?
@model.setLineHeightInPixels(@lineHeight) if @lineHeight?
@model.setDefaultCharWidth(@baseCharacterWidth) if @baseCharacterWidth?
@model.setScrollTop(@scrollTop) if @scrollTop?
@model.setScrollLeft(@scrollLeft) if @scrollLeft?
@model.setVerticalScrollbarWidth(@measuredVerticalScrollbarWidth) if @measuredVerticalScrollbarWidth?
@model.setHorizontalScrollbarHeight(@measuredHorizontalScrollbarHeight) if @measuredHorizontalScrollbarHeight?
# Private: Determines whether {TextEditorPresenter} is currently batching changes.
# Returns a {Boolean}, `true` if is collecting changes, `false` if is applying them.
@@ -1538,13 +1534,11 @@ class TextEditorPresenter
scrollLeft = Math.round(@constrainScrollLeft(@pendingScrollLeft))
if scrollLeft isnt @scrollLeft and not Number.isNaN(scrollLeft)
@scrollLeft = scrollLeft
@model.setScrollLeft(scrollLeft)
commitPendingScrollTopPosition: ->
scrollTop = Math.round(@constrainScrollTop(@pendingScrollTop))
if scrollTop isnt @scrollTop and not Number.isNaN(scrollTop)
@scrollTop = scrollTop
@model.setScrollTop(scrollTop)
updateScrollPosition: ->
@commitPendingLogicalScrollPosition() if @pendingScrollLogicalPosition?