mirror of
https://github.com/atom/atom.git
synced 2026-02-13 16:14:59 -05:00
Make sure scroll positions are integers
This commit is contained in:
@@ -1526,13 +1526,13 @@ class TextEditorPresenter
|
||||
@setScrollRight(desiredScrollRight)
|
||||
|
||||
commitPendingScrollLeftPosition: ->
|
||||
scrollLeft = @constrainScrollLeft(@pendingScrollLeft)
|
||||
scrollLeft = Math.round(@constrainScrollLeft(@pendingScrollLeft))
|
||||
if scrollLeft isnt @scrollLeft and not Number.isNaN(scrollLeft)
|
||||
@scrollLeft = scrollLeft
|
||||
@model.setScrollLeft(scrollLeft)
|
||||
|
||||
commitPendingScrollTopPosition: ->
|
||||
scrollTop = @constrainScrollTop(@pendingScrollTop)
|
||||
scrollTop = Math.round(@constrainScrollTop(@pendingScrollTop))
|
||||
if scrollTop isnt @scrollTop and not Number.isNaN(scrollTop)
|
||||
@scrollTop = scrollTop
|
||||
@model.setScrollTop(scrollTop)
|
||||
|
||||
Reference in New Issue
Block a user