From 3bc11ede770262bf2804ba253d2c8568abcabb9a Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 9 Nov 2012 14:25:59 -0700 Subject: [PATCH] Set the lines div height explicitly so it can be > 100% of parent All editor specs pass --- spec/app/editor-spec.coffee | 2 ++ src/app/editor.coffee | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index aaccdf805..2b6e72f45 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -483,6 +483,8 @@ fdescribe "Editor", -> describe "when the font size changes on the view", -> it "updates the font sizes of editors and recalculates dimensions critical to cursor positioning", -> rootView.attachToDom() + rootView.height(200) + rootView.width(200) rootView.setFontSize(10) lineHeightBefore = editor.lineHeight charWidthBefore = editor.charWidth diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 4c542de56..bf40bfdfa 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -868,8 +868,10 @@ class Editor extends View @renderedLines.css('padding-bottom', paddingBottom) @gutter.lineNumbers.css('padding-bottom', paddingBottom) - @underlayer.height(@screenLineCount() * @lineHeight) - @overlayer.height(@screenLineCount() * @lineHeight) + linesHeight = @screenLineCount() * @lineHeight + @renderedLines.height(linesHeight) + @underlayer.height(linesHeight) + @overlayer.height(linesHeight) getFirstVisibleScreenRow: -> Math.floor(@scrollTop() / @lineHeight)