mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Revert "WIP: Don't actually scroll the lines… just play with their margin to make them look like they scroll"
This reverts commit b3206a5a8b
.
This commit is contained in:
parent
1a6ef9d7e2
commit
e433e08c78
@ -210,11 +210,8 @@ class Editor extends View
|
||||
|
||||
@scrollbar.on 'scroll', =>
|
||||
@updateLines()
|
||||
|
||||
@lines.css('margin-top', -@scrollbar.scrollTop() % @lineHeight)
|
||||
|
||||
# @scroller.scrollTop(@scrollbar.scrollTop())
|
||||
@gutter.scrollTop(@scrollbar.scrollTop())
|
||||
@scroller.scrollTop(@scrollbar.scrollTop())
|
||||
@gutter.scrollTop(@scroller.scrollTop())
|
||||
if @scroller.scrollLeft() == 0
|
||||
@gutter.removeClass('drop-shadow')
|
||||
else
|
||||
@ -254,7 +251,7 @@ class Editor extends View
|
||||
@lastRenderedScreenRow = @getLastVisibleScreenRow()
|
||||
|
||||
@insertLineElements(0, @buildLineElements(@firstRenderedScreenRow, @lastRenderedScreenRow))
|
||||
# @lines.css('padding-bottom', (@getLastScreenRow() - @lastRenderedScreenRow) * @lineHeight)
|
||||
@lines.css('padding-bottom', (@getLastScreenRow() - @lastRenderedScreenRow) * @lineHeight)
|
||||
@scrollbarContent.height(@lineHeight * @screenLineCount())
|
||||
|
||||
updateLines: ->
|
||||
@ -263,25 +260,25 @@ class Editor extends View
|
||||
|
||||
if firstVisibleScreenRow > @firstRenderedScreenRow
|
||||
@removeLineElements(@firstRenderedScreenRow, firstVisibleScreenRow - 1)
|
||||
# @lines.css('padding-top', firstVisibleScreenRow * @lineHeight)
|
||||
@lines.css('padding-top', firstVisibleScreenRow * @lineHeight)
|
||||
|
||||
if lastVisibleScreenRow < @lastRenderedScreenRow
|
||||
@removeLineElements(lastVisibleScreenRow + 1, @lastRenderedScreenRow)
|
||||
# @lines.css('padding-bottom', (@getLastScreenRow() - lastVisibleScreenRow) * @lineHeight)
|
||||
@lines.css('padding-bottom', (@getLastScreenRow() - lastVisibleScreenRow) * @lineHeight)
|
||||
|
||||
if firstVisibleScreenRow < @firstRenderedScreenRow
|
||||
newLinesStartRow = firstVisibleScreenRow
|
||||
newLinesEndRow = Math.min(@firstRenderedScreenRow - 1, lastVisibleScreenRow)
|
||||
lineElements = @buildLineElements(newLinesStartRow, newLinesEndRow)
|
||||
@insertLineElements(newLinesStartRow, lineElements)
|
||||
# @lines.css('padding-top', firstVisibleScreenRow * @lineHeight)
|
||||
@lines.css('padding-top', firstVisibleScreenRow * @lineHeight)
|
||||
|
||||
if lastVisibleScreenRow > @lastRenderedScreenRow
|
||||
newLinesStartRow = Math.max(@lastRenderedScreenRow + 1, firstVisibleScreenRow)
|
||||
newLinesEndRow = lastVisibleScreenRow
|
||||
lineElements = @buildLineElements(newLinesStartRow, newLinesEndRow)
|
||||
@insertLineElements(newLinesStartRow, lineElements)
|
||||
# @lines.css('padding-bottom', (@getLastScreenRow() - lastVisibleScreenRow) * @lineHeight)
|
||||
@lines.css('padding-bottom', (@getLastScreenRow() - lastVisibleScreenRow) * @lineHeight)
|
||||
|
||||
@firstRenderedScreenRow = firstVisibleScreenRow
|
||||
@lastRenderedScreenRow = lastVisibleScreenRow
|
||||
|
Loading…
Reference in New Issue
Block a user