From e433e08c780a318950231efe1b520ccab005d9d9 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Thu, 10 May 2012 18:05:25 -0600 Subject: [PATCH] =?UTF-8?q?Revert=20"WIP:=20Don't=20actually=20scroll=20th?= =?UTF-8?q?e=20lines=E2=80=A6=20just=20play=20with=20their=20margin=20to?= =?UTF-8?q?=20make=20them=20look=20like=20they=20scroll"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b3206a5a8b63578fa6e285462368269f5d3df055. --- src/app/editor.coffee | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 3223c7e61..4bf819c98 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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